(name)
| 3 | import wrapAsync from './wrapAsync'; |
| 4 | |
| 5 | export default function consoleFunc(name) { |
| 6 | return rest(function (fn, args) { |
| 7 | wrapAsync(fn).apply(null, args.concat(rest(function (err, args) { |
| 8 | if (typeof console === 'object') { |
| 9 | if (err) { |
| 10 | if (console.error) { |
| 11 | console.error(err); |
| 12 | } |
| 13 | } |
| 14 | else if (console[name]) { |
| 15 | arrayEach(args, function (x) { |
| 16 | console[name](x); |
| 17 | }); |
| 18 | } |
| 19 | } |
| 20 | }))); |
| 21 | }); |
| 22 | } |