()
| 163 | } |
| 164 | |
| 165 | const cleanup = () => { |
| 166 | stream.off('data', onData) |
| 167 | stream.off('end', onEnd) |
| 168 | stream.off('error', onError) |
| 169 | options.signal?.removeEventListener('abort', onAbort) |
| 170 | } |
| 171 | |
| 172 | const onAbort = () => { |
| 173 | if ('destroy' in stream && typeof stream.destroy === 'function') { |