MCPcopy Create free account
hub / github.com/ColmapView/Colmapview.github.io / buildReadableBinaryBlob

Function buildReadableBinaryBlob

src/test/builders/fileFakes.ts:485–497  ·  view source on GitHub ↗
({
  contents = new Uint8Array(),
  type = 'application/octet-stream',
}: ReadableBinaryBlobBuilderOptions = {})

Source from the content-addressed store, hash-verified

483}
484
485export 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
499export function buildReadableBinaryFile({
500 name = 'file.bin',

Callers 2

makeMockBlobFunction · 0.90
builders.test.tsFile · 0.85

Calls 2

copyBytesFunction · 0.85
readBlobAsArrayBufferFunction · 0.70

Tested by 1

makeMockBlobFunction · 0.72