Checks if a value is a native Promise instance.
This guard is intentionally strict and uses instanceof Promise semantics. It does not use .then() / .catch() feature sniffing.
instanceof Promise
.then()
.catch()
Use isPromiseLike if you want to accept general thenables.
isPromise(Promise.resolve(123)) => trueisPromise(new Promise(() => {})) => trueisPromise({ then: () => {}, catch: () => {} }) => falseisPromise(42) => false Copy
isPromise(Promise.resolve(123)) => trueisPromise(new Promise(() => {})) => trueisPromise({ then: () => {}, catch: () => {} }) => falseisPromise(42) => false
Checks if a value is a native Promise instance.
This guard is intentionally strict and uses
instanceof Promisesemantics. It does not use.then()/.catch()feature sniffing.Use isPromiseLike if you want to accept general thenables.