Skip to content

isPromise

Returns true if the value is a Promise or has a `then` method.

Usage

isPromise(Promise.resolve(1)); // => true
isPromise({ then() {} }); // => true
isPromise(1); // => false

Installation

Terminal window
npx atmx add helper is-promise