MCPcopy Index your code
hub / github.com/dataease/SQLBot / encodeCharacters

Function encodeCharacters

frontend/public/swagger-ui-bundle.js:41452–41464  ·  view source on GitHub ↗
(s, o = 'reserved')

Source from the content-addressed store, hash-verified

41450 }
41451 const isRfc3986Reserved = (s) => ":/?#[]@!$&'()*+,;=".indexOf(s) > -1,
41452 isRfc3986Unreserved = (s) => /^[a-z0-9\-._~]+$/i.test(s)
41453 function encodeCharacters(s, o = 'reserved') {
41454 return [...s]
41455 .map((s) => {
41456 if (isRfc3986Unreserved(s)) return s
41457 if (isRfc3986Reserved(s) && 'unsafe' === o) return s
41458 const i = new TextEncoder()
41459 return Array.from(i.encode(s))
41460 .map((s) => `0${s.toString(16).toUpperCase()}`.slice(-2))
41461 .map((s) => `%${s}`)
41462 .join('')
41463 })
41464 .join('')
41465 }
41466 function stylize(s) {
41467 const { value: o } = s

Callers 2

valueEncoderFunction · 0.85
parameter_builders_pathFunction · 0.85

Calls 5

isRfc3986UnreservedFunction · 0.85
isRfc3986ReservedFunction · 0.85
mapMethod · 0.45
fromMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected