()
| 99 | }; |
| 100 | |
| 101 | const writeStatusMessage = () => { |
| 102 | const column = stream.columns || 40; |
| 103 | /** @type {string[]} */ |
| 104 | const all = []; |
| 105 | |
| 106 | for (const state of logStatusStates) { |
| 107 | if (!state.currentMessage) continue; |
| 108 | /** @type {string[][]} */ |
| 109 | const lines = [[]]; |
| 110 | for (const item of state.currentMessage) { |
| 111 | const parts = item.split("\n"); |
| 112 | lines[lines.length - 1].push(parts[0]); |
| 113 | for (let i = 1; i < parts.length; i++) { |
| 114 | lines.push([parts[i]]); |
| 115 | } |
| 116 | } |
| 117 | const truncateLines = lines.map((args) => |
| 118 | truncateArgs(args, column - 1).join(" ") |
| 119 | ); |
| 120 | state.currentLines = truncateLines.length; |
| 121 | for (const line of truncateLines) all.push(line); |
| 122 | } |
| 123 | if (all.length === 0) return; |
| 124 | |
| 125 | const coloredLines = all.map((str) => c.bold(str)); |
| 126 | stream.write(`${CLEAR_LINE}${coloredLines.join(`\n${CLEAR_LINE}`)}`); |
| 127 | }; |
| 128 | |
| 129 | /** |
| 130 | * @param {EXPECTED_ANY[]} statusMessage status message |
no test coverage detected