proback.js
Advanced tools
Comparing version 1.2.1 to 1.5.0
module.exports = { | ||
quicker: function ( res, callback ) { | ||
return new Promise( (resolve, reject) => { | ||
if (callback) callback( null, res ) | ||
resolve(res) | ||
} ) | ||
}, | ||
forAll: function ( promises, callback ) { | ||
return new Promise( (resolve, reject) => { | ||
Promise.all( promises ) | ||
.then( (res) => { | ||
if (callback) callback(null, res) | ||
resolve( res ) | ||
} ) | ||
.catch( (reason) => { | ||
if (callback) callback(reason) | ||
reject( reason ) | ||
} ) | ||
} ) | ||
}, | ||
handler: function ( callback, resolve, reject ) { | ||
@@ -3,0 +22,0 @@ return function (err, res) { |
{ | ||
"name": "proback.js", | ||
"version": "1.2.1", | ||
"version": "1.5.0", | ||
"description": "Tiny libary to aid Promise/Callback dual API design", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
10598
9
247