(from: string, to: string)
| 168 | * @returns A POSIX-style relative path |
| 169 | */ |
| 170 | export 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. |
no test coverage detected