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

Function leftPad

lib/internal/debugger/inspect_repl.js:146–152  ·  view source on GitHub ↗
(n, prefix, maxN)

Source from the content-addressed store, hash-verified

144// Adds spaces and prefix to number
145// maxN is a maximum number we should have space for
146function leftPad(n, prefix, maxN) {
147 const s = n.toString();
148 const nchars = MathMax(2, String(maxN).length);
149 const nspaces = nchars - s.length;
150
151 return prefix + StringPrototypeRepeat(' ', nspaces) + s;
152}
153
154function markSourceColumn(sourceText, position, useColors) {
155 if (!sourceText) return '';

Callers 2

[customInspectSymbol]Method · 0.85
formatWatchersFunction · 0.85

Calls 2

StringClass · 0.85
toStringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…