MCPcopy Create free account
hub / github.com/microsoft/typescript-go / pathComponents

Function pathComponents

internal/tspath/path.go:138–145  ·  view source on GitHub ↗
(path string, rootLength int)

Source from the content-addressed store, hash-verified

136}
137
138func pathComponents(path string, rootLength int) []string {
139 root := path[:rootLength]
140 rest := strings.Split(path[rootLength:], "/")
141 if len(rest) > 0 && rest[len(rest)-1] == "" {
142 rest = rest[:len(rest)-1]
143 }
144 return append([]string{root}, rest...)
145}
146
147func IsVolumeCharacter(char byte) bool {
148 return char >= 'a' && char <= 'z' || char >= 'A' && char <= 'Z'

Callers 1

GetPathComponentsFunction · 0.70

Calls 2

lenFunction · 0.85
appendFunction · 0.50

Tested by

no test coverage detected