wallet-core/node_modules/async/internal/consoleFunc.js

35 lines
1.0 KiB
JavaScript
Raw Normal View History

2016-10-10 03:43:44 +02:00
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = consoleFunc;
var _arrayEach = require('lodash/_arrayEach');
var _arrayEach2 = _interopRequireDefault(_arrayEach);
2016-11-03 01:33:53 +01:00
var _baseRest = require('lodash/_baseRest');
2016-10-10 03:43:44 +02:00
2016-11-03 01:33:53 +01:00
var _baseRest2 = _interopRequireDefault(_baseRest);
2016-10-10 03:43:44 +02:00
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function consoleFunc(name) {
2016-11-03 01:33:53 +01:00
return (0, _baseRest2.default)(function (fn, args) {
fn.apply(null, args.concat([(0, _baseRest2.default)(function (err, args) {
2016-10-10 03:43:44 +02:00
if (typeof console === 'object') {
if (err) {
if (console.error) {
console.error(err);
}
} else if (console[name]) {
(0, _arrayEach2.default)(args, function (x) {
console[name](x);
});
}
}
})]));
});
}
module.exports = exports['default'];