@zenfs/core 1.0.7 → 1.0.9
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.
|
@@ -89,8 +89,8 @@ export declare class UnmutexedOverlayFS extends FileSystem {
|
|
|
89
89
|
private copyToWritable;
|
|
90
90
|
}
|
|
91
91
|
declare const OverlayFS_base: {
|
|
92
|
-
new (): import("../mixins/mutexed.js").
|
|
93
|
-
} & (new (args_0: OverlayOptions) => import("../mixins/mutexed.js").
|
|
92
|
+
new (): import("../mixins/mutexed.js")._MutexedFS<UnmutexedOverlayFS>;
|
|
93
|
+
} & (new (args_0: OverlayOptions) => import("../mixins/mutexed.js")._MutexedFS<UnmutexedOverlayFS>);
|
|
94
94
|
/**
|
|
95
95
|
* OverlayFS makes a read-only filesystem writable by storing writes on a second,
|
|
96
96
|
* writable file system. Deletes are persisted via metadata stored on the writable
|
package/dist/mixins/mutexed.d.ts
CHANGED
|
@@ -16,7 +16,7 @@ export declare class MutexLock {
|
|
|
16
16
|
/**
|
|
17
17
|
* @hidden
|
|
18
18
|
*/
|
|
19
|
-
export declare class
|
|
19
|
+
export declare class _MutexedFS<T extends FileSystem> implements FileSystem {
|
|
20
20
|
/**
|
|
21
21
|
* @internal
|
|
22
22
|
*/
|
|
@@ -90,6 +90,6 @@ export declare class __MutexedFS<T extends FileSystem> implements FileSystem {
|
|
|
90
90
|
* @todo Change `using _` to `using void` pending https://github.com/tc39/proposal-discard-binding
|
|
91
91
|
* @internal
|
|
92
92
|
*/
|
|
93
|
-
export declare function Mutexed<const T extends Concrete<typeof FileSystem>>(FS: T): typeof
|
|
94
|
-
new (...args: ConstructorParameters<T>):
|
|
93
|
+
export declare function Mutexed<const T extends Concrete<typeof FileSystem>>(FS: T): typeof _MutexedFS<InstanceType<T>> & {
|
|
94
|
+
new (...args: ConstructorParameters<T>): _MutexedFS<InstanceType<T>>;
|
|
95
95
|
};
|
package/dist/mixins/mutexed.js
CHANGED
|
@@ -69,7 +69,7 @@ export class MutexLock {
|
|
|
69
69
|
/**
|
|
70
70
|
* @hidden
|
|
71
71
|
*/
|
|
72
|
-
export class
|
|
72
|
+
export class _MutexedFS {
|
|
73
73
|
async ready() {
|
|
74
74
|
return await this._fs.ready();
|
|
75
75
|
}
|
|
@@ -109,7 +109,7 @@ export class __MutexedFS {
|
|
|
109
109
|
* @internal
|
|
110
110
|
*/
|
|
111
111
|
lockSync(path, syscall) {
|
|
112
|
-
if (this.currentLock) {
|
|
112
|
+
if (this.currentLock?.isLocked) {
|
|
113
113
|
throw ErrnoError.With('EBUSY', path, syscall);
|
|
114
114
|
}
|
|
115
115
|
return this.addLock();
|
|
@@ -459,7 +459,7 @@ export class __MutexedFS {
|
|
|
459
459
|
* @internal
|
|
460
460
|
*/
|
|
461
461
|
export function Mutexed(FS) {
|
|
462
|
-
class MutexedFS extends
|
|
462
|
+
class MutexedFS extends _MutexedFS {
|
|
463
463
|
constructor(...args) {
|
|
464
464
|
super();
|
|
465
465
|
this._fs = new FS(...args);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zenfs/core",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.9",
|
|
4
4
|
"description": "A filesystem, anywhere",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -41,6 +41,7 @@
|
|
|
41
41
|
"./*": "./dist/*",
|
|
42
42
|
"./promises": "./dist/emulation/promises.js",
|
|
43
43
|
"./mixins": "./dist/mixins/index.js",
|
|
44
|
+
"./path": "./dist/emulation/path.js",
|
|
44
45
|
"./eslint": "./eslint.shared.js"
|
|
45
46
|
},
|
|
46
47
|
"scripts": {
|
package/src/mixins/mutexed.ts
CHANGED
|
@@ -33,7 +33,7 @@ export class MutexLock {
|
|
|
33
33
|
/**
|
|
34
34
|
* @hidden
|
|
35
35
|
*/
|
|
36
|
-
export class
|
|
36
|
+
export class _MutexedFS<T extends FileSystem> implements FileSystem {
|
|
37
37
|
/**
|
|
38
38
|
* @internal
|
|
39
39
|
*/
|
|
@@ -87,7 +87,7 @@ export class __MutexedFS<T extends FileSystem> implements FileSystem {
|
|
|
87
87
|
* @internal
|
|
88
88
|
*/
|
|
89
89
|
public lockSync(path: string, syscall: string): MutexLock {
|
|
90
|
-
if (this.currentLock) {
|
|
90
|
+
if (this.currentLock?.isLocked) {
|
|
91
91
|
throw ErrnoError.With('EBUSY', path, syscall);
|
|
92
92
|
}
|
|
93
93
|
|
|
@@ -244,10 +244,10 @@ export class __MutexedFS<T extends FileSystem> implements FileSystem {
|
|
|
244
244
|
*/
|
|
245
245
|
export function Mutexed<const T extends Concrete<typeof FileSystem>>(
|
|
246
246
|
FS: T
|
|
247
|
-
): typeof
|
|
248
|
-
new (...args: ConstructorParameters<T>):
|
|
247
|
+
): typeof _MutexedFS<InstanceType<T>> & {
|
|
248
|
+
new (...args: ConstructorParameters<T>): _MutexedFS<InstanceType<T>>;
|
|
249
249
|
} {
|
|
250
|
-
class MutexedFS extends
|
|
250
|
+
class MutexedFS extends _MutexedFS<InstanceType<T>> {
|
|
251
251
|
public constructor(...args: ConstructorParameters<T>) {
|
|
252
252
|
super();
|
|
253
253
|
this._fs = new FS(...args) as InstanceType<T>;
|