(body: Buffer, chunkSize?: number)
| 26 | } |
| 27 | |
| 28 | function toWebStream(body: Buffer, chunkSize?: number): ReadableStream<Uint8Array> { |
| 29 | return new ReadableStream<Uint8Array>({ |
| 30 | start(controller) { |
| 31 | if (chunkSize) { |
| 32 | for (let i = 0; i < body.length; i += chunkSize) { |
| 33 | controller.enqueue(new Uint8Array(body.subarray(i, i + chunkSize))) |
| 34 | } |
| 35 | } else { |
| 36 | controller.enqueue(new Uint8Array(body)) |
| 37 | } |
| 38 | controller.close() |
| 39 | }, |
| 40 | }) |
| 41 | } |
| 42 | |
| 43 | function makeRequest( |
| 44 | parts: Part[], |
no outgoing calls
no test coverage detected