root 3bf41bf355 update | il y a 1 an | |
---|---|---|
.. | ||
LICENSE | il y a 1 an | |
index.js | il y a 1 an | |
index.mjs | il y a 1 an | |
package.json | il y a 1 an | |
readme.md | il y a 1 an |
Test whether an object looks like a promises-a+ promise
$ npm install is-promise
You can also use it client side via npm.
import isPromise from 'is-promise';
isPromise(Promise.resolve());//=>true
isPromise({then:function () {...}});//=>true
isPromise(null);//=>false
isPromise({});//=>false
isPromise({then: true})//=>false
MIT