MCPcopy Create free account
hub / github.com/experdot/pointer / validatePathSegment

Function validatePathSegment

src/main/attachmentStorage.ts:9–15  ·  view source on GitHub ↗
(segment: string, label: string)

Source from the content-addressed store, hash-verified

7} from './workspaceRuntime'
8
9function validatePathSegment(segment: string, label: string): string {
10 if (!segment || segment === '.' || segment === '..' || /[\\/]/.test(segment)) {
11 throw new Error(`Invalid ${label}`)
12 }
13
14 return segment
15}
16
17async function pathExists(targetPath: string): Promise<boolean> {
18 try {

Callers 2

buildStoredRelativePathFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected