Comparing version 3.8.3 to 3.8.4
'use strict'; | ||
module.exports = function (PromiseCtor) { | ||
if (PromiseCtor === false) { | ||
return function (callback) { | ||
return { callback: callback || function () {} }; | ||
return function () { | ||
var callback = arguments[0] === undefined ? function () {} : arguments[0]; | ||
return { callback: callback }; | ||
}; | ||
} | ||
return function (callback) { | ||
return function () { | ||
var callback = arguments[0] === undefined ? function () {} : arguments[0]; | ||
if (!PromiseCtor && typeof Promise !== 'function') { | ||
return { callback: callback || function () {} }; | ||
return { callback: callback }; | ||
} | ||
function defer(resolve, reject) { | ||
var errback = callback; | ||
callback = function (err, res) { | ||
if (err) reject(err);else resolve(res); | ||
if (errback) errback(err, res); | ||
}; | ||
} | ||
var cb = callback; | ||
var promise = PromiseCtor ? new PromiseCtor(defer) : new Promise(defer); | ||
if (cb) { | ||
promise.then(function (result) { | ||
return cb(null, result); | ||
}, function (reason) { | ||
return cb(reason); | ||
}); | ||
} | ||
return { callback: callback, promise: promise }; | ||
}; | ||
}; |
{ | ||
"name": "arangojs", | ||
"version": "3.8.3", | ||
"version": "3.8.4", | ||
"description": "The official ArangoDB JavaScript driver.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
162715
1670