streamfold 0.1.8 → 0.1.9
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.
package/package.json
CHANGED
|
@@ -20,8 +20,8 @@ let exports;
|
|
|
20
20
|
let compiledModule;
|
|
21
21
|
let compiling;
|
|
22
22
|
|
|
23
|
-
const
|
|
24
|
-
const binary = globalThis.atob(
|
|
23
|
+
const decodeWasmBytes = () => {
|
|
24
|
+
const binary = globalThis.atob(wasmBinaryBase64);
|
|
25
25
|
const bytes = new Uint8Array(binary.length);
|
|
26
26
|
for (let index = 0; index < binary.length; index++) {
|
|
27
27
|
bytes[index] = binary.charCodeAt(index);
|
|
@@ -35,7 +35,7 @@ const getExports = () => {
|
|
|
35
35
|
throw new Error("Streamfold requires WebAssembly support");
|
|
36
36
|
}
|
|
37
37
|
const module =
|
|
38
|
-
compiledModule ?? new WebAssembly.Module(
|
|
38
|
+
compiledModule ?? new WebAssembly.Module(decodeWasmBytes());
|
|
39
39
|
exports = new WebAssembly.Instance(module, {}).exports;
|
|
40
40
|
return exports;
|
|
41
41
|
};
|
|
@@ -51,7 +51,7 @@ export const prepareWasm = () => {
|
|
|
51
51
|
return Promise.reject(new Error("Streamfold requires WebAssembly support"));
|
|
52
52
|
}
|
|
53
53
|
try {
|
|
54
|
-
compiling = WebAssembly.compile(
|
|
54
|
+
compiling = WebAssembly.compile(decodeWasmBytes()).then(
|
|
55
55
|
(module) => {
|
|
56
56
|
compiledModule = module;
|
|
57
57
|
compiling = undefined;
|