(path: string)
| 9 | } |
| 10 | |
| 11 | export function expandHomePath(path: string): string { |
| 12 | if (path === "~") return homedir(); |
| 13 | if (path.startsWith("~/") || path.startsWith("~\\")) { |
| 14 | return resolve(homedir(), path.slice(2)); |
| 15 | } |
| 16 | |
| 17 | return path; |
| 18 | } |
| 19 | |
| 20 | export function isPathInsideRoot(path: string, root: string): boolean { |
| 21 | const resolvedPath = resolve(expandHomePath(path)); |
no outgoing calls
no test coverage detected