* Combined line count for a pipes result. Each stream is counted after * trimming its own trailing newlines and the counts are summed — joining the * streams first would invent a line at the boundary (`out\n` + `err\n` is * two lines, not three).
(output: { stdout?: string; stderr?: string })
| 229 | * two lines, not three). |
| 230 | */ |
| 231 | function pipeOutputLineCount(output: { stdout?: string; stderr?: string }): number { |
| 232 | let count = 0; |
| 233 | for (const stream of [output.stdout, output.stderr]) { |
| 234 | const trimmed = stream?.replace(/\n+$/, ''); |
| 235 | if (trimmed) count += trimmed.split('\n').length; |
| 236 | } |
| 237 | return count; |
| 238 | } |
| 239 | |
| 240 | function compactToolSummary(entry: MakaPiToolEntry): CompactToolSummary | undefined { |
| 241 | const result = entry.result; |
no test coverage detected