(value)
| 80394 | if (!options.type) { |
| 80395 | const type2 = bits[0]?.type; |
| 80396 | if (typeof type2 === "string") { |
| 80397 | options = { ...options, type: type2 }; |
| 80398 | } |
| 80399 | } |
| 80400 | return new File4(bits, name, options); |
| 80401 | } |
| 80402 | async function getBytes2(value) { |
| 80403 | let parts = []; |
| 80404 | if (typeof value === "string" || ArrayBuffer.isView(value) || // includes Uint8Array, Buffer, etc. |
| 80405 | value instanceof ArrayBuffer) { |
| 80406 | parts.push(value); |
| 80407 | } else if (isBlobLike2(value)) { |
| 80408 | parts.push(await value.arrayBuffer()); |
| 80409 | } else if (isAsyncIterableIterator2(value)) { |
| 80410 | for await (const chunk of value) { |
| 80411 | parts.push(chunk); |
| 80412 | } |
| 80413 | } else { |
| 80414 | throw new Error(`Unexpected data type: ${typeof value}; constructor: ${value?.constructor?.name}; props: ${propsForError2(value)}`); |
no test coverage detected
searching dependent graphs…