@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.
- package/dist/backends/overlay.d.ts +3 -5
- package/dist/backends/overlay.js +9 -9
- package/dist/backends/port/fs.d.ts +1 -2
- package/dist/backends/port/fs.js +2 -3
- package/dist/browser.min.js +4 -4
- package/dist/browser.min.js.map +3 -3
- package/dist/emulation/promises.js +14 -15
- package/dist/emulation/sync.js +13 -14
- package/dist/file.d.ts +22 -13
- package/dist/file.js +16 -7
- package/dist/mixins/mutexed.d.ts +72 -10
- package/dist/mixins/mutexed.js +375 -379
- package/dist/mixins/shared.d.ts +1 -0
- package/dist/mixins/shared.js +1 -0
- package/dist/stats.d.ts +2 -3
- package/dist/stats.js +4 -4
- package/dist/utils.d.ts +2 -1
- package/package.json +1 -1
- package/readme.md +1 -1
- package/src/backends/overlay.ts +9 -11
- package/src/backends/port/fs.ts +4 -4
- package/src/emulation/promises.ts +14 -15
- package/src/emulation/sync.ts +13 -14
- package/src/file.ts +16 -11
- package/src/mixins/mutexed.ts +194 -189
- package/src/mixins/shared.ts +3 -2
- package/src/stats.ts +4 -5
- package/src/utils.ts +3 -1
|
@@ -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:
|
|
92
|
-
|
|
93
|
-
|
|
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
|
package/dist/backends/overlay.js
CHANGED
|
@@ -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)
|
|
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
|
-
|
|
385
|
-
|
|
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)
|
|
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
|
-
|
|
396
|
-
|
|
397
|
-
|
|
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
|
-
|
|
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]>>>;
|
package/dist/backends/port/fs.js
CHANGED
|
@@ -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, '
|
|
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'));
|