(
parts: Part[],
opts?: { chunkSize?: number; contentType?: string; boundary?: string }
)
| 41 | } |
| 42 | |
| 43 | function makeRequest( |
| 44 | parts: Part[], |
| 45 | opts?: { chunkSize?: number; contentType?: string; boundary?: string } |
| 46 | ) { |
| 47 | const boundary = opts?.boundary ?? BOUNDARY |
| 48 | return { |
| 49 | headers: new Headers({ |
| 50 | 'content-type': opts?.contentType ?? `multipart/form-data; boundary=${boundary}`, |
| 51 | }), |
| 52 | body: toWebStream(buildBody(parts, boundary), opts?.chunkSize), |
| 53 | } |
| 54 | } |
| 55 | |
| 56 | async function readStream(stream: Readable): Promise<string> { |
| 57 | const chunks: Buffer[] = [] |
no test coverage detected