MCPcopy
hub / github.com/caolan/async / consoleFunc

Function consoleFunc

lib/internal/consoleFunc.js:5–22  ·  view source on GitHub ↗
(name)

Source from the content-addressed store, hash-verified

3import wrapAsync from './wrapAsync';
4
5export 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}

Callers 2

log.jsFile · 0.85
dir.jsFile · 0.85

Calls 2

restFunction · 0.85
wrapAsyncFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…