@teamkeel/wasm 0.241.0 → 0.241.1

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,8 +1,6 @@
1
- // Needed for wasm_exec
2
- globalThis.crypto = require("crypto");
1
+ require("./lib/wasm_exec_node");
3
2
 
4
3
  const { wasm } = require("./dist/wasm.js");
5
- require("./lib/wasm_exec");
6
4
 
7
5
  async function keel() {
8
6
  if (globalThis.keel) {
@@ -0,0 +1,23 @@
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
+ if (!globalThis.performance) {
8
+ globalThis.performance = {
9
+ now() {
10
+ const [sec, nsec] = process.hrtime();
11
+ return sec * 1000 + nsec / 1000000;
12
+ },
13
+ };
14
+ }
15
+
16
+ const crypto = require("crypto");
17
+ globalThis.crypto = {
18
+ getRandomValues(b) {
19
+ crypto.randomFillSync(b);
20
+ },
21
+ };
22
+
23
+ require("./wasm_exec");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@teamkeel/wasm",
3
- "version": "0.241.0",
3
+ "version": "0.241.1",
4
4
  "description": "A wrapper around the Keel WASM binary",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",