MCPcopy
hub / github.com/claude-code-best/claude-code / normalizePathForComparison

Function normalizePathForComparison

src/utils/file.ts:565–579  ·  view source on GitHub ↗
(filePath: string)

Source from the content-addressed store, hash-verified

563 * case-insensitive comparison.
564 */
565export 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.

Callers 9

file.test.tsFile · 0.90
processMemoryFileFunction · 0.85
claudemd.tsFile · 0.85
isMemoryFilePathFunction · 0.85
resolveStopBoundaryFunction · 0.85
getProjectDirsUpToHomeFunction · 0.85
pathsEqualFunction · 0.85
normalizeFileUriMethod · 0.85

Calls 2

getPlatformFunction · 0.85
normalizeFunction · 0.50

Tested by

no test coverage detected