MCPcopy Index your code
hub / github.com/nodejs/node / formatProxy

Function formatProxy

lib/internal/util/inspect.js:1090–1103  ·  view source on GitHub ↗
(ctx, proxy, recurseTimes)

Source from the content-addressed store, hash-verified

1088}
1089
1090function formatProxy(ctx, proxy, recurseTimes) {
1091 if (recurseTimes > ctx.depth && ctx.depth !== null) {
1092 return ctx.stylize('Proxy [Array]', 'special');
1093 }
1094 recurseTimes += 1;
1095 ctx.indentationLvl += 2;
1096 const res = [
1097 formatValue(ctx, proxy[0], recurseTimes),
1098 formatValue(ctx, proxy[1], recurseTimes),
1099 ];
1100 ctx.indentationLvl -= 2;
1101 return reduceToSingleString(
1102 ctx, res, '', ['Proxy [', ']'], kArrayExtrasType, recurseTimes);
1103}
1104
1105// Note: using `formatValue` directly requires the indentation level to be
1106// corrected by setting `ctx.indentationLvL += diff` and then to decrease the

Callers 1

formatValueFunction · 0.85

Calls 2

formatValueFunction · 0.85
reduceToSingleStringFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…