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

Function sanitize

frontend/public/swagger-ui-bundle.js:40221–40235  ·  view source on GitHub ↗
(s)

Source from the content-addressed store, hash-verified

40219 }
40220 return i.toString()
40221 },
40222 sanitize = (s) => {
40223 if (ul(s))
40224 return ((s) => {
40225 const o = [/\?/g, '%3F', /#/g, '%23']
40226 let i = s
40227 ;(isWindows() && (i = i.replace(/\\/g, '/')), (i = encodeURI(i)))
40228 for (let s = 0; s < o.length; s += 2) i = i.replace(o[s], o[s + 1])
40229 return i
40230 })(toFileSystemPath(s))
40231 try {
40232 return new URL(s).toString()
40233 } catch {
40234 return encodeURI(decodeURI(s)).replace(/%5B/g, '[').replace(/%5D/g, ']')
40235 }
40236 },
40237 unsanitize = (s) => (ul(s) ? toFileSystemPath(s) : decodeURI(s)),
40238 {

Callers 4

resolveSchema$refFieldFunction · 0.70
uri_evaluateFunction · 0.70
toBaseURIMethod · 0.70

Calls 5

isWindowsFunction · 0.85
toFileSystemPathFunction · 0.85
replaceMethod · 0.80
ulFunction · 0.50
toStringMethod · 0.45

Tested by

no test coverage detected