Bakhtina Sofya b84cb877be 1st comm | hace 2 semanas | |
---|---|---|
.. | ||
LICENSE | hace 2 semanas | |
index.js | hace 2 semanas | |
index.mjs | hace 2 semanas | |
package.json | hace 2 semanas | |
readme.md | hace 2 semanas |
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