MCPcopy Index your code
hub / github.com/BuilderIO/agent-native / isValidPath

Function isValidPath

packages/core/src/scripts/utils.ts:62–69  ·  view source on GitHub ↗
(p: string)

Source from the content-addressed store, hash-verified

60 * Validate a relative file path (no traversal, no absolute).
61 */
62export function isValidPath(p: string): boolean {
63 const normalized = path.normalize(p);
64 return (
65 !normalized.startsWith("..") &&
66 !path.isAbsolute(normalized) &&
67 !p.includes("\0")
68 );
69}
70
71/**
72 * Validate a project slug (e.g. "my-project" or "group/my-project").

Callers 1

utils.spec.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected