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

Function properResolve

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

Source from the content-addressed store, hash-verified

109 * Resolves path segments properly based on whether they appear to be c:/ -style or / style.
110 */
111export function properResolve(...segments: string[]): string {
112 if (path.posix.isAbsolute(segments[0])) {
113 return path.posix.resolve(...segments);
114 } else if (path.win32.isAbsolute(segments[0])) {
115 return path.win32.resolve(...segments);
116 } else {
117 return path.resolve(...segments);
118 }
119}
120
121/**
122 * Resolves path segments properly based on whether they appear to be c:/ -style or / style.

Callers 8

rebaseRemoteToLocalFunction · 0.90
urlToAbsolutePathMethod · 0.90
urlToAbsolutePathMethod · 0.90
resolveRelativeToFileFunction · 0.90

Calls 2

isAbsoluteMethod · 0.80
resolveMethod · 0.65

Tested by

no test coverage detected