chuwanghui 6d115466a5 electron库 | %!s(int64=6) %!d(string=hai) anos | |
---|---|---|
.. | ||
.npmignore | %!s(int64=6) %!d(string=hai) anos | |
.travis.yml | %!s(int64=6) %!d(string=hai) anos | |
LICENSE | %!s(int64=6) %!d(string=hai) anos | |
index.js | %!s(int64=6) %!d(string=hai) anos | |
package.json | %!s(int64=6) %!d(string=hai) anos | |
readme.md | %!s(int64=6) %!d(string=hai) anos |
Test whether an object looks like a promises-a+ promise
$ npm install is-promise
You can also use it client side via npm.
var isPromise = require('is-promise');
isPromise({then:function () {...}});//=>true
isPromise(null);//=>false
isPromise({});//=>false
isPromise({then: true})//=>false
MIT