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

Function properJoin

valdi/vscode_debugger/src/common/pathUtils.ts:98–106  ·  view source on GitHub ↗
(...segments: string[])

Source from the content-addressed store, hash-verified

96 * Note - must check posix first because win32.isAbsolute includes posix.isAbsolute
97 */
98export function properJoin(...segments: string[]): string {
99 if (path.posix.isAbsolute(segments[0])) {
100 return forceForwardSlashes(path.posix.join(...segments));
101 } else if (path.win32.isAbsolute(segments[0])) {
102 return path.win32.join(...segments);
103 } else {
104 return path.join(...segments);
105 }
106}
107
108/**
109 * Resolves path segments properly based on whether they appear to be c:/ -style or / style.

Callers 5

rebaseRemoteToLocalFunction · 0.90
rebaseLocalToRemoteFunction · 0.90
applyMethod · 0.90
getComputedSourceRootFunction · 0.90
toClientPathFunction · 0.90

Calls 3

forceForwardSlashesFunction · 0.85
isAbsoluteMethod · 0.80
joinMethod · 0.45

Tested by

no test coverage detected