We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 00d20d9 commit 23fd51dCopy full SHA for 23fd51d
lib/promises.js
@@ -11,8 +11,17 @@ exports.toExternalPromise = toExternalPromise;
11
12
exports.nfcall = function(func) {
13
var args = Array.prototype.slice.call(arguments, 1);
14
- var promisedFunc = bluebird.promisify(func);
15
- return promisedFunc.apply(null, args);
+
+ return new Promise(function(resolve, reject) {
16
+ args.push(function(error, value) {
17
+ if (error) {
18
+ reject(error);
19
+ } else {
20
+ resolve(value);
21
+ }
22
+ });
23
+ func.apply(null, args);
24
25
};
26
27
function props(obj) {
0 commit comments