Skip to main content

isPromise

Validates if the supplied input is a Promise.

Signature

isPromise(input: any): boolean

Parameters

NameTypeOptionalDescription
inputanyNoInput to validate.

Return value

Returns true if the input is a promise.

Example

import { isPromise } from "@tripetto/builder";

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