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

Function reflect

lib/reflect.js:44–67  ·  view source on GitHub ↗
(fn)

Source from the content-addressed store, hash-verified

42 * });
43 */
44export default function reflect(fn) {
45 var _fn = wrapAsync(fn);
46 return initialParams(function reflectOn(args, reflectCallback) {
47 args.push(rest(function callback(err, cbArgs) {
48 if (err) {
49 reflectCallback(null, {
50 error: err
51 });
52 } else {
53 var value = null;
54 if (cbArgs.length === 1) {
55 value = cbArgs[0];
56 } else if (cbArgs.length > 1) {
57 value = cbArgs;
58 }
59 reflectCallback(null, {
60 value: value
61 });
62 }
63 }));
64
65 return _fn.apply(this, args);
66 });
67}

Callers

nothing calls this directly

Calls 2

wrapAsyncFunction · 0.85
restFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…