MCPcopy Index your code
hub / github.com/ColmapView/Colmapview.github.io / makeWrapperInNode

Function makeWrapperInNode

src/parsers/integrity.test.ts:48–61  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

46const INTEGRITY_TEST_TIMEOUT_MS = 15000;
47
48async function makeWrapperInNode(): Promise<WasmReconstructionWrapper> {
49 const factory = resolveColmapWasmFactory(await import(pathToFileURL(WASM_JS).href));
50 const wasmBinary = readFileSync(WASM_BIN);
51 const module = await factory({
52 wasmBinary,
53 locateFile: (f) => resolve(process.cwd(), 'public/wasm', f),
54 });
55 // The wrapper's initialize() calls loadColmapWasm() which fetches; inject
56 // the Node-loaded module directly.
57 const wrapper = new WasmReconstructionWrapper();
58 Reflect.set(wrapper, 'module', module);
59 Reflect.set(wrapper, 'reconstruction', new module.Reconstruction());
60 return wrapper;
61}
62
63function toAB(path: string): ArrayBuffer {
64 return copyBytesToArrayBuffer(readFileSync(path));

Callers 1

integrity.test.tsFile · 0.85

Calls 2

resolveColmapWasmFactoryFunction · 0.90
resolveFunction · 0.50

Tested by

no test coverage detected