isPromise
Validates if the supplied input is a Promise.
Signature
isPromise(input: any): boolean
Parameters
| Name | Type | Optional | Description |
|---|---|---|---|
input | any | No | Input to validate. |
Return value
Returns true if the input is a promise.
Example
import { isPromise } from "@tripetto/builder";
isPromise(new Promise(() => {})); // Returns `true`