MCPcopy Index your code
hub / github.com/microsoft/typescript-go / GetPathFromPathComponents

Function GetPathFromPathComponents

internal/tspath/path.go:269–280  ·  view source on GitHub ↗
(pathComponents []string)

Source from the content-addressed store, hash-verified

267}
268
269func GetPathFromPathComponents(pathComponents []string) string {
270 if len(pathComponents) == 0 {
271 return ""
272 }
273
274 root := pathComponents[0]
275 if root != "" {
276 root = EnsureTrailingDirectorySeparator(root)
277 }
278
279 return root + strings.Join(pathComponents[1:], "/")
280}
281
282func NormalizeSlashes(path string) string {
283 return strings.ReplaceAll(path, "\\", "/")

Calls 2

lenFunction · 0.85

Tested by 2

normalizePath_oldFunction · 0.68