You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
632 B
26 lines
632 B
"use strict";
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
|
|
exports["default"] = function () {
|
|
var PromiseArg = arguments[0] === undefined ? Promise : arguments[0];
|
|
return function (f) {
|
|
return function () {
|
|
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
|
args[_key] = arguments[_key];
|
|
}
|
|
|
|
return new PromiseArg(function (resolve, reject) {
|
|
return f.apply(undefined, args.concat([function (err, val) {
|
|
return err ? reject(err) : resolve(val);
|
|
}]));
|
|
});
|
|
};
|
|
};
|
|
};
|
|
|
|
module.exports = exports["default"];
|
|
|