( nodeReadable: NodeJS.ReadableStream, )
| 1 | export async function* toAsyncIterable( |
| 2 | nodeReadable: NodeJS.ReadableStream, |
| 3 | ): AsyncGenerator<Uint8Array> { |
| 4 | for await (const chunk of nodeReadable) { |
| 5 | // @ts-ignore |
| 6 | yield chunk as Uint8Array; |
| 7 | } |
| 8 | } |
| 9 | |
| 10 | export async function* streamResponse( |
| 11 | response: Response, |