IsPromiseLike
Usage with JS
const isPromise isPromiseLike } =
Usage with ES
isPromise
identifies instances of the global Promise
class.
isPromiseLike
identifies instances of the global Promise
class or other objects which are like them.
isPromise
Examples: Returns true
:
const p = {} // true
const p = Promise // true
const p = Promiseall // true
Anything else should return false
.
isPromiseLike
Examples: All of the preceding examples returning true
. In addition:
static {} // true
{} const s = // true
const o = {}o {} // true
const a = a {} // true
And similar constructions for other types. Anything else should return false
.