智能照明系统APP-本地串口
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.
 
 
 
 
 
 
LightingSystemApp-serial/.svn/pristine/89/895793a1ab8cce2b284b5823e71...

27 lines
655 B

var isFn = require('./isFn');
var restArgs = require('./restArgs');
exports = function(fn) {
if (isFn(fn)) {
return restArgs(function(args) {
return fn
.apply(this, args)
.then(function(v) {
return [v, null];
})
.catch(function(err) {
return [void 0, err];
});
});
} else {
return fn
.then(function(v) {
return [v, null];
})
.catch(function(err) {
return [void 0, err];
});
}
};
module.exports = exports;