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

Function shouldEscapeForEncodeURI

internal/stringutil/util.go:173–189  ·  view source on GitHub ↗
(b byte)

Source from the content-addressed store, hash-verified

171const upperhex = "0123456789ABCDEF"
172
173func shouldEscapeForEncodeURI(b byte) bool {
174 switch {
175 case b >= 'A' && b <= 'Z':
176 return false
177 case b >= 'a' && b <= 'z':
178 return false
179 case b >= '0' && b <= '9':
180 return false
181 }
182
183 switch b {
184 case ';', '/', '?', ':', '@', '&', '=', '+', '$', ',', '#', '-', '_', '.', '!', '~', '*', '\'', '(', ')':
185 return false
186 default:
187 return true
188 }
189}
190
191func getByteOrderMarkLength(text string) int {
192 if len(text) >= 1 {

Callers 1

EncodeURIFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected