isPromise es-toolkit
Checks if a given value is a Promise instance.
Usage
isPromise(value)
Use isPromise when you want to check if a value is a Promise instance. It's useful when you need to distinguish Promise objects from other values in asynchronous code, or when you need to conditionally use await.
It's useful when executing logic conditionally in asynchronous functions.
You can distinguish between Promise-like objects and actual Promises.
It can also be used for error handling.
Parameters
The value to check if it's a Promise instance.
Returns
Returns true if the value is a Promise instance, false otherwise.
Source: es-toolkit
Re-exported verbatim from es-toolkit. Implementation, edge cases, and performance behavior are owned upstream. This page mirrors the documentation at the pinned version; the linked source is authoritative.