@aml-org/amf-custom-validator 0.1.0-SNAPSHOT.42 → 0.1.0-SNAPSHOT.51
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/index.js +5 -5
- package/lib/main.wasm.gz +0 -0
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -5,7 +5,7 @@ let wasm_gz
|
|
|
5
5
|
let wasm
|
|
6
6
|
|
|
7
7
|
let initialized = false
|
|
8
|
-
let go =
|
|
8
|
+
let go = undefined;
|
|
9
9
|
|
|
10
10
|
const run = function(profile, data, debug) {
|
|
11
11
|
let before = new Date()
|
|
@@ -18,14 +18,14 @@ const run = function(profile, data, debug) {
|
|
|
18
18
|
const validateCustomProfile = function(profile, data, debug, cb) {
|
|
19
19
|
if (initialized) {
|
|
20
20
|
let res = run(profile, data, debug);
|
|
21
|
-
cb(res,
|
|
21
|
+
cb(res,undefined);
|
|
22
22
|
} else {
|
|
23
|
-
cb(
|
|
23
|
+
cb(undefined,new Error("WASM/GO not initialized"))
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
const initialize = function(cb) {
|
|
27
27
|
if (initialized === true) {
|
|
28
|
-
cb(
|
|
28
|
+
cb(undefined)
|
|
29
29
|
}
|
|
30
30
|
go = new Go();
|
|
31
31
|
if(!wasm_gz || !wasm) {
|
|
@@ -36,7 +36,7 @@ const initialize = function(cb) {
|
|
|
36
36
|
WebAssembly.instantiate(wasm, go.importObject).then((result) => {
|
|
37
37
|
go.run(result.instance);
|
|
38
38
|
initialized = true;
|
|
39
|
-
cb(
|
|
39
|
+
cb(undefined);
|
|
40
40
|
});
|
|
41
41
|
} else {
|
|
42
42
|
cb(new Error("WebAssembly is not supported in your JS environment"));
|
package/lib/main.wasm.gz
CHANGED
|
Binary file
|