(path: Path)
| 288 | }; |
| 289 | |
| 290 | export function asWindowsPath(path: Path): WindowsPath { |
| 291 | const drive = path.match(/^\/(\w)(?:\/(.*))?$/); |
| 292 | if (drive) { |
| 293 | const subPath = drive[2] ? drive[2].replace(/\//g, '\\') : ''; |
| 294 | |
| 295 | return `${drive[1]}:\\${subPath}` as WindowsPath; |
| 296 | } |
| 297 | |
| 298 | return path.replace(/\//g, '\\') as WindowsPath; |
| 299 | } |
| 300 | |
| 301 | export function asPosixPath(path: Path): PosixPath { |
| 302 | return path as string as PosixPath; |
no test coverage detected