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

Function safeBuildUrl

frontend/public/swagger-ui-bundle.js:36128–36139  ·  view source on GitHub ↗
(s, o, { selectedServer: i = '' } = {})

Source from the content-addressed store, hash-verified

36126 : new URL(s, o).href
36127 : o
36128 }
36129 function safeBuildUrl(s, o, { selectedServer: i = '' } = {}) {
36130 try {
36131 return (function buildUrl(s, o, { selectedServer: i = '' } = {}) {
36132 if (!s) return
36133 if (isAbsoluteUrl(s)) return s
36134 const a = buildBaseUrl(i, o)
36135 return isAbsoluteUrl(a) ? new URL(s, a).href : new URL(s, window.location.href).href
36136 })(s, o, { selectedServer: i })
36137 } catch {
36138 return
36139 }
36140 }
36141 function sanitizeUrl(s) {
36142 if ('string' != typeof s || '' === s.trim()) return ''

Callers 6

renderMethod · 0.85
renderMethod · 0.85
renderMethod · 0.85
renderMethod · 0.85
renderMethod · 0.85

Calls 2

isAbsoluteUrlFunction · 0.85
buildBaseUrlFunction · 0.85

Tested by

no test coverage detected