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

Function toFileSystemPath

frontend/public/swagger-ui-bundle.js:40179–40197  ·  view source on GitHub ↗
(s, o)

Source from the content-addressed store, hash-verified

40177 const o = getProtocol(s)
40178 return 'http' === o || 'https' === o
40179 },
40180 toFileSystemPath = (s, o) => {
40181 const i = [/%23/g, '#', /%24/g, '$', /%26/g, '&', /%2C/g, ',', /%40/g, '@'],
40182 a = La(!1, 'keepFileProtocol', o),
40183 u = La(isWindows, 'isWindows', o)
40184 let _ = decodeURI(s)
40185 for (let s = 0; s < i.length; s += 2) _ = _.replace(i[s], i[s + 1])
40186 let w = 'file://' === _.substring(0, 7).toLowerCase()
40187 return (
40188 w &&
40189 ((_ = '/' === _[7] ? _.substring(8) : _.substring(7)),
40190 u() && '/' === _[1] && (_ = `${_[0]}:${_.substring(1)}`),
40191 a ? (_ = `file:///${_}`) : ((w = !1), (_ = u() ? _ : `/${_}`))),
40192 u() &&
40193 !w &&
40194 ((_ = sl('/', '\\', _)),
40195 ':\\' === _.substring(1, 3) && (_ = _[0].toUpperCase() + _.substring(1))),
40196 _
40197 )
40198 },
40199 getHash = (s) => {
40200 const o = s.indexOf('#')

Callers 2

sanitizeFunction · 0.85
unsanitizeFunction · 0.85

Calls 4

replaceMethod · 0.80
uFunction · 0.70
LaFunction · 0.50
slFunction · 0.50

Tested by

no test coverage detected