MCPcopy Create free account
hub / github.com/angular/dev-infra / logHeader

Function logHeader

ng-dev/pullapprove/logging.ts:40–51  ·  view source on GitHub ↗
(...params: string[])

Source from the content-addressed store, hash-verified

38
39/** Logs a header within a text drawn box. */
40export function logHeader(...params: string[]) {
41 const totalWidth = 80;
42 const fillWidth = totalWidth - 2;
43 const headerText = params.join(' ').substr(0, fillWidth);
44 const leftSpace = Math.ceil((fillWidth - headerText.length) / 2);
45 const rightSpace = fillWidth - leftSpace - headerText.length;
46 const fill = (count: number, content: string) => content.repeat(count);
47
48 Log.info(`┌${fill(fillWidth, '─')}┐`);
49 Log.info(`│${fill(leftSpace, ' ')}${headerText}${fill(rightSpace, ' ')}│`);
50 Log.info(`└${fill(fillWidth, '─')}┘`);
51}

Callers 1

verifyFunction · 0.85

Calls 1

fillFunction · 0.70

Tested by

no test coverage detected