(p: string)
| 151 | } |
| 152 | |
| 153 | export function windowsPath(p: string): string { |
| 154 | if (process.platform !== "win32") return p |
| 155 | return ( |
| 156 | p |
| 157 | .replace(/^\/([a-zA-Z]):(?:[\\/]|$)/, (_, drive) => `${drive.toUpperCase()}:/`) |
| 158 | // Git Bash for Windows paths are typically /<drive>/... |
| 159 | .replace(/^\/([a-zA-Z])(?:\/|$)/, (_, drive) => `${drive.toUpperCase()}:/`) |
| 160 | // Cygwin git paths are typically /cygdrive/<drive>/... |
| 161 | .replace(/^\/cygdrive\/([a-zA-Z])(?:\/|$)/, (_, drive) => `${drive.toUpperCase()}:/`) |
| 162 | // WSL paths are typically /mnt/<drive>/... |
| 163 | .replace(/^\/mnt\/([a-zA-Z])(?:\/|$)/, (_, drive) => `${drive.toUpperCase()}:/`) |
| 164 | ) |
| 165 | } |
| 166 | export function overlaps(a: string, b: string) { |
| 167 | return FSUtil.overlaps(a, b) |
| 168 | } |
no outgoing calls
no test coverage detected