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

Function getFileUrlVolumeSeparatorEnd

internal/tspath/path.go:151–166  ·  view source on GitHub ↗
(url string, start int)

Source from the content-addressed store, hash-verified

149}
150
151func getFileUrlVolumeSeparatorEnd(url string, start int) int {
152 if len(url) <= start {
153 return -1
154 }
155 ch0 := url[start]
156 if ch0 == ':' {
157 return start + 1
158 }
159 if ch0 == '%' && len(url) > start+2 && url[start+1] == '3' {
160 ch2 := url[start+2]
161 if ch2 == 'a' || ch2 == 'A' {
162 return start + 3
163 }
164 }
165 return -1
166}
167
168func GetEncodedRootLength(path string) int {
169 ln := len(path)

Callers 1

GetEncodedRootLengthFunction · 0.70

Calls 1

lenFunction · 0.85

Tested by

no test coverage detected