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

Function normalizePathForComparison

src/utils/file.ts:565–577  ·  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 // On Windows, normalize for case-insensitive comparison:
570 // - Convert forward slashes to backslashes (path.normalize only does this on actual Windows)
571 // - Convert to lowercase (Windows paths are case-insensitive)
572 if (getPlatform() === 'windows') {
573 normalized = normalized.replace(/\//g, '\\').toLowerCase()
574 }
575
576 return normalized
577}
578
579/**
580 * Compare two file paths for equality, handling Windows case-insensitivity.

Callers 7

processMemoryFileFunction · 0.85
claudemd.tsFile · 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