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

Function dirname

packages/shell/src/workspace.ts:210–215  ·  view source on GitHub ↗
(path: string)

Source from the content-addressed store, hash-verified

208}
209
210function dirname(path: string): string {
211 const normalized = normalizePath(path);
212 if (normalized === "/") return "/";
213 const lastSlash = normalized.lastIndexOf("/");
214 return lastSlash <= 0 ? "/" : normalized.slice(0, lastSlash);
215}

Callers 5

realpathMethod · 0.70
build.tsFile · 0.50
checkPackageFunction · 0.50

Calls 1

normalizePathFunction · 0.70

Tested by

no test coverage detected