The NOT (!) operator for promises
Install promise-not using npm:
npm install --save promise-notvar not = require('promise-not');
not(Promise.resolve(false))
.then(function (val) {
// val === true
});| Name | Type | Description |
|---|---|---|
val |
Mixed |
Value to run ! on |
Returns: Promise, which resolves to the invers of what val resolves to.
MIT © Joakim Carlstein