MCPcopy Create free account
hub / github.com/Snapchat/Valdi / properRelative

Function properRelative

valdi/vscode_debugger/src/common/pathUtils.ts:124–132  ·  view source on GitHub ↗
(fromPath: string, toPath: string)

Source from the content-addressed store, hash-verified

122 * Resolves path segments properly based on whether they appear to be c:/ -style or / style.
123 */
124export function properRelative(fromPath: string, toPath: string): string {
125 if (path.posix.isAbsolute(fromPath)) {
126 return path.posix.relative(fromPath, toPath);
127 } else if (path.win32.isAbsolute(fromPath)) {
128 return path.win32.relative(fromPath, toPath);
129 } else {
130 return path.relative(fromPath, toPath);
131 }
132}
133
134export function fixDriveLetter(aPath: string, uppercaseDriveLetter = false): string {
135 if (!aPath) return aPath;

Callers 3

rebaseRemoteToLocalFunction · 0.90
rebaseLocalToRemoteFunction · 0.90

Calls 1

isAbsoluteMethod · 0.80

Tested by

no test coverage detected