(dir: string, projectRoot: string, userHomeDir: string)
| 470 | } |
| 471 | |
| 472 | function resolveConfiguredDir(dir: string, projectRoot: string, userHomeDir: string): string { |
| 473 | if (dir === '~') return userHomeDir; |
| 474 | if (dir.startsWith('~/')) return path.join(userHomeDir, dir.slice(2)); |
| 475 | if (path.isAbsolute(dir)) return dir; |
| 476 | return path.resolve(projectRoot, dir); |
| 477 | } |
| 478 | |
| 479 | function isWithin(child: string, parent: string): boolean { |
| 480 | const relative = path.relative(parent, child); |
no test coverage detected