MCPcopy Create free account
hub / github.com/ShipSecAI/studio / printBox

Function printBox

backend/scripts/version-check-summary.ts:32–44  ·  view source on GitHub ↗
(lines: string[], borderColor: string)

Source from the content-addressed store, hash-verified

30}
31
32function printBox(lines: string[], borderColor: string) {
33 const maxLen = Math.max(...lines.map((l) => getDisplayWidth(l)));
34 const width = maxLen + 4;
35 const border = '─'.repeat(width - 2);
36
37 console.log(`${borderColor}┌${border}┐${colors.reset}`);
38 for (const line of lines) {
39 const displayLen = getDisplayWidth(line);
40 const padding = ' '.repeat(maxLen - displayLen);
41 console.log(`${borderColor}│${colors.reset} ${line}${padding} ${borderColor}│${colors.reset}`);
42 }
43 console.log(`${borderColor}└${border}┘${colors.reset}`);
44}
45
46async function main() {
47 if (isVersionCheckDisabled(process.env)) {

Callers 1

mainFunction · 0.85

Calls 1

getDisplayWidthFunction · 0.85

Tested by

no test coverage detected