( projectRoot: string, filePath: string, )
| 14 | } |
| 15 | |
| 16 | export function resolveFilePathWithinProject( |
| 17 | projectRoot: string, |
| 18 | filePath: string, |
| 19 | ): ResolvedProjectPath | null { |
| 20 | const resolvedRoot = path.resolve(projectRoot) |
| 21 | const fullPath = path.isAbsolute(filePath) |
| 22 | ? path.resolve(filePath) |
| 23 | : path.resolve(resolvedRoot, filePath) |
| 24 | const relativePath = path.relative(resolvedRoot, fullPath) |
| 25 | |
| 26 | if (relativePath === '' || escapesProject(relativePath)) { |
| 27 | return null |
| 28 | } |
| 29 | |
| 30 | return { fullPath, relativePath } |
| 31 | } |
| 32 | |
| 33 | export function getProjectPathLookupKeys( |
| 34 | projectRoot: string, |
no test coverage detected