()
| 170 | } |
| 171 | |
| 172 | const onAbort = () => { |
| 173 | if ('destroy' in stream && typeof stream.destroy === 'function') { |
| 174 | stream.destroy(toError(options.signal?.reason ?? new Error('Aborted'))) |
| 175 | } |
| 176 | finish(() => reject(toError(options.signal?.reason ?? new Error('Aborted')))) |
| 177 | } |
| 178 | |
| 179 | const onData = (chunk: Buffer | Uint8Array | string) => { |
| 180 | const buffer = Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk) |
no test coverage detected