MCPcopy Index your code
hub / github.com/jvilk/BrowserFS / readDirectory

Method readDirectory

src/generic/key_value_filesystem.ts:452–461  ·  view source on GitHub ↗
(inode: Inode)

Source from the content-addressed store, hash-verified

450 */
451 private _findINode(tx: SyncKeyValueROTransaction, parent: string, filename: string): string {
452 const readDirectory = (inode: Inode): string => {
453 // Get the root's directory listing.
454 const dirList = this.getDirListing(tx, parent, inode);
455 // Get the file's ID.
456 if (dirList[filename]) {
457 return dirList[filename];
458 } else {
459 throw ApiError.ENOENT(path.resolve(parent, filename));
460 }
461 };
462 if (parent === '/') {
463 if (filename === '') {
464 // BASE CASE #1: Return the root's ID.

Callers

nothing calls this directly

Calls 2

getDirListingMethod · 0.95
ENOENTMethod · 0.80

Tested by

no test coverage detected