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

Function formatSetIterInner

lib/internal/util/inspect.js:2435–2455  ·  view source on GitHub ↗
(ctx, recurseTimes, entries, state)

Source from the content-addressed store, hash-verified

2433}
2434
2435function formatSetIterInner(ctx, recurseTimes, entries, state) {
2436 const maxArrayLength = MathMax(ctx.maxArrayLength, 0);
2437 const maxLength = MathMin(maxArrayLength, entries.length);
2438 const output = new Array(maxLength);
2439 ctx.indentationLvl += 2;
2440 for (let i = 0; i < maxLength; i++) {
2441 output[i] = formatValue(ctx, entries[i], recurseTimes);
2442 }
2443 ctx.indentationLvl -= 2;
2444 if (state === kWeak && !ctx.sorted) {
2445 // Sort all entries to have a halfway reliable output (if more entries than
2446 // retrieved ones exist, we can not reliably return the same output) if the
2447 // output is not sorted anyway.
2448 ArrayPrototypeSort(output);
2449 }
2450 const remaining = entries.length - maxLength;
2451 if (remaining > 0) {
2452 ArrayPrototypePush(output, remainingText(remaining));
2453 }
2454 return output;
2455}
2456
2457function formatMapIterInner(ctx, recurseTimes, entries, state) {
2458 const maxArrayLength = MathMax(ctx.maxArrayLength, 0);

Callers 2

formatWeakSetFunction · 0.85
formatIteratorFunction · 0.85

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…