@quesmed/types 1.4.11 → 1.4.12

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quesmed/types",
3
- "version": "1.4.11",
3
+ "version": "1.4.12",
4
4
  "description": "Typescript types for Quesmed",
5
5
  "main": "index.js",
6
6
  "module": "index.mjs",
package/utils/uuid4.js CHANGED
@@ -202,14 +202,9 @@ class Uuid4 {
202
202
  * @private
203
203
  */
204
204
  static _getRandomArray() {
205
- if (typeof window === 'undefined') {
206
- let crypto = require('crypto');
207
- return Uint8Array.from(crypto.randomBytes(16));
208
- }
209
- // `result` is modified in place.
210
- let result = new Uint8Array(16);
211
- window.crypto.getRandomValues(result);
212
- return result;
205
+ return Uint8Array.from(Array(16)
206
+ .fill(0)
207
+ .map(() => Math.round(Math.random() * 255)));
213
208
  }
214
209
  }
215
210
  /**
package/utils/uuid4.mjs CHANGED
@@ -200,14 +200,9 @@ class Uuid4 {
200
200
  * @private
201
201
  */
202
202
  static _getRandomArray() {
203
- if (typeof window === 'undefined') {
204
- let crypto = require('crypto');
205
- return Uint8Array.from(crypto.randomBytes(16));
206
- }
207
- // `result` is modified in place.
208
- let result = new Uint8Array(16);
209
- window.crypto.getRandomValues(result);
210
- return result;
203
+ return Uint8Array.from(Array(16)
204
+ .fill(0)
205
+ .map(() => Math.round(Math.random() * 255)));
211
206
  }
212
207
  }
213
208
  /**