strictjs-runtime 1.0.4 → 1.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.js +9 -2
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -1,3 +1,5 @@
1
+
2
+
1
3
  import fs from "fs";
2
4
  import path from "path";
3
5
  import { fileURLToPath } from "url";
@@ -20,12 +22,15 @@ export default async function strictInit() {
20
22
  // Node.js environment
21
23
  const wasmPath = path.resolve(__dirname, "pkg/strictjs_runtime_bg.wasm");
22
24
  const wasmBuffer = fs.readFileSync(wasmPath);
23
- await initWasm(wasmBuffer);
25
+
26
+ await initWasm({ module: wasmBuffer }); // ✅ Updated way
24
27
  } else {
25
28
  // Browser environment
26
- await initWasm();
29
+ const wasmUrl = new URL("./pkg/strictjs_runtime_bg.wasm", import.meta.url);
30
+ await initWasm({ module: fetch(wasmUrl) }); // ✅ Updated way
27
31
  }
28
32
 
33
+
29
34
  return {
30
35
  get_memory,
31
36
  HeapType,
@@ -44,3 +49,5 @@ export {
44
49
  StrictFunction,
45
50
  StrictObject
46
51
  };
52
+
53
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "strictjs-runtime",
3
- "version": "1.0.4",
3
+ "version": "1.0.6",
4
4
  "description": "A lightweight low-level runtime for StrictJS with WebAssembly support.",
5
5
  "main": "index.js",
6
6
  "type": "module",