@zenfs/core 2.2.1 → 2.2.2

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.
Files changed (2) hide show
  1. package/dist/polyfills.js +11 -2
  2. package/package.json +1 -1
package/dist/polyfills.js CHANGED
@@ -1,7 +1,8 @@
1
1
  /* node:coverage disable */
2
- var _a, _b, _c;
2
+ /* eslint-disable @typescript-eslint/unbound-method */
3
+ var _a, _b, _c, _d;
4
+ var _e;
3
5
  import { warn } from 'kerium/log';
4
- // eslint-disable-next-line @typescript-eslint/unbound-method
5
6
  (_a = Promise.withResolvers) !== null && _a !== void 0 ? _a : (Promise.withResolvers = (warn('Using a polyfill of Promise.withResolvers'),
6
7
  function () {
7
8
  let _resolve,
@@ -17,4 +18,12 @@ import { warn } from 'kerium/log';
17
18
  (_b = Symbol['dispose']) !== null && _b !== void 0 ? _b : (Symbol['dispose'] = (warn('Using a polyfill of Symbol.dispose'), Symbol('Symbol.dispose')));
18
19
  // @ts-expect-error 2540
19
20
  (_c = Symbol['asyncDispose']) !== null && _c !== void 0 ? _c : (Symbol['asyncDispose'] = (warn('Using a polyfill of Symbol.asyncDispose'), Symbol('Symbol.asyncDispose')));
21
+ function randomUUID() {
22
+ const bytes = crypto.getRandomValues(new Uint8Array(16));
23
+ bytes[6] = (bytes[6] & 0x0f) | 0x40;
24
+ bytes[8] = (bytes[8] & 0x3f) | 0x80;
25
+ const hex = [...bytes].map(b => b.toString(16).padStart(2, '0')).join('');
26
+ return `${hex.slice(0, 8)}-${hex.slice(8, 12)}-${hex.slice(12, 16)}-${hex.slice(16, 20)}-${hex.slice(20)}`;
27
+ }
28
+ (_d = (_e = globalThis.crypto).randomUUID) !== null && _d !== void 0 ? _d : (_e.randomUUID = (warn('Using a polyfill of crypto.randomUUID'), randomUUID));
20
29
  /* node:coverage enable */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zenfs/core",
3
- "version": "2.2.1",
3
+ "version": "2.2.2",
4
4
  "description": "A filesystem, anywhere",
5
5
  "funding": {
6
6
  "type": "individual",