@0xkaleab/sdk-js 0.2.7 → 0.2.8
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.
|
@@ -28,8 +28,9 @@ async function getRqModule() {
|
|
|
28
28
|
}
|
|
29
29
|
return _rqMod;
|
|
30
30
|
}
|
|
31
|
+
const isNode = typeof process !== "undefined" && !!process.versions?.node;
|
|
31
32
|
async function getWasmSource() {
|
|
32
|
-
if (
|
|
33
|
+
if (isNode) {
|
|
33
34
|
// Node.js: read the .wasm file from disk as a buffer
|
|
34
35
|
const { readFileSync } = await Promise.resolve().then(() => require("node:fs"));
|
|
35
36
|
// Use require.resolve if available (CJS), otherwise createRequire (ESM)
|
|
@@ -17,8 +17,9 @@ async function getRqModule() {
|
|
|
17
17
|
}
|
|
18
18
|
return _rqMod;
|
|
19
19
|
}
|
|
20
|
+
const isNode = typeof process !== "undefined" && !!process.versions?.node;
|
|
20
21
|
async function getWasmSource() {
|
|
21
|
-
if (
|
|
22
|
+
if (isNode) {
|
|
22
23
|
// Node.js: read the .wasm file from disk as a buffer
|
|
23
24
|
const { readFileSync } = await import("node:fs");
|
|
24
25
|
// Use require.resolve if available (CJS), otherwise createRequire (ESM)
|