@aml-org/amf-custom-validator 1.3.0-SNAPSHOT.94 → 1.3.0-SNAPSHOT.96

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/lib/main.wasm.gz CHANGED
Binary file
@@ -18,18 +18,22 @@ globalThis.fs = require("fs");
18
18
  globalThis.TextEncoder = require("util").TextEncoder;
19
19
  globalThis.TextDecoder = require("util").TextDecoder;
20
20
 
21
- globalThis.performance = {
22
- now() {
23
- const [sec, nsec] = process.hrtime();
24
- return sec * 1000 + nsec / 1000000;
25
- },
26
- };
21
+ if (!globalThis.performance || !globalThis.performance.now) {
22
+ globalThis.performance = {
23
+ now() {
24
+ const [sec, nsec] = process.hrtime();
25
+ return sec * 1000 + nsec / 1000000; // time in milliseconds
26
+ },
27
+ };
28
+ }
27
29
 
28
- const crypto = require("crypto");
29
- globalThis.crypto = {
30
- getRandomValues(b) {
31
- crypto.randomFillSync(b);
32
- },
33
- };
30
+ const crypto = require("crypto")
31
+ if (!globalThis.crypto || !globalThis.crypto.getRandomValues) {
32
+ globalThis.crypto = {
33
+ getRandomValues(b) {
34
+ crypto.randomFillSync(b);
35
+ },
36
+ };
37
+ }
34
38
 
35
- require("./wasm_exec");
39
+ require("./wasm_exec");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aml-org/amf-custom-validator",
3
- "version": "1.3.0-SNAPSHOT.94",
3
+ "version": "1.3.0-SNAPSHOT.96",
4
4
  "description": "AMF validator backed by OPA Rego",
5
5
  "main": "index.js",
6
6
  "scripts": {