@zenfs/core 2.2.3 → 2.3.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.
Files changed (51) hide show
  1. package/dist/backends/backend.js +6 -9
  2. package/dist/backends/cow.js +4 -4
  3. package/dist/backends/fetch.js +8 -6
  4. package/dist/backends/memory.js +4 -2
  5. package/dist/backends/passthrough.js +2 -0
  6. package/dist/backends/port.d.ts +16 -89
  7. package/dist/backends/port.js +35 -171
  8. package/dist/backends/single_buffer.d.ts +2 -2
  9. package/dist/backends/single_buffer.js +165 -198
  10. package/dist/backends/store/fs.js +50 -73
  11. package/dist/backends/store/map.js +1 -2
  12. package/dist/backends/store/store.js +23 -27
  13. package/dist/config.js +2 -3
  14. package/dist/context.js +2 -2
  15. package/dist/internal/devices.js +7 -10
  16. package/dist/internal/file_index.js +3 -8
  17. package/dist/internal/filesystem.js +19 -12
  18. package/dist/internal/index_fs.js +3 -4
  19. package/dist/internal/inode.js +144 -187
  20. package/dist/internal/rpc.d.ts +143 -0
  21. package/dist/internal/rpc.js +251 -0
  22. package/dist/mixins/async.js +5 -6
  23. package/dist/mixins/mutexed.js +16 -10
  24. package/dist/path.js +3 -4
  25. package/dist/polyfills.js +51 -22
  26. package/dist/readline.js +32 -30
  27. package/dist/utils.d.ts +2 -0
  28. package/dist/utils.js +11 -5
  29. package/dist/vfs/acl.js +44 -68
  30. package/dist/vfs/async.js +4 -4
  31. package/dist/vfs/dir.js +12 -8
  32. package/dist/vfs/file.js +22 -18
  33. package/dist/vfs/ioctl.js +39 -62
  34. package/dist/vfs/promises.js +48 -39
  35. package/dist/vfs/shared.js +4 -5
  36. package/dist/vfs/stats.js +104 -77
  37. package/dist/vfs/streams.js +11 -8
  38. package/dist/vfs/sync.js +23 -26
  39. package/dist/vfs/watchers.js +9 -3
  40. package/dist/vfs/xattr.js +6 -12
  41. package/package.json +2 -2
  42. package/scripts/test.js +16 -7
  43. package/tests/backend/fetch.test.ts +14 -14
  44. package/tests/backend/port.test.ts +25 -17
  45. package/tests/common/handle.test.ts +5 -3
  46. package/tests/fetch/run.sh +2 -1
  47. package/tests/fs/scaling.test.ts +32 -0
  48. package/tests/fs/watch.test.ts +2 -5
  49. package/tests/setup/single-buffer.ts +1 -1
  50. package/tests/tsconfig.json +3 -2
  51. package/types/uint8array.d.ts +64 -0
@@ -12,10 +12,7 @@ export const version = 1;
12
12
  * @internal
13
13
  */
14
14
  export class Index extends Map {
15
- constructor() {
16
- super(...arguments);
17
- this.maxSize = size_max;
18
- }
15
+ maxSize = size_max;
19
16
  /**
20
17
  * Converts the index to JSON
21
18
  */
@@ -54,8 +51,7 @@ export class Index extends Map {
54
51
  }
55
52
  }
56
53
  getByID(id) {
57
- var _a;
58
- return (_a = this.entryByID(id)) === null || _a === void 0 ? void 0 : _a.inode;
54
+ return this.entryByID(id)?.inode;
59
55
  }
