MCPcopy Create free account
hub / github.com/acoyfellow/cloudbox / validPath

Function validPath

src/computer-do.ts:479–484  ·  view source on GitHub ↗
(path: string)

Source from the content-addressed store, hash-verified

477}
478
479function validPath(path: string): boolean {
480 if (typeof path !== "string") return false;
481 if (path.length < 1 || path.length > 240) return false;
482 if (path.startsWith("/") || path.includes("\0")) return false;
483 return !path.split("/").some((part) => part === "" || part === "." || part === "..");
484}

Callers 3

readMethod · 0.85
writeMethod · 0.85
validateSpecFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected