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