@zenfs/core 2.3.3 → 2.3.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.
|
@@ -33,7 +33,15 @@ export declare class PassthroughFS extends FileSystem {
|
|
|
33
33
|
* Get file statistics synchronously.
|
|
34
34
|
*/
|
|
35
35
|
statSync(path: string): InodeLike;
|
|
36
|
+
/**
|
|
37
|
+
* @privateRemarks
|
|
38
|
+
* Timestamps should be updated by the underlying file system.
|
|
39
|
+
*/
|
|
36
40
|
touch(path: string, metadata: InodeLike): Promise<void>;
|
|
41
|
+
/**
|
|
42
|
+
* @privateRemarks
|
|
43
|
+
* Timestamps should be updated by the underlying file system.
|
|
44
|
+
*/
|
|
37
45
|
touchSync(path: string, metadata: InodeLike): void;
|
|
38
46
|
/**
|
|
39
47
|
* Unlink (delete) a file.
|
|
@@ -50,7 +50,7 @@ var __disposeResources = (this && this.__disposeResources) || (function (Suppres
|
|
|
50
50
|
var e = new Error(message);
|
|
51
51
|
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
52
52
|
});
|
|
53
|
-
import { warn } from 'kerium/log';
|
|
53
|
+
import { err, warn } from 'kerium/log';
|
|
54
54
|
import { FileSystem } from '../internal/filesystem.js';
|
|
55
55
|
import { isDirectory } from '../internal/inode.js';
|
|
56
56
|
import { resolve } from '../path.js';
|
|
@@ -96,13 +96,21 @@ export class PassthroughFS extends FileSystem {
|
|
|
96
96
|
statSync(path) {
|
|
97
97
|
return this.nodeFS.statSync(this.path(path));
|
|
98
98
|
}
|
|
99
|
+
/**
|
|
100
|
+
* @privateRemarks
|
|
101
|
+
* Timestamps should be updated by the underlying file system.
|
|
102
|
+
*/
|
|
99
103
|
async touch(path, metadata) {
|
|
100
104
|
const env_1 = { stack: [], error: void 0, hasError: false };
|
|
101
105
|
try {
|
|
102
|
-
const handle = __addDisposableResource(env_1, await this.nodeFS.promises.open(this.path(path), '
|
|
106
|
+
const handle = __addDisposableResource(env_1, await this.nodeFS.promises.open(this.path(path), 'r'), true);
|
|
103
107
|
await handle.chmod(metadata.mode);
|
|
104
|
-
|
|
105
|
-
|
|
108
|
+
try {
|
|
109
|
+
await handle.chown(metadata.uid, metadata.gid);
|
|
110
|
+
}
|
|
111
|
+
catch (error) {
|
|
112
|
+
err('Failed to chown passthrough file: ' + error.message);
|
|
113
|
+
}
|
|
106
114
|
}
|
|
107
115
|
catch (e_1) {
|
|
108
116
|
env_1.error = e_1;
|
|
@@ -114,10 +122,18 @@ export class PassthroughFS extends FileSystem {
|
|
|
114
122
|
await result_1;
|
|
115
123
|
}
|
|
116
124
|
}
|
|
125
|
+
/**
|
|
126
|
+
* @privateRemarks
|
|
127
|
+
* Timestamps should be updated by the underlying file system.
|
|
128
|
+
*/
|
|
117
129
|
touchSync(path, metadata) {
|
|
118
130
|
this.nodeFS.chmodSync(this.path(path), metadata.mode);
|
|
119
|
-
|
|
120
|
-
|
|
131
|
+
try {
|
|
132
|
+
this.nodeFS.chownSync(this.path(path), metadata.uid, metadata.gid);
|
|
133
|
+
}
|
|
134
|
+
catch (error) {
|
|
135
|
+
err('Failed to chown passthrough file: ' + error.message);
|
|
136
|
+
}
|
|
121
137
|
}
|
|
122
138
|
/**
|
|
123
139
|
* Unlink (delete) a file.
|
package/dist/readline.d.ts
CHANGED
|
@@ -84,7 +84,7 @@ export declare class Interface extends EventEmitter<InterfaceEvents> implements
|
|
|
84
84
|
* Gets the maximum number of listeners
|
|
85
85
|
*/
|
|
86
86
|
getMaxListeners(): number;
|
|
87
|
-
[Symbol.asyncIterator](): AsyncIteratorObject<string>;
|
|
87
|
+
[Symbol.asyncIterator](): AsyncIteratorObject<string, undefined>;
|
|
88
88
|
[Symbol.dispose](): void;
|
|
89
89
|
[Symbol.asyncDispose](): Promise<void>;
|
|
90
90
|
rawListeners(event: keyof InterfaceEvents): ((...args: any[]) => void)[];
|
package/dist/vfs/async.d.ts
CHANGED
|
@@ -271,8 +271,8 @@ type GlobCallback<Args extends unknown[]> = (e: Exception | null, ...args: Args)
|
|
|
271
271
|
/**
|
|
272
272
|
* Retrieves the files matching the specified pattern.
|
|
273
273
|
*/
|
|
274
|
-
export declare function glob(this: V_Context, pattern: string | string[], callback: GlobCallback<[string[]]>): void;
|
|
275
|
-
export declare function glob(this: V_Context, pattern: string | string[], options: fs.GlobOptionsWithFileTypes, callback: GlobCallback<[Dirent[]]>): void;
|
|
276
|
-
export declare function glob(this: V_Context, pattern: string | string[], options: fs.GlobOptionsWithoutFileTypes, callback: GlobCallback<[string[]]>): void;
|
|
277
|
-
export declare function glob(this: V_Context, pattern: string | string[], options: fs.GlobOptions, callback: GlobCallback<[Dirent[] | string[]]>): void;
|
|
274
|
+
export declare function glob(this: V_Context, pattern: string | readonly string[], callback: GlobCallback<[string[]]>): void;
|
|
275
|
+
export declare function glob(this: V_Context, pattern: string | readonly string[], options: fs.GlobOptionsWithFileTypes, callback: GlobCallback<[Dirent[]]>): void;
|
|
276
|
+
export declare function glob(this: V_Context, pattern: string | readonly string[], options: fs.GlobOptionsWithoutFileTypes, callback: GlobCallback<[string[]]>): void;
|
|
277
|
+
export declare function glob(this: V_Context, pattern: string | readonly string[], options: fs.GlobOptions, callback: GlobCallback<[Dirent[] | string[]]>): void;
|
|
278
278
|
export {};
|
package/dist/vfs/promises.d.ts
CHANGED
|
@@ -419,7 +419,7 @@ export declare function statfs(this: V_Context, path: fs.PathLike, opts?: fs.Sta
|
|
|
419
419
|
/**
|
|
420
420
|
* Retrieves the files matching the specified pattern.
|
|
421
421
|
*/
|
|
422
|
-
export declare function glob(this: V_Context, pattern: string | string[]): NodeJS.AsyncIterator<string>;
|
|
423
|
-
export declare function glob(this: V_Context, pattern: string | string[], opt: fs.GlobOptionsWithFileTypes): NodeJS.AsyncIterator<Dirent>;
|
|
424
|
-
export declare function glob(this: V_Context, pattern: string | string[], opt: fs.GlobOptionsWithoutFileTypes): NodeJS.AsyncIterator<string>;
|
|
425
|
-
export declare function glob(this: V_Context, pattern: string | string[], opt: fs.GlobOptions): NodeJS.AsyncIterator<Dirent | string>;
|
|
422
|
+
export declare function glob(this: V_Context, pattern: string | readonly string[]): NodeJS.AsyncIterator<string>;
|
|
423
|
+
export declare function glob(this: V_Context, pattern: string | readonly string[], opt: fs.GlobOptionsWithFileTypes): NodeJS.AsyncIterator<Dirent>;
|
|
424
|
+
export declare function glob(this: V_Context, pattern: string | readonly string[], opt: fs.GlobOptionsWithoutFileTypes): NodeJS.AsyncIterator<string>;
|
|
425
|
+
export declare function glob(this: V_Context, pattern: string | readonly string[], opt: fs.GlobOptions): NodeJS.AsyncIterator<Dirent | string>;
|
package/dist/vfs/promises.js
CHANGED
|
@@ -273,7 +273,7 @@ export class FileHandle {
|
|
|
273
273
|
const pos = Number.isSafeInteger(position) ? position : this.position;
|
|
274
274
|
buffer ||= new Uint8Array(this.inode.size);
|
|
275
275
|
offset ??= 0;
|
|
276
|
-
return this._read(buffer, offset, length ?? buffer.byteLength - offset, pos);
|
|
276
|
+
return this._read(buffer, offset, length ?? buffer.byteLength - offset, pos ? Number(pos) : undefined);
|
|
277
277
|
}
|
|
278
278
|
async readFile(_options) {
|
|
279
279
|
const options = normalizeOptions(_options, null, 'r', 0o444);
|
package/dist/vfs/sync.d.ts
CHANGED
|
@@ -233,7 +233,7 @@ export declare function statfsSync(this: V_Context, path: fs.PathLike, options?:
|
|
|
233
233
|
/**
|
|
234
234
|
* Retrieves the files matching the specified pattern.
|
|
235
235
|
*/
|
|
236
|
-
export declare function globSync(pattern: string | string[]): string[];
|
|
237
|
-
export declare function globSync(pattern: string | string[], options: fs.GlobOptionsWithFileTypes): Dirent[];
|
|
238
|
-
export declare function globSync(pattern: string | string[], options: fs.GlobOptionsWithoutFileTypes): string[];
|
|
239
|
-
export declare function globSync(pattern: string | string[], options: fs.GlobOptions): Dirent[] | string[];
|
|
236
|
+
export declare function globSync(pattern: string | readonly string[]): string[];
|
|
237
|
+
export declare function globSync(pattern: string | readonly string[], options: fs.GlobOptionsWithFileTypes): Dirent[];
|
|
238
|
+
export declare function globSync(pattern: string | readonly string[], options: fs.GlobOptionsWithoutFileTypes): string[];
|
|
239
|
+
export declare function globSync(pattern: string | readonly string[], options: fs.GlobOptions): Dirent[] | string[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zenfs/core",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.5",
|
|
4
4
|
"description": "A filesystem, anywhere",
|
|
5
5
|
"funding": {
|
|
6
6
|
"type": "individual",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"eslint.shared.js"
|
|
27
27
|
],
|
|
28
28
|
"type": "module",
|
|
29
|
-
"homepage": "https://
|
|
29
|
+
"homepage": "https://zenfs.dev/core",
|
|
30
30
|
"author": "James Prevett <jp@jamespre.dev> (https://jamespre.dev)",
|
|
31
31
|
"contributors": [
|
|
32
32
|
"John Vilk <jvilk@cs.umass.edu>"
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"prepublishOnly": "npm run build"
|
|
68
68
|
},
|
|
69
69
|
"dependencies": {
|
|
70
|
-
"@types/node": "^
|
|
70
|
+
"@types/node": "^24.0.13",
|
|
71
71
|
"buffer": "^6.0.3",
|
|
72
72
|
"eventemitter3": "^5.0.1",
|
|
73
73
|
"kerium": "^1.3.4",
|