(path1?: string, path2?: string)
| 19 | * - Case sensitivity (case-insensitive on Windows/macOS) |
| 20 | */ |
| 21 | export function arePathsEqual(path1?: string, path2?: string): boolean { |
| 22 | if (!path1 || !path2) { |
| 23 | return false |
| 24 | } |
| 25 | |
| 26 | const normalizedPath1 = normalizePath(path1) |
| 27 | const normalizedPath2 = normalizePath(path2) |
| 28 | |
| 29 | // On Windows and macOS, file paths are case-insensitive |
| 30 | if (process.platform === "win32" || process.platform === "darwin") { |
| 31 | return normalizedPath1.toLowerCase() === normalizedPath2.toLowerCase() |
| 32 | } |
| 33 | |
| 34 | return normalizedPath1 === normalizedPath2 |
| 35 | } |
no test coverage detected