@aml-org/amf-custom-validator 1.3.0-SNAPSHOT.87 → 1.3.0-SNAPSHOT.88

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 CHANGED
@@ -1,4 +1,4 @@
1
- require(__dirname + "/lib/wasm_exec");
1
+ require(__dirname + "/lib/wasm_exec_node");
2
2
  const fs = require("fs");
3
3
  const pako = require("pako");
4
4
  let wasm_gz
package/lib/main.wasm.gz CHANGED
Binary file
@@ -0,0 +1,35 @@
1
+ // Copyright 2021 The Go Authors. All rights reserved.
2
+ // Use of this source code is governed by a BSD-style
3
+ // license that can be found in the LICENSE file.
4
+
5
+ "use strict";
6
+
7
+
8
+ /**
9
+ * Go 1.19 split the wasm_exec file into two:
10
+ * - a base wasm_exec file that requires to provide polyfills
11
+ * - a Node wasm_exec_node file that provides those Node polyfills and adds some CLI behavior
12
+ *
13
+ * Removed the CLI behavior stuff and left only the polyfill provision
14
+ */
15
+
16
+ globalThis.require = require;
17
+ globalThis.fs = require("fs");
18
+ globalThis.TextEncoder = require("util").TextEncoder;
19
+ globalThis.TextDecoder = require("util").TextDecoder;
20
+
21
+ globalThis.performance = {
22
+ now() {
23
+ const [sec, nsec] = process.hrtime();
24
+ return sec * 1000 + nsec / 1000000;
25
+ },
26
+ };
27
+
28
+ const crypto = require("crypto");
29
+ globalThis.crypto = {
30
+ getRandomValues(b) {
31
+ crypto.randomFillSync(b);
32
+ },
33
+ };
34
+
35
+ 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.87",
3
+ "version": "1.3.0-SNAPSHOT.88",
4
4
  "description": "AMF validator backed by OPA Rego",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -9,7 +9,7 @@
9
9
  "author": "Antonio Garrote",
10
10
  "license": "ISC",
11
11
  "engines": {
12
- "node": ">=19.2.0"
12
+ "node": ">=16.0.0"
13
13
  },
14
14
  "devDependencies": {
15
15
  "mocha": "^8.4.0"