MCPcopy Create free account
hub / github.com/avajs/ava / formatLineNumber

Function formatLineNumber

lib/code-excerpt.js:8–9  ·  view source on GitHub ↗
(lineNumber, maxLineNumber)

Source from the content-addressed store, hash-verified

6import {chalk} from './chalk.js';
7
8const formatLineNumber = (lineNumber, maxLineNumber) =>
9 ' '.repeat(Math.max(0, String(maxLineNumber).length - String(lineNumber).length)) + lineNumber;
10
11export default function excerptCode(source, options = {}) {
12 if (!source.isWithinProject || source.isDependency) {

Callers 1

excerptCodeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected