Bakhtina Sofya b84cb877be 1st comm | há 3 semanas atrás | |
---|---|---|
.. | ||
LICENSE | há 3 semanas atrás | |
index.js | há 3 semanas atrás | |
index.mjs | há 3 semanas atrás | |
package.json | há 3 semanas atrás | |
readme.md | há 3 semanas atrás |
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