MCPcopy Create free account
hub / github.com/Snapchat/Valdi / parentDir

Function parentDir

src/valdi_modules/src/valdi/file_system/web/FileSystem.ts:37–41  ·  view source on GitHub ↗
(p: string)

Source from the content-addressed store, hash-verified

35 return ROOT + stack.join("/");
36}
37function parentDir(p: string): string {
38 if (p === ROOT) return ROOT;
39 const idx = p.lastIndexOf("/");
40 return idx > 0 ? p.slice(0, idx) : ROOT;
41}
42
43/* -------- in-memory FS state -------- */
44

Callers 2

createDirectorySyncFunction · 0.85
writeFileSyncFunction · 0.85

Calls 1

lastIndexOfMethod · 0.80

Tested by

no test coverage detected