()
| 19 | // Lazily resolve WASM path to avoid module load-time errors when bundled |
| 20 | let wasmDir: string | null = null; |
| 21 | function getWasmDir(): string { |
| 22 | if (wasmDir === null) { |
| 23 | const require = createRequire(import.meta.url); |
| 24 | const wasmModulePath = require.resolve(WASM_MODULE_PATH); |
| 25 | wasmDir = dirname(wasmModulePath); |
| 26 | } |
| 27 | return wasmDir; |
| 28 | } |
| 29 | |
| 30 | async function getCoreModule(path: string): Promise<WebAssembly.Module> { |
| 31 | const wasmPath = join(getWasmDir(), path); |
no test coverage detected