UNPKG

846 BTypeScriptView Raw
1/**
2 * Returns a set of strings when printed on the console produces a banner msg. The message is in the following format -
3 * ********************
4 * *** msg line x ***
5 * *** msg line xyz ***
6 * ********************
7 *
8 * Spec:
9 * - The width of every line is equal, dictated by the longest message string
10 * - The first and last lines are '*'s for the full length of the line
11 * - Each line in between is prepended with '*** ' and appended with ' ***'
12 * - The text is indented left, i.e. whitespace is right-padded when the length is shorter than the longest.
13 *
14 * @param msgs array of strings containing the message lines to be printed in the banner. Returns empty string if array
15 * is empty.
16 * @returns array of strings containing the message formatted as a banner
17 */
18export declare function formatAsBanner(msgs: string[]): string[];