MCPcopy Index your code
hub / github.com/PatrickSys/codebase-context / box

Function box

src/core/codebase-map.ts:598–608  ·  view source on GitHub ↗
(title: string, lines: string[])

Source from the content-addressed store, hash-verified

596 const inner = width - 2;
597
598 function box(title: string, lines: string[]): string {
599 const top = `${tl}${h.repeat(inner)}${tr}`;
600 const mid = `${lm}${h.repeat(inner)}${rm}`;
601 const bot = `${bl}${h.repeat(inner)}${br}`;
602 const titleLine = `${v} ${title.padEnd(inner - 1)}${v}`;
603 const contentLines = lines.map((l) => {
604 const truncated = l.length > inner - 2 ? l.slice(0, inner - 5) + '...' : l;
605 return `${v} ${truncated.padEnd(inner - 2)}${v}`;
606 });
607 return [top, titleLine, mid, ...contentLines, bot].join('\n');
608 }
609
610 const sections: string[] = [];
611

Callers 1

renderMapPrettyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected