({
contents = new Uint8Array(),
type = 'application/octet-stream',
}: ReadableBinaryBlobBuilderOptions = {})
| 483 | } |
| 484 | |
| 485 | export function buildReadableBinaryBlob({ |
| 486 | contents = new Uint8Array(), |
| 487 | type = 'application/octet-stream', |
| 488 | }: ReadableBinaryBlobBuilderOptions = {}): Blob { |
| 489 | const blob = new Blob([copyBytes(contents)], { type }); |
| 490 | |
| 491 | Object.defineProperty(blob, 'arrayBuffer', { |
| 492 | configurable: true, |
| 493 | value: () => readBlobAsArrayBuffer(blob), |
| 494 | }); |
| 495 | |
| 496 | return blob; |
| 497 | } |
| 498 | |
| 499 | export function buildReadableBinaryFile({ |
| 500 | name = 'file.bin', |