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

Function es_resolve

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

Source from the content-addressed store, hash-verified

55315 ? s
55316 : encodeURIComponent(s).replace(/%5B/g, '[').replace(/%5D/g, ']'),
55317 Lx = ['slash', 'path-literal', 'template-expression-param-name'],
55318 es_resolve = (s, o, i = {}) => {
55319 const a = { ...{ encoder: encodePathComponent }, ...i },
55320 u = openapi_path_templating_es_parse(s)
55321 if (!u.result.success) return s
55322 const _ = []
55323 u.ast.translate(_)
55324 const w = _.filter(([s]) => Lx.includes(s)).map(([s, i]) =>
55325 'template-expression-param-name' === s
55326 ? Object.prototype.hasOwnProperty.call(o, i)
55327 ? a.encoder(o[i], i)
55328 : `{${i}}`
55329 : i
55330 )
55331 return w.join('')
55332 },
55333 Fx =
55334 (new path_templating_grammar(),

Callers 2

parameter_builders_pathFunction · 0.85

Calls 5

translateMethod · 0.80
mapMethod · 0.45
filterMethod · 0.45
includesMethod · 0.45

Tested by

no test coverage detected