MCPcopy Create free account
hub / github.com/AnukarOP/claude-code-leaked / normalizePathForComparison

Function normalizePathForComparison

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

Source from the content-addressed store, hash-verified

565 * case-insensitive comparison.
566 */
567export function normalizePathForComparison(filePath: string): string {
568 // Use path.normalize() to clean up redundant separators and resolve . and ..
569 let normalized = normalize(filePath)
570
571 // On Windows, normalize for case-insensitive comparison:
572 // - Convert forward slashes to backslashes (path.normalize only does this on actual Windows)
573 // - Convert to lowercase (Windows paths are case-insensitive)
574 if (getPlatform() === 'windows') {
575 normalized = normalized.replace(/\//g, '\\').toLowerCase()
576 }
577
578 return normalized
579}
580
581/**
582 * 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