(path: string, rootDir: string)
| 64 | } |
| 65 | |
| 66 | function stripRootDir(path: string, rootDir: string): string { |
| 67 | const normalized = normalizePath(path) |
| 68 | const normalizedRootDir = normalizePath(rootDir) |
| 69 | if (!normalizedRootDir) |
| 70 | return normalized |
| 71 | if (normalized === normalizedRootDir) |
| 72 | return '' |
| 73 | if (normalized.startsWith(`${normalizedRootDir}/`)) |
| 74 | return normalized.slice(normalizedRootDir.length + 1) |
| 75 | return normalized |
| 76 | } |
| 77 | |
| 78 | function isInsideRoot(path: string, rootDir: string): boolean { |
| 79 | const normalized = normalizePath(path) |
no test coverage detected