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

Function formatKeyValueBySerializationOption

frontend/public/swagger-ui-bundle.js:41586–41610  ·  view source on GitHub ↗
(s, o, i, a)

Source from the content-addressed store, hash-verified

41584 : [[j, x.map(C).join(nu[a || 'csv'])]]
41585 : [[j, '']]
41586 }
41587 function formatKeyValueBySerializationOption(s, o, i, a) {
41588 const u = a.style || 'form',
41589 _ = void 0 === a.explode ? 'form' === u : a.explode,
41590 w = !i && (a && a.allowReserved ? 'unsafe' : 'reserved'),
41591 encodeFn = (s) => valueEncoder(s, w),
41592 x = i ? (s) => s : (s) => encodeFn(s)
41593 return 'object' != typeof o
41594 ? [[x(s), encodeFn(o)]]
41595 : Array.isArray(o)
41596 ? _
41597 ? [[x(s), o.map(encodeFn)]]
41598 : [[x(s), o.map(encodeFn).join(ru[u])]]
41599 : 'deepObject' === u
41600 ? Object.keys(o).map((i) => [x(`${s}[${i}]`), encodeFn(o[i])])
41601 : _
41602 ? Object.keys(o).map((s) => [x(s), encodeFn(o[s])])
41603 : [
41604 [
41605 x(s),
41606 Object.keys(o)
41607 .map((s) => [`${x(s)},${encodeFn(o[s])}`])
41608 .join(','),
41609 ],
41610 ]
41611 }
41612 function encodeFormOrQuery(s) {
41613 return ((s, { encode: o = !0 } = {}) => {

Callers 1

formatKeyValueFunction · 0.85

Calls 5

encodeFnFunction · 0.85
xFunction · 0.70
isArrayMethod · 0.45
mapMethod · 0.45
keysMethod · 0.45

Tested by

no test coverage detected