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

Function dirname

packages/computer/src/workspace.ts:1265–1269  ·  view source on GitHub ↗
(path: string)

Source from the content-addressed store, hash-verified

1263}
1264
1265function dirname(path: string): string {
1266 const index = path.lastIndexOf("/");
1267 if (index <= 0) return "/";
1268 return path.slice(0, index);
1269}
1270
1271function basename(path: string): string {
1272 const trimmed = path.endsWith("/") && path !== "/" ? path.slice(0, -1) : path;

Callers 11

splitGlobPatternFunction · 0.70
syncVfsPathToDiskFunction · 0.50
createFileLoggerFunction · 0.50
build-docker.mjsFile · 0.50
build-bin.mjsFile · 0.50
build.mjsFile · 0.50
bundle.mjsFile · 0.50
computerd-soak.mjsFile · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected