@zenfs/core 1.6.3 → 1.6.5

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/dist/inode.js CHANGED
@@ -111,14 +111,14 @@ let Inode = (() => {
111
111
  // Expand the buffer so it is the right size
112
112
  if (buffer.byteLength < sz_inode) {
113
113
  const newBuffer = new Uint8Array(sz_inode);
114
+ const buf = ArrayBuffer.isView(buffer) ? buffer.buffer : buffer;
114
115
  // Fill the new buffer with current data
115
- newBuffer.set(new Uint8Array(ArrayBuffer.isView(buffer) ? buffer.buffer : buffer));
116
+ newBuffer.set(new Uint8Array(buf));
116
117
  /* Add a random ino.
117
118
  This will be different from the actual one,
118
119
  but `ino` isn't used anywhere so it should be fine.
119
120
  */
120
- const randomIno = crypto.getRandomValues(new Uint32Array(2));
121
- newBuffer.set(randomIno, sz_inode - 2);
121
+ new DataView(newBuffer.buffer).setBigUint64(sz_inode - 2, randomBigInt());
122
122
  buffer = newBuffer;
123
123
  }
124
124
  deserialize(this, buffer);
package/dist/lib.d.ts ADDED
@@ -0,0 +1 @@
1
+ export {};
package/dist/lib.js ADDED
@@ -0,0 +1,2 @@
1
+ export {};
2
+ /* eslint-disable @typescript-eslint/no-empty-object-type */
@@ -1 +1,5 @@
1
+ declare global {
2
+ interface AsyncIterator<T, TReturn, TNext> extends AsyncDisposable {
3
+ }
4
+ }
1
5
  export {};
package/dist/utils.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type * as fs from 'node:fs';
2
- import type { ClassLike, OptionalTuple } from 'utilium';
2
+ import { type ClassLike, type OptionalTuple } from 'utilium';
3
3
  import { type AbsolutePath } from './emulation/path.js';
4
4
  import { ErrnoError } from './error.js';
5
5
  import type { FileSystem } from './filesystem.js';
package/dist/utils.js CHANGED
@@ -1,3 +1,4 @@
1
+ import { randomHex } from 'utilium';
1
2
  import { dirname, resolve } from './emulation/path.js';
2
3
  import { Errno, ErrnoError } from './error.js';
3
4
  /**
@@ -218,5 +219,11 @@ export function normalizeOptions(options, encoding = 'utf8', flag, mode = 0) {
218
219
  * @internal
219
220
  */
220
221
  export function randomBigInt() {
221
- return crypto.getRandomValues(new BigUint64Array(1))[0];
222
+ try {
223
+ return crypto.getRandomValues(new BigUint64Array(1))[0];
224
+ }
225
+ catch {
226
+ // fallback
227
+ return BigInt('0x' + randomHex(16 /* 4 bits per char */));
228
+ }
222
229
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zenfs/core",
3
- "version": "1.6.3",
3
+ "version": "1.6.5",
4
4
  "description": "A filesystem, anywhere",
5
5
  "funding": {
6
6
  "type": "individual",
@@ -21,8 +21,7 @@
21
21
  "dist",
22
22
  "tests",
23
23
  "license.md",
24
- "eslint.shared.js",
25
- "patches"
24
+ "eslint.shared.js"
26
25
  ],
27
26
  "type": "module",
28
27
  "homepage": "https://github.com/zen-fs/core",
@@ -59,8 +58,7 @@
59
58
  "build": "tsc -p tsconfig.json",
60
59
  "build:docs": "typedoc",
61
60
  "dev": "npm run build -- --watch",
62
- "prepublishOnly": "npm run build",
63
- "postinstall": "patch-package"
61
+ "prepublishOnly": "npm run build"
64
62
  },
65
63
  "lint-staged": {
66
64
  "*": [
@@ -73,8 +71,7 @@
73
71
  "buffer": "^6.0.3",
74
72
  "eventemitter3": "^5.0.1",
75
73
  "readable-stream": "^4.5.2",
76
- "utilium": "^1.1.1",
77
- "patch-package": "^8.0.0"
74
+ "utilium": "^1.1.1"
78
75
  },
79
76
  "optionalDependencies": {
80
77
  "minimatch": "^9.0.3"
@@ -1,11 +0,0 @@
1
- diff --git a/node_modules/typescript/lib/lib.esnext.disposable.d.ts b/node_modules/typescript/lib/lib.esnext.disposable.d.ts
2
- index b169d96..2bc15f0 100644
3
- --- a/node_modules/typescript/lib/lib.esnext.disposable.d.ts
4
- +++ b/node_modules/typescript/lib/lib.esnext.disposable.d.ts
5
- @@ -191,3 +191,6 @@ interface IteratorObject<T, TReturn, TNext> extends Disposable {
6
-
7
- interface AsyncIteratorObject<T, TReturn, TNext> extends AsyncDisposable {
8
- }
9
- +
10
- +interface AsyncIterator<T, TReturn, TNext> extends AsyncDisposable {
11
- +}