(stream: ReadStream)
| 41 | } |
| 42 | |
| 43 | export function createStreamBody(stream: ReadStream) { |
| 44 | const body = new ReadableStream({ |
| 45 | start(controller) { |
| 46 | stream.on('data', (chunk) => { |
| 47 | controller.enqueue(chunk); |
| 48 | }); |
| 49 | stream.on('end', () => { |
| 50 | controller.close(); |
| 51 | }); |
| 52 | }, |
| 53 | |
| 54 | cancel() { |
| 55 | stream.destroy(); |
| 56 | }, |
| 57 | }); |
| 58 | return body; |
| 59 | } |
| 60 | |
| 61 | export const config = { |
| 62 | distDir, |
no outgoing calls
no test coverage detected