初始化
This commit is contained in:
17
uni_modules/UniDevTools/node_modules/licia/callbackify.js
generated
vendored
Normal file
17
uni_modules/UniDevTools/node_modules/licia/callbackify.js
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
var restArgs = require('./restArgs');
|
||||
exports = function(fn) {
|
||||
return restArgs(function(args) {
|
||||
var cb = args.pop();
|
||||
fn.apply(this, args).then(
|
||||
function(value) {
|
||||
cb(null, value);
|
||||
},
|
||||
function(err) {
|
||||
if (err === null) err = new Error();
|
||||
cb(err);
|
||||
}
|
||||
);
|
||||
});
|
||||
};
|
||||
|
||||
module.exports = exports;
|
||||
Reference in New Issue
Block a user