( wait: Promise<ExecResult>, timeoutMs = 2_000, )
| 3 | import type { ExecResult } from '../utils/exec.ts'; |
| 4 | |
| 5 | export async function waitForChildExit( |
| 6 | wait: Promise<ExecResult>, |
| 7 | timeoutMs = 2_000, |
| 8 | ): Promise<void> { |
| 9 | await Promise.race([ |
| 10 | wait.then(() => undefined).catch(() => undefined), |
| 11 | new Promise<void>((resolve) => setTimeout(resolve, timeoutMs)), |
| 12 | ]); |
| 13 | } |
| 14 | |
| 15 | function redactChunk(chunk: string, patterns: RegExp[]): string { |
| 16 | if (patterns.length === 0) return chunk; |
no outgoing calls
no test coverage detected