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

Function validatePath

packages/shell/src/fs/path-utils.ts:36–40  ·  view source on GitHub ↗
(path: string, operation: string)

Source from the content-addressed store, hash-verified

34}
35
36export function validatePath(path: string, operation: string): void {
37 if (path.includes("\0")) {
38 throw new Error(`ENOENT: path contains null byte, ${operation} '${path}'`);
39 }
40}
41
42export function dirname(path: string): string {
43 const normalized = normalizePath(path);

Callers 15

mkdirSyncMethod · 0.90
readFileBytesMethod · 0.90
appendFileMethod · 0.90
statMethod · 0.90
lstatMethod · 0.90
readdirWithFileTypesMethod · 0.90
rmMethod · 0.90
cpMethod · 0.90
symlinkMethod · 0.90
linkMethod · 0.90
readlinkMethod · 0.90
realpathMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected