( rootPath: string | undefined, sourceUrl: string, )
| 355 | } |
| 356 | |
| 357 | export function maybeAbsolutePathToFileUrl( |
| 358 | rootPath: string | undefined, |
| 359 | sourceUrl: string, |
| 360 | ): string { |
| 361 | if ( |
| 362 | rootPath && |
| 363 | platformPathToPreferredCase(sourceUrl).startsWith(rootPath) && |
| 364 | !isValidUrl(sourceUrl) |
| 365 | ) |
| 366 | return absolutePathToFileUrl(sourceUrl); |
| 367 | return sourceUrl; |
| 368 | } |
| 369 | |
| 370 | export function urlPathToPlatformPath(p: string): string { |
| 371 | if (process.platform === 'win32') { |
nothing calls this directly
no test coverage detected