(parts: Part[], chunkSize?: number)
| 72 | } |
| 73 | |
| 74 | function makeRequest(parts: Part[], chunkSize?: number): NextRequest { |
| 75 | const body = buildBody(parts) |
| 76 | const stream = new ReadableStream<Uint8Array>({ |
| 77 | start(controller) { |
| 78 | if (chunkSize) { |
| 79 | for (let i = 0; i < body.length; i += chunkSize) { |
| 80 | controller.enqueue(new Uint8Array(body.subarray(i, i + chunkSize))) |
| 81 | } |
| 82 | } else { |
| 83 | controller.enqueue(new Uint8Array(body)) |
| 84 | } |
| 85 | controller.close() |
| 86 | }, |
| 87 | }) |
| 88 | return { |
| 89 | headers: new Headers({ 'content-type': `multipart/form-data; boundary=${BOUNDARY}` }), |
| 90 | body: stream, |
| 91 | signal: undefined, |
| 92 | } as unknown as NextRequest |
| 93 | } |
| 94 | |
| 95 | function csvWithRows(count: number): string { |
| 96 | const lines = ['name,age'] |
no test coverage detected