| 193 | uppercaseDriveLetter?: boolean, |
| 194 | ): string | undefined; |
| 195 | export function fixDriveLetterAndSlashes( |
| 196 | aPath: string | undefined, |
| 197 | uppercaseDriveLetter = false, |
| 198 | ): string | undefined { |
| 199 | if (!aPath) return aPath; |
| 200 | |
| 201 | aPath = fixDriveLetter(aPath, uppercaseDriveLetter); |
| 202 | if (isWindowsFileUri(aPath)) { |
| 203 | const prefixLen = fileUriPrefix.length; |
| 204 | aPath = aPath.substr(0, prefixLen + 1) + aPath.substr(prefixLen + 1).replace(/\//g, '\\'); |
| 205 | } else if (isWindowsPath(aPath)) { |
| 206 | aPath = aPath.replace(/\//g, '\\'); |
| 207 | } |
| 208 | |
| 209 | return aPath; |
| 210 | } |
| 211 | |
| 212 | /** |
| 213 | * Replace any backslashes with forward slashes |