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

Function formatSet

lib/internal/util/inspect.js:2394–2411  ·  view source on GitHub ↗
(value, ctx, ignored, recurseTimes)

Source from the content-addressed store, hash-verified

2392}
2393
2394function formatSet(value, ctx, ignored, recurseTimes) {
2395 const length = value.size;
2396 const maxLength = MathMin(MathMax(0, ctx.maxArrayLength), length);
2397 const remaining = length - maxLength;
2398 const output = [];
2399 ctx.indentationLvl += 2;
2400 let i = 0;
2401 for (const v of value) {
2402 if (i >= maxLength) break;
2403 ArrayPrototypePush(output, formatValue(ctx, v, recurseTimes));
2404 i++;
2405 }
2406 if (remaining > 0) {
2407 ArrayPrototypePush(output, remainingText(remaining));
2408 }
2409 ctx.indentationLvl -= 2;
2410 return output;
2411}
2412
2413function formatMap(value, ctx, ignored, recurseTimes) {
2414 const length = value.size;

Callers

nothing calls this directly

Calls 2

formatValueFunction · 0.85
remainingTextFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…