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