(
context: { ReadableStream: typeof ReadableStream },
KUint8Array: typeof Uint8Array,
stream: Readable
)
| 6 | const DEFAULT_BODY_CLONE_SIZE_LIMIT = 10 * 1024 * 1024 // 10MB |
| 7 | |
| 8 | export function requestToBodyStream( |
| 9 | context: { ReadableStream: typeof ReadableStream }, |
| 10 | KUint8Array: typeof Uint8Array, |
| 11 | stream: Readable |
| 12 | ) { |
| 13 | return new context.ReadableStream({ |
| 14 | start: async (controller) => { |
| 15 | for await (const chunk of stream) { |
| 16 | controller.enqueue(new KUint8Array(chunk)) |
| 17 | } |
| 18 | controller.close() |
| 19 | }, |
| 20 | }) |
| 21 | } |
| 22 | |
| 23 | function replaceRequestBody<T extends IncomingMessage>( |
| 24 | base: T, |
no test coverage detected
searching dependent graphs…