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

Function es_substitute

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

Source from the content-addressed store, hash-verified

55105 ? s
55106 : encodeURIComponent(s).replace(/%5B/g, '[').replace(/%5D/g, ']'),
55107 Rx = ['literals', 'server-variable-name'],
55108 es_substitute = (s, o, i = {}) => {
55109 const a = { ...{ encoder: encodeServerVariable }, ...i },
55110 u = openapi_server_url_templating_es_parse(s)
55111 if (!u.result.success) return s
55112 const _ = []
55113 u.ast.translate(_)
55114 const w = _.filter(([s]) => Rx.includes(s)).map(([s, i]) =>
55115 'server-variable-name' === s
55116 ? Object.hasOwn(o, i)
55117 ? a.encoder(o[i], i)
55118 : `{${i}}`
55119 : i
55120 )
55121 return w.join('')
55122 }
55123 function path_templating_grammar() {
55124 ;((this.grammarObject = 'grammarObject'),

Callers 1

execute_buildRequestFunction · 0.85

Calls 5

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

Tested by

no test coverage detected