Skip to main content

isPromise

Detect whether a object is Promise.

API

function isPromise(value: any): value is Promise<any>;

Example

import { isPromise } from "@lilib/utils";

isPromise(new Promise(() => {}));
// => true

isPromise({});
// => false