UNPKG

@lou.codes/predicates

Version:
16 lines (15 loc) 469 B
/** * `instanceof Promise` alias. * * @category Objects * @example * ```typescript * isPromise(new Promise()); // true * isPromise((async () => {})()); // true * isPromise(fetch("https://lou.codes")); // true * isPromise(Promise.resolve("Lou")); // true * isPromise("Lou"); // false * ``` * @returns `true` if the given value is an instance of `Promise`, `false` otherwise. */ export declare const isPromise: (input: unknown) => input is Promise<unknown>;