60
56
  entryByID(id) {
61
57
  for (const [path, inode] of this) {
@@ -106,12 +102,11 @@ export class Index extends Map {
106
102
  * Loads the index from JSON data
107
103
  */
108
104
  fromJSON(json) {
109
- var _a;
110
105
  if (json.version != version)
111
106
  throw withErrno('EINVAL', 'Index version mismatch');
112
107
  this.clear();
113
108
  for (const [path, node] of Object.entries(json.entries)) {
114
- (_a = node.data) !== null && _a !== void 0 ? _a : (node.data = randomInt(1, size_max));
109
+ node.data ??= randomInt(1, size_max);
115
110
  if (path == '/')
116
111
  node.ino = 0;
117
112
  this.set(path, new Inode(node));
@@ -7,9 +7,27 @@ const _chunkSize = 0x1000;
7
7
  * @internal
8
8
  */
9
9
  export class FileSystem {
10
+ type;
11
+ name;
12
+ label;
13
+ /**
14
+ * The last place this file system was mounted
15
+ * @internal @protected
16
+ */
17
+ _mountPoint;
18
+ /**
19
+ * The UUID of the file system.
20
+ * @privateRemarks This is only used by `ioctl`
21
+ * @internal @protected
22
+ */
23
+ _uuid = crypto.randomUUID();
10
24
  get uuid() {
11
25
  return this._uuid;
12
26
  }
27
+ /**
28
+ * @see FileSystemAttributes
29
+ */
30
+ attributes = new Map();
13
31
  constructor(
14
32
  /**
15
33
  * A unique ID for this kind of file system.
@@ -23,16 +41,6 @@ export class FileSystem {
23
41
  name) {
24
42
  this.type = type;
25
43
  this.name = name;
26
- /**
27
- * The UUID of the file system.
28
- * @privateRemarks This is only used by `ioctl`
29
- * @internal @protected
30
- */
31
- this._uuid = crypto.randomUUID();
32
- /**
33
- * @see FileSystemAttributes
34
- */
35
- this.attributes = new Map();
36
44
  if (this.streamRead === FileSystem.prototype.streamRead)
37
45
  this.attributes.set('default_stream_read');
38
46
  if (this.streamWrite === FileSystem.prototype.streamWrite)
@@ -102,8 +110,7 @@ export class FileSystem {
102
110
  * @privateRemarks The default implementation of `streamWrite` uses "chunked" `write`s
103
111
  */
104
112
  streamWrite(path, options) {
105
- var _a;
106
- let position = (_a = options.start) !== null && _a !== void 0 ? _a : 0;
113
+ let position = options.start ?? 0;
107
114
  return new WritableStream({
108
115
  write: async (chunk, controller) => {
109
116
  let err = false;
@@ -12,6 +12,7 @@ import { Inode } from './inode.js';
12
12
  * @internal
13
13
  */
14
14
  export class IndexFS extends FileSystem {
15
+ index;
15
16
  constructor(id, name, index = new Index()) {
16
17
  super(id, name);
17
18
  this.index = index;
@@ -76,13 +77,11 @@ export class IndexFS extends FileSystem {
76
77
  return inode;
77
78
  }
78
79
  async touch(path, metadata) {
79
- var _a;
80
- const inode = (_a = this.index.get(path)) !== null && _a !== void 0 ? _a : _throw(withErrno('ENOENT'));
80
+ const inode = this.index.get(path) ?? _throw(withErrno('ENOENT'));
81
81
  inode.update(metadata);
82
82
  }
83
83
  touchSync(path, metadata) {
84
- var _a;
85
- const inode = (_a = this.index.get(path)) !== null && _a !== void 0 ? _a : _throw(withErrno('ENOENT'));
84
+ const inode = this.index.get(path) ?? _throw(withErrno('ENOENT'));
86
85
  inode.update(metadata);
87
86
  }
88
87
  _remove(path, isUnlink) {
@@ -32,21 +32,6 @@ var __runInitializers = (this && this.__runInitializers) || function (thisArg, i
32
32
  }
33
33
  return useValue ? value : void 0;
34
34
  };
35
- var __setFunctionName = (this && this.__setFunctionName) || function (f, name, prefix) {
36
- if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : "";
37
- return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
38
- };
39
- var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
40
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
41
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
42
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
43
- };
44
- var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
45
- if (kind === "m") throw new TypeError("Private method is not writable");
46
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
47
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
48
- return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
49
- };
50
35
  import { withErrno } from 'kerium';
51
36
  import { crit, warn } from 'kerium/log';
52
37
  import { field, packed, sizeof, struct, types as t } from 'memium';
@@ -63,7 +48,6 @@ export const rootIno = 0;
63
48
  /** 4 KiB minus static inode data */
64
49
  const maxDynamicData = 3968;
65
50
  let Attribute = (() => {
66
- var _Attribute_keySize_accessor_storage, _Attribute_valueSize_accessor_storage;
67
51
  var _a, _b;
68
52
  let _classDecorators = [struct(packed)];
69
53
  let _classDescriptor;
@@ -76,11 +60,25 @@ let Attribute = (() => {
76
60
  let _valueSize_decorators;
77
61
  let _valueSize_initializers = [];
78
62
  let _valueSize_extraInitializers = [];
79
- var Attribute = _classThis = class extends _classSuper {
80
- get keySize() { return __classPrivateFieldGet(this, _Attribute_keySize_accessor_storage, "f"); }
81
- set keySize(value) { __classPrivateFieldSet(this, _Attribute_keySize_accessor_storage, value, "f"); }
82
- get valueSize() { return __classPrivateFieldGet(this, _Attribute_valueSize_accessor_storage, "f"); }
83
- set valueSize(value) { __classPrivateFieldSet(this, _Attribute_valueSize_accessor_storage, value, "f"); }
63
+ var Attribute = class extends _classSuper {
64
+ static { _classThis = this; }
65
+ static {
66
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
67
+ _keySize_decorators = [(_a = t).uint32.bind(_a)];
68
+ _valueSize_decorators = [(_b = t).uint32.bind(_b)];
69
+ __esDecorate(this, null, _keySize_decorators, { kind: "accessor", name: "keySize", static: false, private: false, access: { has: obj => "keySize" in obj, get: obj => obj.keySize, set: (obj, value) => { obj.keySize = value; } }, metadata: _metadata }, _keySize_initializers, _keySize_extraInitializers);
70
+ __esDecorate(this, null, _valueSize_decorators, { kind: "accessor", name: "valueSize", static: false, private: false, access: { has: obj => "valueSize" in obj, get: obj => obj.valueSize, set: (obj, value) => { obj.valueSize = value; } }, metadata: _metadata }, _valueSize_initializers, _valueSize_extraInitializers);
71
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
72
+ Attribute = _classThis = _classDescriptor.value;
73
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
74
+ __runInitializers(_classThis, _classExtraInitializers);
75
+ }
76
+ #keySize_accessor_storage = __runInitializers(this, _keySize_initializers, void 0);
77
+ get keySize() { return this.#keySize_accessor_storage; }
78
+ set keySize(value) { this.#keySize_accessor_storage = value; }
79
+ #valueSize_accessor_storage = (__runInitializers(this, _keySize_extraInitializers), __runInitializers(this, _valueSize_initializers, void 0));
80
+ get valueSize() { return this.#valueSize_accessor_storage; }
81
+ set valueSize(value) { this.#valueSize_accessor_storage = value; }
84
82
  get name() {
85
83
  return decodeUTF8(this.subarray(8, 8 + this.keySize));
86
84
  }
@@ -110,26 +108,9 @@ let Attribute = (() => {
110
108
  }
111
109
  constructor() {
112
110
  super(...arguments);
113
- _Attribute_keySize_accessor_storage.set(this, __runInitializers(this, _keySize_initializers, void 0));
114
- _Attribute_valueSize_accessor_storage.set(this, (__runInitializers(this, _keySize_extraInitializers), __runInitializers(this, _valueSize_initializers, void 0)));
115
111
  __runInitializers(this, _valueSize_extraInitializers);
116
112
  }
117
113
  };
118
- _Attribute_keySize_accessor_storage = new WeakMap();
119
- _Attribute_valueSize_accessor_storage = new WeakMap();
120
- __setFunctionName(_classThis, "Attribute");
121
- (() => {
122
- var _a;
123
- const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create((_a = _classSuper[Symbol.metadata]) !== null && _a !== void 0 ? _a : null) : void 0;
124
- _keySize_decorators = [(_a = t).uint32.bind(_a)];
125
- _valueSize_decorators = [(_b = t).uint32.bind(_b)];
126
- __esDecorate(_classThis, null, _keySize_decorators, { kind: "accessor", name: "keySize", static: false, private: false, access: { has: obj => "keySize" in obj, get: obj => obj.keySize, set: (obj, value) => { obj.keySize = value; } }, metadata: _metadata }, _keySize_initializers, _keySize_extraInitializers);
127
- __esDecorate(_classThis, null, _valueSize_decorators, { kind: "accessor", name: "valueSize", static: false, private: false, access: { has: obj => "valueSize" in obj, get: obj => obj.valueSize, set: (obj, value) => { obj.valueSize = value; } }, metadata: _metadata }, _valueSize_initializers, _valueSize_extraInitializers);
128
- __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
129
- Attribute = _classThis = _classDescriptor.value;
130
- if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
131
- __runInitializers(_classThis, _classExtraInitializers);
132
- })();
133
114
  return Attribute = _classThis;
134
115
  })();
135
116
  /**
@@ -138,9 +119,8 @@ let Attribute = (() => {
138
119
  * @internal
139
120
  */
140
121
  let Attributes = (() => {
141
- var _Attributes_size_accessor_storage;
142
122
  var _a;
143
- let _classDecorators = [struct(packed)];
123
+ let _classDecorators = [struct(packed, { name: 'Attributes' })];
144
124
  let _classDescriptor;
145
125
  let _classExtraInitializers = [];
146
126
  let _classThis;
@@ -148,9 +128,20 @@ let Attributes = (() => {
148
128
  let _size_decorators;
149
129
  let _size_initializers = [];
150
130
  let _size_extraInitializers = [];
151
- var Attributes = _classThis = class extends _classSuper {
152
- get size() { return __classPrivateFieldGet(this, _Attributes_size_accessor_storage, "f"); }
153
- set size(value) { __classPrivateFieldSet(this, _Attributes_size_accessor_storage, value, "f"); }
131
+ var Attributes = class extends _classSuper {
132
+ static { _classThis = this; }
133
+ static {
134
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
135
+ _size_decorators = [(_a = t).uint32.bind(_a)];
136
+ __esDecorate(this, null, _size_decorators, { kind: "accessor", name: "size", static: false, private: false, access: { has: obj => "size" in obj, get: obj => obj.size, set: (obj, value) => { obj.size = value; } }, metadata: _metadata }, _size_initializers, _size_extraInitializers);
137
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
138
+ Attributes = _classThis = _classDescriptor.value;
139
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
140
+ __runInitializers(_classThis, _classExtraInitializers);
141
+ }
142
+ #size_accessor_storage = __runInitializers(this, _size_initializers, void 0);
143
+ get size() { return this.#size_accessor_storage; }
144
+ set size(value) { this.#size_accessor_storage = value; }
154
145
  get byteSize() {
155
146
  let offset = this.byteOffset + sizeof(this);
156
147
  for (let i = 0; i < this.size; i++) {
@@ -248,22 +239,9 @@ let Attributes = (() => {
248
239
  }
249
240
  constructor() {
250
241
  super(...arguments);
251
- _Attributes_size_accessor_storage.set(this, __runInitializers(this, _size_initializers, void 0));
252
242
  __runInitializers(this, _size_extraInitializers);
253
243
  }
254
244
  };
255
- _Attributes_size_accessor_storage = new WeakMap();
256
- __setFunctionName(_classThis, "Attributes");
257
- (() => {
258
- var _a;
259
- const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create((_a = _classSuper[Symbol.metadata]) !== null && _a !== void 0 ? _a : null) : void 0;
260
- _size_decorators = [(_a = t).uint32.bind(_a)];
261
- __esDecorate(_classThis, null, _size_decorators, { kind: "accessor", name: "size", static: false, private: false, access: { has: obj => "size" in obj, get: obj => obj.size, set: (obj, value) => { obj.size = value; } }, metadata: _metadata }, _size_initializers, _size_extraInitializers);
262
- __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
263
- Attributes = _classThis = _classDescriptor.value;
264
- if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
265
- __runInitializers(_classThis, _classExtraInitializers);
266
- })();
267
245
  return Attributes = _classThis;
268
246
  })();
269
247
  export { Attributes };
@@ -349,9 +327,8 @@ export const userModifiableFlags = 0x000380ff;
349
327
  * @internal
350
328
  */
351
329
  let Inode = (() => {
352
- var _Inode_data_accessor_storage, _Inode___data_old_accessor_storage, _Inode_size_accessor_storage, _Inode_mode_accessor_storage, _Inode_nlink_accessor_storage, _Inode_uid_accessor_storage, _Inode_gid_accessor_storage, _Inode_atimeMs_accessor_storage, _Inode_birthtimeMs_accessor_storage, _Inode_mtimeMs_accessor_storage, _Inode_ctimeMs_accessor_storage, _Inode_ino_accessor_storage, _Inode___ino_old_accessor_storage, _Inode_flags_accessor_storage, _Inode___after_flags_accessor_storage, _Inode_version_accessor_storage, _Inode___padding_accessor_storage, _Inode_attributes_accessor_storage, _Inode___data_accessor_storage;
353
330
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
354
- let _classDecorators = [struct(packed)];
331
+ let _classDecorators = [struct(packed, { name: 'Inode' })];
355
332
  let _classDescriptor;
356
333
  let _classExtraInitializers = [];
357
334
  let _classThis;
@@ -413,7 +390,53 @@ let Inode = (() => {
413
390
  let ___data_decorators;
414
391
  let ___data_initializers = [];
415
392
  let ___data_extraInitializers = [];
416
- var Inode = _classThis = class extends _classSuper {
393
+ var Inode = class extends _classSuper {
394
+ static { _classThis = this; }
395
+ static {
396
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
397
+ _data_decorators = [(_a = t).uint32.bind(_a)];
398
+ ___data_old_decorators = [(_b = t).uint32.bind(_b)];
399
+ _size_decorators = [(_c = t).uint32.bind(_c)];
400
+ _mode_decorators = [(_d = t).uint16.bind(_d)];
401
+ _nlink_decorators = [(_e = t).uint32.bind(_e)];
402
+ _uid_decorators = [(_f = t).uint32.bind(_f)];
403
+ _gid_decorators = [(_g = t).uint32.bind(_g)];
404
+ _atimeMs_decorators = [(_h = t).float64.bind(_h)];
405
+ _birthtimeMs_decorators = [(_j = t).float64.bind(_j)];
406
+ _mtimeMs_decorators = [(_k = t).float64.bind(_k)];
407
+ _ctimeMs_decorators = [(_l = t).float64.bind(_l)];
408
+ _ino_decorators = [(_m = t).uint32.bind(_m)];
409
+ ___ino_old_decorators = [(_o = t).uint32.bind(_o)];
410
+ _flags_decorators = [(_p = t).uint32.bind(_p)];
411
+ ___after_flags_decorators = [(_q = t).uint16.bind(_q)];
412
+ _version_decorators = [(_r = t).uint32.bind(_r)];
413
+ ___padding_decorators = [t.uint8(48)];
414
+ _attributes_decorators = [field(Attributes)];
415
+ ___data_decorators = [t.uint8(maxDynamicData)];
416
+ __esDecorate(this, null, _data_decorators, { kind: "accessor", name: "data", static: false, private: false, access: { has: obj => "data" in obj, get: obj => obj.data, set: (obj, value) => { obj.data = value; } }, metadata: _metadata }, _data_initializers, _data_extraInitializers);
417
+ __esDecorate(this, null, ___data_old_decorators, { kind: "accessor", name: "__data_old", static: false, private: false, access: { has: obj => "__data_old" in obj, get: obj => obj.__data_old, set: (obj, value) => { obj.__data_old = value; } }, metadata: _metadata }, ___data_old_initializers, ___data_old_extraInitializers);
418
+ __esDecorate(this, null, _size_decorators, { kind: "accessor", name: "size", static: false, private: false, access: { has: obj => "size" in obj, get: obj => obj.size, set: (obj, value) => { obj.size = value; } }, metadata: _metadata }, _size_initializers, _size_extraInitializers);
419
+ __esDecorate(this, null, _mode_decorators, { kind: "accessor", name: "mode", static: false, private: false, access: { has: obj => "mode" in obj, get: obj => obj.mode, set: (obj, value) => { obj.mode = value; } }, metadata: _metadata }, _mode_initializers, _mode_extraInitializers);
420
+ __esDecorate(this, null, _nlink_decorators, { kind: "accessor", name: "nlink", static: false, private: false, access: { has: obj => "nlink" in obj, get: obj => obj.nlink, set: (obj, value) => { obj.nlink = value; } }, metadata: _metadata }, _nlink_initializers, _nlink_extraInitializers);
421
+ __esDecorate(this, null, _uid_decorators, { kind: "accessor", name: "uid", static: false, private: false, access: { has: obj => "uid" in obj, get: obj => obj.uid, set: (obj, value) => { obj.uid = value; } }, metadata: _metadata }, _uid_initializers, _uid_extraInitializers);
422
+ __esDecorate(this, null, _gid_decorators, { kind: "accessor", name: "gid", static: false, private: false, access: { has: obj => "gid" in obj, get: obj => obj.gid, set: (obj, value) => { obj.gid = value; } }, metadata: _metadata }, _gid_initializers, _gid_extraInitializers);
423
+ __esDecorate(this, null, _atimeMs_decorators, { kind: "accessor", name: "atimeMs", static: false, private: false, access: { has: obj => "atimeMs" in obj, get: obj => obj.atimeMs, set: (obj, value) => { obj.atimeMs = value; } }, metadata: _metadata }, _atimeMs_initializers, _atimeMs_extraInitializers);
424
+ __esDecorate(this, null, _birthtimeMs_decorators, { kind: "accessor", name: "birthtimeMs", static: false, private: false, access: { has: obj => "birthtimeMs" in obj, get: obj => obj.birthtimeMs, set: (obj, value) => { obj.birthtimeMs = value; } }, metadata: _metadata }, _birthtimeMs_initializers, _birthtimeMs_extraInitializers);
425
+ __esDecorate(this, null, _mtimeMs_decorators, { kind: "accessor", name: "mtimeMs", static: false, private: false, access: { has: obj => "mtimeMs" in obj, get: obj => obj.mtimeMs, set: (obj, value) => { obj.mtimeMs = value; } }, metadata: _metadata }, _mtimeMs_initializers, _mtimeMs_extraInitializers);
426
+ __esDecorate(this, null, _ctimeMs_decorators, { kind: "accessor", name: "ctimeMs", static: false, private: false, access: { has: obj => "ctimeMs" in obj, get: obj => obj.ctimeMs, set: (obj, value) => { obj.ctimeMs = value; } }, metadata: _metadata }, _ctimeMs_initializers, _ctimeMs_extraInitializers);
427
+ __esDecorate(this, null, _ino_decorators, { kind: "accessor", name: "ino", static: false, private: false, access: { has: obj => "ino" in obj, get: obj => obj.ino, set: (obj, value) => { obj.ino = value; } }, metadata: _metadata }, _ino_initializers, _ino_extraInitializers);
428
+ __esDecorate(this, null, ___ino_old_decorators, { kind: "accessor", name: "__ino_old", static: false, private: false, access: { has: obj => "__ino_old" in obj, get: obj => obj.__ino_old, set: (obj, value) => { obj.__ino_old = value; } }, metadata: _metadata }, ___ino_old_initializers, ___ino_old_extraInitializers);
429
+ __esDecorate(this, null, _flags_decorators, { kind: "accessor", name: "flags", static: false, private: false, access: { has: obj => "flags" in obj, get: obj => obj.flags, set: (obj, value) => { obj.flags = value; } }, metadata: _metadata }, _flags_initializers, _flags_extraInitializers);
430
+ __esDecorate(this, null, ___after_flags_decorators, { kind: "accessor", name: "__after_flags", static: false, private: false, access: { has: obj => "__after_flags" in obj, get: obj => obj.__after_flags, set: (obj, value) => { obj.__after_flags = value; } }, metadata: _metadata }, ___after_flags_initializers, ___after_flags_extraInitializers);
431
+ __esDecorate(this, null, _version_decorators, { kind: "accessor", name: "version", static: false, private: false, access: { has: obj => "version" in obj, get: obj => obj.version, set: (obj, value) => { obj.version = value; } }, metadata: _metadata }, _version_initializers, _version_extraInitializers);
432
+ __esDecorate(this, null, ___padding_decorators, { kind: "accessor", name: "__padding", static: false, private: false, access: { has: obj => "__padding" in obj, get: obj => obj.__padding, set: (obj, value) => { obj.__padding = value; } }, metadata: _metadata }, ___padding_initializers, ___padding_extraInitializers);
433
+ __esDecorate(this, null, _attributes_decorators, { kind: "accessor", name: "attributes", static: false, private: false, access: { has: obj => "attributes" in obj, get: obj => obj.attributes, set: (obj, value) => { obj.attributes = value; } }, metadata: _metadata }, _attributes_initializers, _attributes_extraInitializers);
434
+ __esDecorate(this, null, ___data_decorators, { kind: "accessor", name: "__data", static: false, private: false, access: { has: obj => "__data" in obj, get: obj => obj.__data, set: (obj, value) => { obj.__data = value; } }, metadata: _metadata }, ___data_initializers, ___data_extraInitializers);
435
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
436
+ Inode = _classThis = _classDescriptor.value;
437
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
438
+ __runInitializers(_classThis, _classExtraInitializers);
439
+ }
417
440
  constructor(...args) {
418
441
  let data = {};
419
442
  if (typeof args[0] === 'object' && args[0] !== null && !ArrayBuffer.isView(args[0])) {
@@ -421,98 +444,98 @@ let Inode = (() => {
421
444
  args = [sizeof(Inode)];
422
445
  }
423
446
  super(...args);
424
- _Inode_data_accessor_storage.set(this, __runInitializers(this, _data_initializers, void 0));
425
- _Inode___data_old_accessor_storage.set(this, (__runInitializers(this, _data_extraInitializers), __runInitializers(this, ___data_old_initializers, void 0)));
426
- _Inode_size_accessor_storage.set(this, (__runInitializers(this, ___data_old_extraInitializers), __runInitializers(this, _size_initializers, void 0)));
427
- _Inode_mode_accessor_storage.set(this, (__runInitializers(this, _size_extraInitializers), __runInitializers(this, _mode_initializers, void 0)));
428
- _Inode_nlink_accessor_storage.set(this, (__runInitializers(this, _mode_extraInitializers), __runInitializers(this, _nlink_initializers, void 0)));
429
- _Inode_uid_accessor_storage.set(this, (__runInitializers(this, _nlink_extraInitializers), __runInitializers(this, _uid_initializers, void 0)));
430
- _Inode_gid_accessor_storage.set(this, (__runInitializers(this, _uid_extraInitializers), __runInitializers(this, _gid_initializers, void 0)));
431
- _Inode_atimeMs_accessor_storage.set(this, (__runInitializers(this, _gid_extraInitializers), __runInitializers(this, _atimeMs_initializers, void 0)));
432
- _Inode_birthtimeMs_accessor_storage.set(this, (__runInitializers(this, _atimeMs_extraInitializers), __runInitializers(this, _birthtimeMs_initializers, void 0)));
433
- _Inode_mtimeMs_accessor_storage.set(this, (__runInitializers(this, _birthtimeMs_extraInitializers), __runInitializers(this, _mtimeMs_initializers, void 0)));
434
- _Inode_ctimeMs_accessor_storage.set(this, (__runInitializers(this, _mtimeMs_extraInitializers), __runInitializers(this, _ctimeMs_initializers, void 0)));
435
- _Inode_ino_accessor_storage.set(this, (__runInitializers(this, _ctimeMs_extraInitializers), __runInitializers(this, _ino_initializers, void 0)));
436
- _Inode___ino_old_accessor_storage.set(this, (__runInitializers(this, _ino_extraInitializers), __runInitializers(this, ___ino_old_initializers, void 0)));
437
- _Inode_flags_accessor_storage.set(this, (__runInitializers(this, ___ino_old_extraInitializers), __runInitializers(this, _flags_initializers, void 0)));
438
- _Inode___after_flags_accessor_storage.set(this, (__runInitializers(this, _flags_extraInitializers), __runInitializers(this, ___after_flags_initializers, void 0)));
439
- _Inode_version_accessor_storage.set(this, (__runInitializers(this, ___after_flags_extraInitializers), __runInitializers(this, _version_initializers, void 0)));
440
- _Inode___padding_accessor_storage.set(this, (__runInitializers(this, _version_extraInitializers), __runInitializers(this, ___padding_initializers, void 0)));
441
- _Inode_attributes_accessor_storage.set(this, (__runInitializers(this, ___padding_extraInitializers), __runInitializers(this, _attributes_initializers, void 0)));
442
- _Inode___data_accessor_storage.set(this, (__runInitializers(this, _attributes_extraInitializers), __runInitializers(this, ___data_initializers, void 0)));
443
447
  __runInitializers(this, ___data_extraInitializers);
444
448
  if (this.byteLength < sizeof(Inode)) {
445
449
  throw crit(withErrno('EIO', `Buffer is too small to create an inode (${this.byteLength} bytes)`));
446
450
  }
447
451
  Object.assign(this, data);
448
- this.atimeMs || (this.atimeMs = Date.now());
449
- this.mtimeMs || (this.mtimeMs = Date.now());
450
- this.ctimeMs || (this.ctimeMs = Date.now());
451
- this.birthtimeMs || (this.birthtimeMs = Date.now());
452
+ this.atimeMs ||= Date.now();
453
+ this.mtimeMs ||= Date.now();
454
+ this.ctimeMs ||= Date.now();
455
+ this.birthtimeMs ||= Date.now();
452
456
  if (this.ino && !this.nlink) {
453
457
  warn(`Inode ${this.ino} has an nlink of 0`);
454
458
  }
455
459
  }
456
- get data() { return __classPrivateFieldGet(this, _Inode_data_accessor_storage, "f"); }
457
- set data(value) { __classPrivateFieldSet(this, _Inode_data_accessor_storage, value, "f"); }
460
+ #data_accessor_storage = __runInitializers(this, _data_initializers, void 0);
461
+ get data() { return this.#data_accessor_storage; }
462
+ set data(value) { this.#data_accessor_storage = value; }
463
+ #__data_old_accessor_storage = (__runInitializers(this, _data_extraInitializers), __runInitializers(this, ___data_old_initializers, void 0));
458
464
  /** For future use */
459
- get __data_old() { return __classPrivateFieldGet(this, _Inode___data_old_accessor_storage, "f"); }
460
- set __data_old(value) { __classPrivateFieldSet(this, _Inode___data_old_accessor_storage, value, "f"); }
461
- get size() { return __classPrivateFieldGet(this, _Inode_size_accessor_storage, "f"); }
462
- set size(value) { __classPrivateFieldSet(this, _Inode_size_accessor_storage, value, "f"); }
463
- get mode() { return __classPrivateFieldGet(this, _Inode_mode_accessor_storage, "f"); }
464
- set mode(value) { __classPrivateFieldSet(this, _Inode_mode_accessor_storage, value, "f"); }
465
- get nlink() { return __classPrivateFieldGet(this, _Inode_nlink_accessor_storage, "f"); }
466
- set nlink(value) { __classPrivateFieldSet(this, _Inode_nlink_accessor_storage, value, "f"); }
467
- get uid() { return __classPrivateFieldGet(this, _Inode_uid_accessor_storage, "f"); }
468
- set uid(value) { __classPrivateFieldSet(this, _Inode_uid_accessor_storage, value, "f"); }
469
- get gid() { return __classPrivateFieldGet(this, _Inode_gid_accessor_storage, "f"); }
470
- set gid(value) { __classPrivateFieldSet(this, _Inode_gid_accessor_storage, value, "f"); }
471
- get atimeMs() { return __classPrivateFieldGet(this, _Inode_atimeMs_accessor_storage, "f"); }
472
- set atimeMs(value) { __classPrivateFieldSet(this, _Inode_atimeMs_accessor_storage, value, "f"); }
473
- get birthtimeMs() { return __classPrivateFieldGet(this, _Inode_birthtimeMs_accessor_storage, "f"); }
474
- set birthtimeMs(value) { __classPrivateFieldSet(this, _Inode_birthtimeMs_accessor_storage, value, "f"); }
475
- get mtimeMs() { return __classPrivateFieldGet(this, _Inode_mtimeMs_accessor_storage, "f"); }
476
- set mtimeMs(value) { __classPrivateFieldSet(this, _Inode_mtimeMs_accessor_storage, value, "f"); }
465
+ get __data_old() { return this.#__data_old_accessor_storage; }
466
+ set __data_old(value) { this.#__data_old_accessor_storage = value; }
467
+ #size_accessor_storage = (__runInitializers(this, ___data_old_extraInitializers), __runInitializers(this, _size_initializers, void 0));
468
+ get size() { return this.#size_accessor_storage; }
469
+ set size(value) { this.#size_accessor_storage = value; }
470
+ #mode_accessor_storage = (__runInitializers(this, _size_extraInitializers), __runInitializers(this, _mode_initializers, void 0));
471
+ get mode() { return this.#mode_accessor_storage; }
472
+ set mode(value) { this.#mode_accessor_storage = value; }
473
+ #nlink_accessor_storage = (__runInitializers(this, _mode_extraInitializers), __runInitializers(this, _nlink_initializers, void 0));
474
+ get nlink() { return this.#nlink_accessor_storage; }
475
+ set nlink(value) { this.#nlink_accessor_storage = value; }
476
+ #uid_accessor_storage = (__runInitializers(this, _nlink_extraInitializers), __runInitializers(this, _uid_initializers, void 0));
477
+ get uid() { return this.#uid_accessor_storage; }
478
+ set uid(value) { this.#uid_accessor_storage = value; }
479
+ #gid_accessor_storage = (__runInitializers(this, _uid_extraInitializers), __runInitializers(this, _gid_initializers, void 0));
480
+ get gid() { return this.#gid_accessor_storage; }
481
+ set gid(value) { this.#gid_accessor_storage = value; }
482
+ #atimeMs_accessor_storage = (__runInitializers(this, _gid_extraInitializers), __runInitializers(this, _atimeMs_initializers, void 0));
483
+ get atimeMs() { return this.#atimeMs_accessor_storage; }
484
+ set atimeMs(value) { this.#atimeMs_accessor_storage = value; }
485
+ #birthtimeMs_accessor_storage = (__runInitializers(this, _atimeMs_extraInitializers), __runInitializers(this, _birthtimeMs_initializers, void 0));
486
+ get birthtimeMs() { return this.#birthtimeMs_accessor_storage; }
487
+ set birthtimeMs(value) { this.#birthtimeMs_accessor_storage = value; }
488
+ #mtimeMs_accessor_storage = (__runInitializers(this, _birthtimeMs_extraInitializers), __runInitializers(this, _mtimeMs_initializers, void 0));
489
+ get mtimeMs() { return this.#mtimeMs_accessor_storage; }
490
+ set mtimeMs(value) { this.#mtimeMs_accessor_storage = value; }
491
+ #ctimeMs_accessor_storage = (__runInitializers(this, _mtimeMs_extraInitializers), __runInitializers(this, _ctimeMs_initializers, void 0));
477
492
  /**
478
493
  * The time the inode was changed.
479
494
  *
480
495
  * This is automatically updated whenever changed are made using `update()`.
481
496
  */
482
- get ctimeMs() { return __classPrivateFieldGet(this, _Inode_ctimeMs_accessor_storage, "f"); }
483
- set ctimeMs(value) { __classPrivateFieldSet(this, _Inode_ctimeMs_accessor_storage, value, "f"); }
484
- get ino() { return __classPrivateFieldGet(this, _Inode_ino_accessor_storage, "f"); }
485
- set ino(value) { __classPrivateFieldSet(this, _Inode_ino_accessor_storage, value, "f"); }
497
+ get ctimeMs() { return this.#ctimeMs_accessor_storage; }
498
+ set ctimeMs(value) { this.#ctimeMs_accessor_storage = value; }
499
+ #ino_accessor_storage = (__runInitializers(this, _ctimeMs_extraInitializers), __runInitializers(this, _ino_initializers, void 0));
500
+ get ino() { return this.#ino_accessor_storage; }
501
+ set ino(value) { this.#ino_accessor_storage = value; }
502
+ #__ino_old_accessor_storage = (__runInitializers(this, _ino_extraInitializers), __runInitializers(this, ___ino_old_initializers, void 0));
486
503
  /** For future use */
487
- get __ino_old() { return __classPrivateFieldGet(this, _Inode___ino_old_accessor_storage, "f"); }
488
- set __ino_old(value) { __classPrivateFieldSet(this, _Inode___ino_old_accessor_storage, value, "f"); }
489
- get flags() { return __classPrivateFieldGet(this, _Inode_flags_accessor_storage, "f"); }
490
- set flags(value) { __classPrivateFieldSet(this, _Inode_flags_accessor_storage, value, "f"); }
504
+ get __ino_old() { return this.#__ino_old_accessor_storage; }
505
+ set __ino_old(value) { this.#__ino_old_accessor_storage = value; }
506
+ #flags_accessor_storage = (__runInitializers(this, ___ino_old_extraInitializers), __runInitializers(this, _flags_initializers, void 0));
507
+ get flags() { return this.#flags_accessor_storage; }
508
+ set flags(value) { this.#flags_accessor_storage = value; }
509
+ #__after_flags_accessor_storage = (__runInitializers(this, _flags_extraInitializers), __runInitializers(this, ___after_flags_initializers, void 0));
491
510
  /** For future use */
492
- get __after_flags() { return __classPrivateFieldGet(this, _Inode___after_flags_accessor_storage, "f"); }
493
- set __after_flags(value) { __classPrivateFieldSet(this, _Inode___after_flags_accessor_storage, value, "f"); }
511
+ get __after_flags() { return this.#__after_flags_accessor_storage; }
512
+ set __after_flags(value) { this.#__after_flags_accessor_storage = value; }
513
+ #version_accessor_storage = (__runInitializers(this, ___after_flags_extraInitializers), __runInitializers(this, _version_initializers, void 0));
494
514
  /**
495
515
  * The "version" of the inode/data.
496
516
  * Unrelated to the inode format!
497
517
  */
498
- get version() { return __classPrivateFieldGet(this, _Inode_version_accessor_storage, "f"); }
499
- set version(value) { __classPrivateFieldSet(this, _Inode_version_accessor_storage, value, "f"); }
518
+ get version() { return this.#version_accessor_storage; }
519
+ set version(value) { this.#version_accessor_storage = value; }
520
+ #__padding_accessor_storage = (__runInitializers(this, _version_extraInitializers), __runInitializers(this, ___padding_initializers, void 0));
500
521
  /**
501
522
  * Padding up to 128 bytes.
502
523
  * This ensures there is enough room for expansion without breaking the ABI.
503
524
  * @internal
504
525
  */
505
- get __padding() { return __classPrivateFieldGet(this, _Inode___padding_accessor_storage, "f"); }
506
- set __padding(value) { __classPrivateFieldSet(this, _Inode___padding_accessor_storage, value, "f"); }
507
- get attributes() { return __classPrivateFieldGet(this, _Inode_attributes_accessor_storage, "f"); }
508
- set attributes(value) { __classPrivateFieldSet(this, _Inode_attributes_accessor_storage, value, "f"); }
526
+ get __padding() { return this.#__padding_accessor_storage; }
527
+ set __padding(value) { this.#__padding_accessor_storage = value; }
528
+ #attributes_accessor_storage = (__runInitializers(this, ___padding_extraInitializers), __runInitializers(this, _attributes_initializers, void 0));
529
+ get attributes() { return this.#attributes_accessor_storage; }
530
+ set attributes(value) { this.#attributes_accessor_storage = value; }
531
+ #__data_accessor_storage = (__runInitializers(this, _attributes_extraInitializers), __runInitializers(this, ___data_initializers, void 0));
509
532
  /**
510
533
  * Since the attribute data uses dynamic arrays,
511
534
  * it is necessary to add this so attributes can be added.
512
535
  * @internal @hidden
513
536
  */
514
- get __data() { return __classPrivateFieldGet(this, _Inode___data_accessor_storage, "f"); }
515
- set __data(value) { __classPrivateFieldSet(this, _Inode___data_accessor_storage, value, "f"); }
537
+ get __data() { return this.#__data_accessor_storage; }
538
+ set __data(value) { this.#__data_accessor_storage = value; }
516
539
  toString() {
517
540
  return `<Inode ${this.ino}>`;
518
541
  }
@@ -564,72 +587,6 @@ let Inode = (() => {
564
587
  return hasChanged;
565
588
  }
566
589
  };
567
- _Inode_data_accessor_storage = new WeakMap();
568
- _Inode___data_old_accessor_storage = new WeakMap();
569
- _Inode_size_accessor_storage = new WeakMap();
570
- _Inode_mode_accessor_storage = new WeakMap();
571
- _Inode_nlink_accessor_storage = new WeakMap();
572
- _Inode_uid_accessor_storage = new WeakMap();
573
- _Inode_gid_accessor_storage = new WeakMap();
574
- _Inode_atimeMs_accessor_storage = new WeakMap();
575
- _Inode_birthtimeMs_accessor_storage = new WeakMap();
576
- _Inode_mtimeMs_accessor_storage = new WeakMap();
577
- _Inode_ctimeMs_accessor_storage = new WeakMap();
578
- _Inode_ino_accessor_storage = new WeakMap();
579
- _Inode___ino_old_accessor_storage = new WeakMap();
580
- _Inode_flags_accessor_storage = new WeakMap();
581
- _Inode___after_flags_accessor_storage = new WeakMap();
582
- _Inode_version_accessor_storage = new WeakMap();
583
- _Inode___padding_accessor_storage = new WeakMap();
584
- _Inode_attributes_accessor_storage = new WeakMap();
585
- _Inode___data_accessor_storage = new WeakMap();
586
- __setFunctionName(_classThis, "Inode");
587
- (() => {
588
- var _a;
589
- const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create((_a = _classSuper[Symbol.metadata]) !== null && _a !== void 0 ? _a : null) : void 0;
590
- _data_decorators = [(_a = t).uint32.bind(_a)];
591
- ___data_old_decorators = [(_b = t).uint32.bind(_b)];
592
- _size_decorators = [(_c = t).uint32.bind(_c)];
593
- _mode_decorators = [(_d = t).uint16.bind(_d)];
594
- _nlink_decorators = [(_e = t).uint32.bind(_e)];
595
- _uid_decorators = [(_f = t).uint32.bind(_f)];
596
- _gid_decorators = [(_g = t).uint32.bind(_g)];
597
- _atimeMs_decorators = [(_h = t).float64.bind(_h)];
598
- _birthtimeMs_decorators = [(_j = t).float64.bind(_j)];
599
- _mtimeMs_decorators = [(_k = t).float64.bind(_k)];
600
- _ctimeMs_decorators = [(_l = t).float64.bind(_l)];
601
- _ino_decorators = [(_m = t).uint32.bind(_m)];
602
- ___ino_old_decorators = [(_o = t).uint32.bind(_o)];
603
- _flags_decorators = [(_p = t).uint32.bind(_p)];
604
- ___after_flags_decorators = [(_q = t).uint16.bind(_q)];
605
- _version_decorators = [(_r = t).uint32.bind(_r)];
606
- ___padding_decorators = [t.uint8(48)];
607
- _attributes_decorators = [field(Attributes)];
608
- ___data_decorators = [t.uint8(maxDynamicData)];
609
- __esDecorate(_classThis, null, _data_decorators, { kind: "accessor", name: "data", static: false, private: false, access: { has: obj => "data" in obj, get: obj => obj.data, set: (obj, value) => { obj.data = value; } }, metadata: _metadata }, _data_initializers, _data_extraInitializers);
610
- __esDecorate(_classThis, null, ___data_old_decorators, { kind: "accessor", name: "__data_old", static: false, private: false, access: { has: obj => "__data_old" in obj, get: obj => obj.__data_old, set: (obj, value) => { obj.__data_old = value; } }, metadata: _metadata }, ___data_old_initializers, ___data_old_extraInitializers);
611
- __esDecorate(_classThis, null, _size_decorators, { kind: "accessor", name: "size", static: false, private: false, access: { has: obj => "size" in obj, get: obj => obj.size, set: (obj, value) => { obj.size = value; } }, metadata: _metadata }, _size_initializers, _size_extraInitializers);
612
- __esDecorate(_classThis, null, _mode_decorators, { kind: "accessor", name: "mode", static: false, private: false, access: { has: obj => "mode" in obj, get: obj => obj.mode, set: (obj, value) => { obj.mode = value; } }, metadata: _metadata }, _mode_initializers, _mode_extraInitializers);
613
- __esDecorate(_classThis, null, _nlink_decorators, { kind: "accessor", name: "nlink", static: false, private: false, access: { has: obj => "nlink" in obj, get: obj => obj.nlink, set: (obj, value) => { obj.nlink = value; } }, metadata: _metadata }, _nlink_initializers, _nlink_extraInitializers);
614
- __esDecorate(_classThis, null, _uid_decorators, { kind: "accessor", name: "uid", static: false, private: false, access: { has: obj => "uid" in obj, get: obj => obj.uid, set: (obj, value) => { obj.uid = value; } }, metadata: _metadata }, _uid_initializers, _uid_extraInitializers);
615
- __esDecorate(_classThis, null, _gid_decorators, { kind: "accessor", name: "gid", static: false, private: false, access: { has: obj => "gid" in obj, get: obj => obj.gid, set: (obj, value) => { obj.gid = value; } }, metadata: _metadata }, _gid_initializers, _gid_extraInitializers);
616
- __esDecorate(_classThis, null, _atimeMs_decorators, { kind: "accessor", name: "atimeMs", static: false, private: false, access: { has: obj => "atimeMs" in obj, get: obj => obj.atimeMs, set: (obj, value) => { obj.atimeMs = value; } }, metadata: _metadata }, _atimeMs_initializers, _atimeMs_extraInitializers);
617
- __esDecorate(_classThis, null, _birthtimeMs_decorators, { kind: "accessor", name: "birthtimeMs", static: false, private: false, access: { has: obj => "birthtimeMs" in obj, get: obj => obj.birthtimeMs, set: (obj, value) => { obj.birthtimeMs = value; } }, metadata: _metadata }, _birthtimeMs_initializers, _birthtimeMs_extraInitializers);
618
- __esDecorate(_classThis, null, _mtimeMs_decorators, { kind: "accessor", name: "mtimeMs", static: false, private: false, access: { has: obj => "mtimeMs" in obj, get: obj => obj.mtimeMs, set: (obj, value) => { obj.mtimeMs = value; } }, metadata: _metadata }, _mtimeMs_initializers, _mtimeMs_extraInitializers);
619
- __esDecorate(_classThis, null, _ctimeMs_decorators, { kind: "accessor", name: "ctimeMs", static: false, private: false, access: { has: obj => "ctimeMs" in obj, get: obj => obj.ctimeMs, set: (obj, value) => { obj.ctimeMs = value; } }, metadata: _metadata }, _ctimeMs_initializers, _ctimeMs_extraInitializers);
620
- __esDecorate(_classThis, null, _ino_decorators, { kind: "accessor", name: "ino", static: false, private: false, access: { has: obj => "ino" in obj, get: obj => obj.ino, set: (obj, value) => { obj.ino = value; } }, metadata: _metadata }, _ino_initializers, _ino_extraInitializers);
621
- __esDecorate(_classThis, null, ___ino_old_decorators, { kind: "accessor", name: "__ino_old", static: false, private: false, access: { has: obj => "__ino_old" in obj, get: obj => obj.__ino_old, set: (obj, value) => { obj.__ino_old = value; } }, metadata: _metadata }, ___ino_old_initializers, ___ino_old_extraInitializers);
622
- __esDecorate(_classThis, null, _flags_decorators, { kind: "accessor", name: "flags", static: false, private: false, access: { has: obj => "flags" in obj, get: obj => obj.flags, set: (obj, value) => { obj.flags = value; } }, metadata: _metadata }, _flags_initializers, _flags_extraInitializers);
623
- __esDecorate(_classThis, null, ___after_flags_decorators, { kind: "accessor", name: "__after_flags", static: false, private: false, access: { has: obj => "__after_flags" in obj, get: obj => obj.__after_flags, set: (obj, value) => { obj.__after_flags = value; } }, metadata: _metadata }, ___after_flags_initializers, ___after_flags_extraInitializers);
624
- __esDecorate(_classThis, null, _version_decorators, { kind: "accessor", name: "version", static: false, private: false, access: { has: obj => "version" in obj, get: obj => obj.version, set: (obj, value) => { obj.version = value; } }, metadata: _metadata }, _version_initializers, _version_extraInitializers);
625
- __esDecorate(_classThis, null, ___padding_decorators, { kind: "accessor", name: "__padding", static: false, private: false, access: { has: obj => "__padding" in obj, get: obj => obj.__padding, set: (obj, value) => { obj.__padding = value; } }, metadata: _metadata }, ___padding_initializers, ___padding_extraInitializers);
626
- __esDecorate(_classThis, null, _attributes_decorators, { kind: "accessor", name: "attributes", static: false, private: false, access: { has: obj => "attributes" in obj, get: obj => obj.attributes, set: (obj, value) => { obj.attributes = value; } }, metadata: _metadata }, _attributes_initializers, _attributes_extraInitializers);
627
- __esDecorate(_classThis, null, ___data_decorators, { kind: "accessor", name: "__data", static: false, private: false, access: { has: obj => "__data" in obj, get: obj => obj.__data, set: (obj, value) => { obj.__data = value; } }, metadata: _metadata }, ___data_initializers, ___data_extraInitializers);
628
- __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
629
- Inode = _classThis = _classDescriptor.value;
630
- if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
631
- __runInitializers(_classThis, _classExtraInitializers);
632
- })();
633
590
  return Inode = _classThis;
634
591
  })();
635
592
  export { Inode };
@@ -660,7 +617,7 @@ export function isFIFO(metadata) {
660
617
  * @internal
661
618
  */
662
619
  export function hasAccess($, inode, access) {
663
- const credentials = ($ === null || $ === void 0 ? void 0 : $.credentials) || defaultContext.credentials;
620
+ const credentials = $?.credentials || defaultContext.credentials;
664
621
  if (isSymbolicLink(inode) || credentials.euid === 0 || credentials.egid === 0)
665
622
  return true;
666
623
  let perm = 0;