UNPKG

@sapphire/utilities

Version:
20 lines (18 loc) 675 B
import { __name } from '../chunk-PAWJFY3S.mjs'; import { isFunction } from './isFunction.mjs'; function hasThen(input) { return Reflect.has(input, "then") && isFunction(input.then); } __name(hasThen, "hasThen"); function hasCatch(input) { return Reflect.has(input, "catch") && isFunction(input.catch); } __name(hasCatch, "hasCatch"); function isThenable(input) { if (typeof input !== "object" || input === null) return false; return input instanceof Promise || input !== Promise.prototype && hasThen(input) && hasCatch(input); } __name(isThenable, "isThenable"); export { isThenable }; //# sourceMappingURL=isThenable.mjs.map //# sourceMappingURL=isThenable.mjs.map