(name: string, label: string)
| 13 | |
| 14 | /** Reject path segments that could escape the project root. */ |
| 15 | export function assertSafeSegment(name: string, label: string): void { |
| 16 | if (!name || name.includes('\0') || name.includes('..') || name.includes('/') || name.includes('\\')) { |
| 17 | throw new Error(`Invalid ${label}: ${name}`); |
| 18 | } |
| 19 | } |
| 20 | |
| 21 | async function allowedPatternIds(root: string): Promise<Set<string>> { |
| 22 | const registry = await loadRegistry(root); |
no outgoing calls
no test coverage detected