MCPcopy Create free account
hub / github.com/cloudflare/agents / getParent

Function getParent

packages/shell/src/filesystem.ts:1590–1595  ·  view source on GitHub ↗
(path: string)

Source from the content-addressed store, hash-verified

1588}
1589
1590function getParent(path: string): string {
1591 const normalized = normalizePath(path);
1592 if (normalized === "/") return "";
1593 const lastSlash = normalized.lastIndexOf("/");
1594 return lastSlash === 0 ? "/" : normalized.slice(0, lastSlash);
1595}
1596
1597function getBasename(path: string): string {
1598 const normalized = normalizePath(path);

Callers 7

resolveSymlinkMethod · 0.85
symlinkMethod · 0.85
writeFileBytesMethod · 0.85
writeFileMethod · 0.85
mkdirMethod · 0.85
mvMethod · 0.85
ensureParentDirMethod · 0.85

Calls 1

normalizePathFunction · 0.70

Tested by

no test coverage detected