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

Function encodeFormOrQuery

frontend/public/swagger-ui-bundle.js:41611–41640  ·  view source on GitHub ↗
(s)

Source from the content-addressed store, hash-verified

41609 ],
41610 ]
41611 }
41612 function encodeFormOrQuery(s) {
41613 return ((s, { encode: o = !0 } = {}) => {
41614 const buildNestedParams = (s, o, i) => (
41615 Array.isArray(i)
41616 ? i.reduce((i, a) => buildNestedParams(s, o, a), s)
41617 : i instanceof Date
41618 ? s.append(o, i.toISOString())
41619 : 'object' == typeof i
41620 ? Object.entries(i).reduce(
41621 (i, [a, u]) => buildNestedParams(s, `${o}[${a}]`, u),
41622 s
41623 )
41624 : s.append(o, i),
41625 s
41626 ),
41627 i = Object.entries(s).reduce(
41628 (s, [o, i]) => buildNestedParams(s, o, i),
41629 new URLSearchParams()
41630 ),
41631 a = String(i)
41632 return o ? a : decodeURIComponent(a)
41633 })(
41634 Object.keys(s).reduce((o, i) => {
41635 for (const [a, u] of formatKeyValue(i, s[i]))
41636 o[a] = u instanceof FileWithData ? u.valueOf() : u
41637 return o
41638 }, {}),
41639 { encode: !1 }
41640 )
41641 }
41642 function serializeRequest(s = {}) {
41643 const { url: o = '', query: i, form: a } = s

Callers 1

serializeRequestFunction · 0.85

Calls 5

buildNestedParamsFunction · 0.85
formatKeyValueFunction · 0.85
valueOfMethod · 0.80
reduceMethod · 0.45
keysMethod · 0.45

Tested by

no test coverage detected