@zenfs/core 0.18.0 → 0.18.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.
@@ -88,11 +88,9 @@ export declare class UnmutexedOverlayFS extends FileSystem {
88
88
  private copyToWritableSync;
89
89
  private copyToWritable;
90
90
  }
91
- declare const OverlayFS_base: import("../mixins/shared.js").Mixin<typeof UnmutexedOverlayFS, {
92
- lock(path: string, syscall: string): Promise<import("../mixins/mutexed.js").MutexLock>;
93
- lockSync(path: string): import("../mixins/mutexed.js").MutexLock;
94
- isLocked(path: string): boolean;
95
- }>;
91
+ declare const OverlayFS_base: {
92
+ new (): import("../mixins/mutexed.js").__MutexedFS<UnmutexedOverlayFS>;
93
+ } & (new (args_0: OverlayOptions) => import("../mixins/mutexed.js").__MutexedFS<UnmutexedOverlayFS>);
96
94
  /**
97
95
  * OverlayFS makes a read-only filesystem writable by storing writes on a second,
98
96
  * writable file system. Deletes are persisted via metadata stored on the writable
@@ -376,26 +376,26 @@ export class UnmutexedOverlayFS extends FileSystem {
376
376
  * should they not exist. Use modes from the read-only storage.
377
377
  */
378
378
  createParentDirectoriesSync(path) {
379
- let parent = dirname(path), toCreate = [];
379
+ let parent = dirname(path);
380
+ const toCreate = [];
380
381
  while (!this.writable.existsSync(parent)) {
381
382
  toCreate.push(parent);
382
383
  parent = dirname(parent);
383
384
  }
384
- toCreate = toCreate.reverse();
385
- for (const p of toCreate) {
386
- this.writable.mkdirSync(p, this.statSync(p).mode);
385
+ for (const path of toCreate.reverse()) {
386
+ this.writable.mkdirSync(path, this.statSync(path).mode);
387
387
  }
388
388
  }
389
389
  async createParentDirectories(path) {
390
- let parent = dirname(path), toCreate = [];
390
+ let parent = dirname(path);
391
+ const toCreate = [];
391
392
  while (!(await this.writable.exists(parent))) {
392
393
  toCreate.push(parent);
393
394
  parent = dirname(parent);
394
395
  }
395
- toCreate = toCreate.reverse();
396
- for (const p of toCreate) {
397
- const stats = await this.stat(p);
398
- await this.writable.mkdir(p, stats.mode);
396
+ for (const path of toCreate.reverse()) {
397
+ const stats = await this.stat(path);
398
+ await this.writable.mkdir(path, stats.mode);
399
399
  }
400
400
  }
401
401
  /**
@@ -17,9 +17,8 @@ interface FileRequest<TMethod extends FileMethod = FileMethod> extends RPC.Reque
17
17
  args: Parameters<FileMethods[TMethod]>;
18
18
  }
19
19
  export declare class PortFile extends File {
20
- readonly fs: PortFS;
20
+ fs: PortFS;
21
21
  readonly fd: number;
22
- readonly path: string;
23
22
  position: number;
24
23
  constructor(fs: PortFS, fd: number, path: string, position: number);
25
24
  rpc<const T extends FileMethod>(method: T, ...args: Parameters<FileMethods[T]>): Promise<Awaited<ReturnType<FileMethods[T]>>>;
@@ -8,10 +8,9 @@ import { InMemory } from '../memory.js';
8
8
  import * as RPC from './rpc.js';
9
9
  export class PortFile extends File {
10
10
  constructor(fs, fd, path, position) {
11
- super();
11
+ super(fs, path);
12
12
  this.fs = fs;
13
13
  this.fd = fd;
14
- this.path = path;
15
14
  this.position = position;
16
15
  }
17
16
  rpc(method, ...args) {
@@ -23,7 +22,7 @@ export class PortFile extends File {
23
22
  }, this.fs.options);
24
23
  }
25
24
  _throwNoSync(syscall) {
26
- throw new ErrnoError(Errno.ENOTSUP, 'Syncrohnous operations not support on PortFile', this.path, syscall);
25
+ throw new ErrnoError(Errno.ENOTSUP, 'Synchronous operations not supported on PortFile', this.path, syscall);
27
26
  }
28
27
  async stat() {
29
28
  return new Stats(await this.rpc('stat'));