MCPcopy Create free account
hub / github.com/Zoo-Code-Org/Zoo-Code / arePathsEqual

Function arePathsEqual

src/utils/path.ts:56–71  ·  view source on GitHub ↗
(path1?: string, path2?: string)

Source from the content-addressed store, hash-verified

54
55// Safe path comparison that works across different platforms
56export function arePathsEqual(path1?: string, path2?: string): boolean {
57 if (!path1 && !path2) {
58 return true
59 }
60 if (!path1 || !path2) {
61 return false
62 }
63
64 path1 = normalizePath(path1)
65 path2 = normalizePath(path2)
66
67 if (process.platform === "win32") {
68 return path1.toLowerCase() === path2.toLowerCase()
69 }
70 return path1 === path2
71}
72
73function normalizePath(p: string): string {
74 // normalize resolve ./.. segments, removes duplicate slashes, and standardizes path separators

Callers 14

path.spec.tsFile · 0.90
getEnvironmentDetailsFunction · 0.90
initShadowGitFunction · 0.90
handleSpecialDirectoriesFunction · 0.90
watchMcpSettingsFileMethod · 0.90
getOrCreateTerminalMethod · 0.90
openMethod · 0.90
restorePreviewTabsMethod · 0.90
closeFileTabMethod · 0.90
openDiffEditorMethod · 0.90

Calls 1

normalizePathFunction · 0.70

Tested by

no test coverage detected