| 12 | * Check if WebAssembly is supported |
| 13 | */ |
| 14 | export 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 |