(fromPath: string, toPath: string)
| 122 | * Resolves path segments properly based on whether they appear to be c:/ -style or / style. |
| 123 | */ |
| 124 | export function properRelative(fromPath: string, toPath: string): string { |
| 125 | if (path.posix.isAbsolute(fromPath)) { |
| 126 | return path.posix.relative(fromPath, toPath); |
| 127 | } else if (path.win32.isAbsolute(fromPath)) { |
| 128 | return path.win32.relative(fromPath, toPath); |
| 129 | } else { |
| 130 | return path.relative(fromPath, toPath); |
| 131 | } |
| 132 | } |
| 133 | |
| 134 | export function fixDriveLetter(aPath: string, uppercaseDriveLetter = false): string { |
| 135 | if (!aPath) return aPath; |
no test coverage detected