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

Function serializeRequest

frontend/public/swagger-ui-bundle.js:41641–41684  ·  view source on GitHub ↗
(s = {})

Source from the content-addressed store, hash-verified

41639 { encode: !1 }
41640 )
41641 }
41642 function serializeRequest(s = {}) {
41643 const { url: o = '', query: i, form: a } = s
41644 if (a) {
41645 const o = Object.keys(a).some((s) => {
41646 const { value: o } = a[s]
41647 return isFile(o) || isArrayOfFile(o)
41648 }),
41649 i = s.headers['content-type'] || s.headers['Content-Type']
41650 if (o || /multipart\/form-data/i.test(i)) {
41651 const o = (function request_buildFormData(s) {
41652 return Object.entries(s).reduce((s, [o, i]) => {
41653 for (const [a, u] of formatKeyValue(o, i, !0))
41654 if (Array.isArray(u))
41655 for (const o of u)
41656 if (ArrayBuffer.isView(o)) {
41657 const i = new Blob([o])
41658 s.append(a, i)
41659 } else s.append(a, o)
41660 else if (ArrayBuffer.isView(u)) {
41661 const o = new Blob([u])
41662 s.append(a, o)
41663 } else s.append(a, u)
41664 return s
41665 }, new FormData())
41666 })(s.form)
41667 ;((s.formdata = o), (s.body = o))
41668 } else s.body = encodeFormOrQuery(a)
41669 delete s.form
41670 }
41671 if (i) {
41672 const [a, u] = o.split('?')
41673 let _ = ''
41674 if (u) {
41675 const s = new URLSearchParams(u)
41676 ;(Object.keys(i).forEach((o) => s.delete(o)), (_ = String(s)))
41677 }
41678 const w = ((...s) => {
41679 const o = s.filter((s) => s).join('&')
41680 return o ? `?${o}` : ''
41681 })(_, encodeFormOrQuery(i))
41682 ;((s.url = a + w), delete s.query)
41683 }
41684 return s
41685 }
41686 function serializeHeaders(s = {}) {
41687 return 'function' != typeof s.entries

Callers 3

http_httpFunction · 0.85
execute_buildRequestFunction · 0.85
swagger_clientFunction · 0.85

Calls 12

isFileFunction · 0.85
isArrayOfFileFunction · 0.85
formatKeyValueFunction · 0.85
encodeFormOrQueryFunction · 0.85
someMethod · 0.45
keysMethod · 0.45
reduceMethod · 0.45
isArrayMethod · 0.45
appendMethod · 0.45
forEachMethod · 0.45
deleteMethod · 0.45
filterMethod · 0.45

Tested by

no test coverage detected