MCPcopy Create free account
hub / github.com/ZenNotes/zennotes / pad

Function pad

apps/desktop/src/cli/help.ts:48–54  ·  view source on GitHub ↗
(value: string, width: number)

Source from the content-addressed store, hash-verified

46}
47
48function pad(value: string, width: number): string {
49 // visible length excludes ANSI codes; our command labels are
50 // pre-styled so we measure the original string and re-style.
51 const visible = value.replace(/\x1b\[[0-9;]*m/g, '')
52 if (visible.length >= width) return value
53 return value + ' '.repeat(width - visible.length)
54}
55
56function wrapLines(text: string, width: number): string[] {
57 // Soft-wrap a single descriptive paragraph at word boundaries. We

Callers 2

headerFunction · 0.70
sectionFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected