(items: unknown[])
| 384 | } |
| 385 | |
| 386 | function normalizeStderrLines(items: unknown[]): unknown[] { |
| 387 | const normalized: unknown[] = []; |
| 388 | let stepRun: string[] = []; |
| 389 | |
| 390 | const flushStepRun = (): void => { |
| 391 | if (stepRun.length === 0) return; |
| 392 | normalized.push(...stepRun.sort((left, right) => left.localeCompare(right))); |
| 393 | stepRun = []; |
| 394 | }; |
| 395 | |
| 396 | for (const item of items) { |
| 397 | if (typeof item === 'string' && item.startsWith('[<STEP>] ')) { |
| 398 | stepRun.push(item); |
| 399 | continue; |
| 400 | } |
| 401 | |
| 402 | flushStepRun(); |
| 403 | normalized.push(item); |
| 404 | } |
| 405 | |
| 406 | flushStepRun(); |
| 407 | return normalized; |
| 408 | } |
| 409 | |
| 410 | function normalizeValue( |
| 411 | value: unknown, |
no test coverage detected