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

Function isWasmSupported

src/wasm/init.ts:14–30  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

12 * Check if WebAssembly is supported
13 */
14export function isWasmSupported(): boolean {
15 try {
16 if (
17 typeof WebAssembly === 'object' &&
18 typeof WebAssembly.instantiate === 'function'
19 ) {
20 // Test with a minimal valid WASM module
21 const module = new WebAssembly.Module(
22 new Uint8Array([0x00, 0x61, 0x73, 0x6d, 0x01, 0x00, 0x00, 0x00])
23 );
24 return module instanceof WebAssembly.Module;
25 }
26 } catch {
27 // WebAssembly not supported
28 }
29 return false;
30}
31
32/**
33 * Load the colmap-wasm module

Callers 1

loadColmapWasmFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected