( stream: NodeJS.WriteStream, )
| 1 | function handleEPIPE( |
| 2 | stream: NodeJS.WriteStream, |
| 3 | ): (err: NodeJS.ErrnoException) => void { |
| 4 | return (err: NodeJS.ErrnoException) => { |
| 5 | if (err.code === 'EPIPE') { |
| 6 | stream.destroy() |
| 7 | } |
| 8 | } |
| 9 | } |
| 10 | |
| 11 | // Prevents memory leak when pipe is broken (e.g., `claude -p | head -1`) |
| 12 | export function registerProcessOutputErrorHandlers(): void { |
no test coverage detected