(projectDir: string, candidate: string)
| 117 | } |
| 118 | |
| 119 | function isWithinProjectRoot(projectDir: string, candidate: string): boolean { |
| 120 | const projectRoot = resolve(projectDir); |
| 121 | const relativePath = relative(projectRoot, candidate); |
| 122 | return relativePath === "" || (!relativePath.startsWith("..") && !isAbsolute(relativePath)); |
| 123 | } |
| 124 | |
| 125 | function addCandidate(candidates: string[], candidate: string): void { |
| 126 | if (!candidates.includes(candidate)) candidates.push(candidate); |
no test coverage detected