(filePath: string)
| 563 | * case-insensitive comparison. |
| 564 | */ |
| 565 | export function normalizePathForComparison(filePath: string): string { |
| 566 | // Use path.normalize() to clean up redundant separators and resolve . and .. |
| 567 | let normalized = normalize(filePath) |
| 568 | |
| 569 | // Convert separators to a stable slash form so comparison behavior stays |
| 570 | // consistent across platforms and in tests that use POSIX-style fixtures. |
| 571 | normalized = normalized.replace(/\\/g, '/') |
| 572 | |
| 573 | // On Windows, normalize case for case-insensitive comparison. |
| 574 | if (getPlatform() === 'windows') { |
| 575 | normalized = normalized.toLowerCase() |
| 576 | } |
| 577 | |
| 578 | return normalized |
| 579 | } |
| 580 | |
| 581 | /** |
| 582 | * Compare two file paths for equality, handling Windows case-insensitivity. |
no test coverage detected