is-bluebird.js
Is this a bluebird promise I see before me?
Usage
Tools to check whether some input is a bluebird promise, a bluebird promise constructor, or determining the version of bluebird from a promise or constructor.
isBluebird( promise )
Returns true if is a bluebird promise, false if not.
var isBluebird = ;var Bluebird = ; console; // trueconsole; // false (native JS promise)
isBluebird.ctor( Promise )
Returns true if is bluebird promise constructor, false if not.
var isBluebird = ;var Bluebird = ; console; // trueconsole; // false (native JS promise)
isBluebird.v2( promise )
/ isBluebird.v3( promise )
Returns true if is a bluebird promise of the specified version.
var isBluebird = ;var Bluebird2 = ;var Bluebird3 = ; console; // trueconsole; // falseconsole; // false (native JS promise)
isBluebird.v2.ctor( Promise )
/ isBluebird.v3.ctor( Promise )
Returns true if is bluebird promise constructor of the specified version.
var isBluebird = ;var Bluebird2 = ;var Bluebird3 = ; console; // trueconsole; // falseconsole; // false (native JS promise)
Tests
Use npm test
to run the tests. Use npm run cover
to check coverage.
Changelog
See changelog.md
Issues
If you discover a bug, please raise an issue on Github. https://github.com/overlookmotel/is-bluebird/issues
Contribution
Pull requests are very welcome. Please:
- ensure all tests pass before submitting PR
- add an entry to changelog
- add tests for new features
- document new functionality/API additions in README