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

Function relativePath

src/utils/permissions/filesystem.ts:170–179  ·  view source on GitHub ↗
(from: string, to: string)

Source from the content-addressed store, hash-verified

168 * @returns A POSIX-style relative path
169 */
170export function relativePath(from: string, to: string): string {
171 if (getPlatform() === 'windows') {
172 // Convert Windows paths to POSIX for consistent comparison
173 const posixFrom = windowsPathToPosixPath(from)
174 const posixTo = windowsPathToPosixPath(to)
175 return posix.relative(posixFrom, posixTo)
176 }
177 // Use POSIX paths directly
178 return posix.relative(from, to)
179}
180
181/**
182 * Converts a path to POSIX format for pattern matching.

Callers 3

_temp4Function · 0.85
pathInWorkingPathFunction · 0.85
matchingRuleForInputFunction · 0.85

Calls 1

getPlatformFunction · 0.85

Tested by

no test coverage detected