hron-wasm 0.4.0 → 0.4.2
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/hron_wasm.js +19 -7
- package/hron_wasm_bg.wasm +0 -0
- package/package.json +1 -1
package/hron_wasm.js
CHANGED
|
@@ -1,9 +1,21 @@
|
|
|
1
1
|
/* @ts-self-types="./hron_wasm.d.ts" */
|
|
2
2
|
|
|
3
|
-
import * as
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
3
|
+
import * as imports from "./hron_wasm_bg.js";
|
|
4
|
+
import * as wasmModule from "./hron_wasm_bg.wasm";
|
|
5
|
+
|
|
6
|
+
if (typeof wasmModule.__wbindgen_start === "function") {
|
|
7
|
+
// Bundler environment: the wasm import is already instantiated
|
|
8
|
+
imports.__wbg_set_wasm(wasmModule);
|
|
9
|
+
wasmModule.__wbindgen_start();
|
|
10
|
+
} else {
|
|
11
|
+
// Cloudflare Workers / raw Module environment:
|
|
12
|
+
// import of .wasm gives a WebAssembly.Module, not instantiated exports
|
|
13
|
+
const mod = wasmModule.default ?? wasmModule;
|
|
14
|
+
const instance = new WebAssembly.Instance(mod, {
|
|
15
|
+
"./hron_wasm_bg.js": imports,
|
|
16
|
+
});
|
|
17
|
+
imports.__wbg_set_wasm(instance.exports);
|
|
18
|
+
instance.exports.__wbindgen_start();
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export { Schedule, fromCron } from "./hron_wasm_bg.js";
|
package/hron_wasm_bg.wasm
CHANGED
|
Binary file
|