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

Function formatTypedArray

lib/internal/util/inspect.js:2378–2392  ·  view source on GitHub ↗
(value, length, ctx)

Source from the content-addressed store, hash-verified

2376}
2377
2378function formatTypedArray(value, length, ctx) {
2379 const maxLength = MathMin(MathMax(0, ctx.maxArrayLength), length);
2380 const remaining = value.length - maxLength;
2381 const output = new Array(maxLength);
2382 const elementFormatter = value.length > 0 && typeof value[0] === 'number' ?
2383 formatNumber :
2384 formatBigInt;
2385 for (let i = 0; i < maxLength; ++i) {
2386 output[i] = elementFormatter(ctx.stylize, value[i], ctx.numericSeparator);
2387 }
2388 if (remaining > 0) {
2389 output[maxLength] = remainingText(remaining);
2390 }
2391 return output;
2392}
2393
2394function formatSet(value, ctx, ignored, recurseTimes) {
2395 const length = value.size;

Callers

nothing calls this directly

Calls 1

remainingTextFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…