@zenfs/core 0.3.3 → 0.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.
- package/dist/FileIndex.d.ts +9 -7
- package/dist/FileIndex.js +9 -9
- package/dist/browser.min.js +3 -3
- package/dist/browser.min.js.map +3 -3
- package/package.json +1 -1
- package/readme.md +1 -1
package/dist/FileIndex.d.ts
CHANGED
|
@@ -179,10 +179,10 @@ export declare abstract class FileIndexFS<TIndex> extends FileIndexFS_base {
|
|
|
179
179
|
openFileSync(path: string, flag: FileFlag, cred: Cred): NoSyncFile<this>;
|
|
180
180
|
readdir(path: string): Promise<string[]>;
|
|
181
181
|
readdirSync(path: string): string[];
|
|
182
|
-
protected abstract statFileInode(inode: IndexFileInode<TIndex
|
|
183
|
-
protected abstract statFileInodeSync(inode: IndexFileInode<TIndex
|
|
184
|
-
protected abstract
|
|
185
|
-
protected abstract
|
|
182
|
+
protected abstract statFileInode(inode: IndexFileInode<TIndex>, path: string): Promise<Stats>;
|
|
183
|
+
protected abstract statFileInodeSync(inode: IndexFileInode<TIndex>, path: string): Stats;
|
|
184
|
+
protected abstract openFileInode(inode: IndexFileInode<TIndex>, path: string, flag: FileFlag): Promise<NoSyncFile<this>>;
|
|
185
|
+
protected abstract openFileInodeSync(inode: IndexFileInode<TIndex>, path: string, flag: FileFlag): NoSyncFile<this>;
|
|
186
186
|
}
|
|
187
187
|
declare const SyncFileIndexFS_base: (abstract new (...args: any[]) => {
|
|
188
188
|
metadata(): import("./filesystem.js").FileSystemMetadata;
|
|
@@ -211,8 +211,9 @@ declare const SyncFileIndexFS_base: (abstract new (...args: any[]) => {
|
|
|
211
211
|
syncSync(path: string, data: Uint8Array, stats: Readonly<Stats>): void;
|
|
212
212
|
}) & (abstract new (index: ListingTree) => FileIndexFS<unknown>);
|
|
213
213
|
export declare abstract class SyncFileIndexFS<TIndex> extends SyncFileIndexFS_base {
|
|
214
|
-
|
|
215
|
-
protected
|
|
214
|
+
_index: FileIndex<TIndex>;
|
|
215
|
+
protected statFileInode(inode: IndexFileInode<TIndex>, path: string): Promise<Stats>;
|
|
216
|
+
protected openFileInode(inode: IndexFileInode<TIndex>, path: string, flag: FileFlag): Promise<NoSyncFile<this>>;
|
|
216
217
|
}
|
|
217
218
|
declare const AsyncFileIndexFS_base: (abstract new (...args: any[]) => {
|
|
218
219
|
metadata(): import("./filesystem.js").FileSystemMetadata;
|
|
@@ -228,7 +229,8 @@ declare const AsyncFileIndexFS_base: (abstract new (...args: any[]) => {
|
|
|
228
229
|
syncSync(path: string, data: Uint8Array, stats: Readonly<Stats>): void;
|
|
229
230
|
}) & (abstract new (index: ListingTree) => FileIndexFS<unknown>);
|
|
230
231
|
export declare abstract class AsyncFileIndexFS<TIndex> extends AsyncFileIndexFS_base {
|
|
232
|
+
_index: FileIndex<TIndex>;
|
|
231
233
|
protected statFileInodeSync(): Stats;
|
|
232
|
-
protected
|
|
234
|
+
protected openFileInodeSync(): NoSyncFile<this>;
|
|
233
235
|
}
|
|
234
236
|
export {};
|
package/dist/FileIndex.js
CHANGED
|
@@ -312,7 +312,7 @@ export class FileIndexFS extends Readonly(FileSystem) {
|
|
|
312
312
|
return inode.stats;
|
|
313
313
|
}
|
|
314
314
|
if (inode.isFile()) {
|
|
315
|
-
return this.statFileInode(inode);
|
|
315
|
+
return this.statFileInode(inode, path);
|
|
316
316
|
}
|
|
317
317
|
throw new ApiError(ErrorCode.EINVAL, 'Invalid inode.');
|
|
318
318
|
}
|
|
@@ -325,7 +325,7 @@ export class FileIndexFS extends Readonly(FileSystem) {
|
|
|
325
325
|
return inode.stats;
|
|
326
326
|
}
|
|
327
327
|
if (inode.isFile()) {
|
|
328
|
-
return this.statFileInodeSync(inode);
|
|
328
|
+
return this.statFileInodeSync(inode, path);
|
|
329
329
|
}
|
|
330
330
|
throw new ApiError(ErrorCode.EINVAL, 'Invalid inode.');
|
|
331
331
|
}
|
|
@@ -346,7 +346,7 @@ export class FileIndexFS extends Readonly(FileSystem) {
|
|
|
346
346
|
const stats = inode.stats;
|
|
347
347
|
return new NoSyncFile(this, path, flag, stats, stats.fileData);
|
|
348
348
|
}
|
|
349
|
-
return this.
|
|
349
|
+
return this.openFileInode(inode, path, flag);
|
|
350
350
|
}
|
|
351
351
|
openFileSync(path, flag, cred) {
|
|
352
352
|
if (flag.isWriteable()) {
|
|
@@ -365,7 +365,7 @@ export class FileIndexFS extends Readonly(FileSystem) {
|
|
|
365
365
|
const stats = inode.stats;
|
|
366
366
|
return new NoSyncFile(this, path, flag, stats, stats.fileData);
|
|
367
367
|
}
|
|
368
|
-
return this.
|
|
368
|
+
return this.openFileInodeSync(inode, path, flag);
|
|
369
369
|
}
|
|
370
370
|
async readdir(path) {
|
|
371
371
|
// Check if it exists.
|
|
@@ -391,18 +391,18 @@ export class FileIndexFS extends Readonly(FileSystem) {
|
|
|
391
391
|
}
|
|
392
392
|
}
|
|
393
393
|
export class SyncFileIndexFS extends Sync((FileIndexFS)) {
|
|
394
|
-
async statFileInode(inode) {
|
|
395
|
-
return this.statFileInodeSync(inode);
|
|
394
|
+
async statFileInode(inode, path) {
|
|
395
|
+
return this.statFileInodeSync(inode, path);
|
|
396
396
|
}
|
|
397
|
-
async
|
|
398
|
-
return this.
|
|
397
|
+
async openFileInode(inode, path, flag) {
|
|
398
|
+
return this.openFileInodeSync(inode, path, flag);
|
|
399
399
|
}
|
|
400
400
|
}
|
|
401
401
|
export class AsyncFileIndexFS extends Async((FileIndexFS)) {
|
|
402
402
|
statFileInodeSync() {
|
|
403
403
|
throw new ApiError(ErrorCode.ENOTSUP);
|
|
404
404
|
}
|
|
405
|
-
|
|
405
|
+
openFileInodeSync() {
|
|
406
406
|
throw new ApiError(ErrorCode.ENOTSUP);
|
|
407
407
|
}
|
|
408
408
|
}
|