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

Function serializeResponse

frontend/public/swagger-ui-bundle.js:41698–41725  ·  view source on GitHub ↗
(s, o, { loadSpec: i = !1 } = {})

Source from the content-addressed store, hash-verified

41696 {}
41697 )
41698 }
41699 function serializeResponse(s, o, { loadSpec: i = !1 } = {}) {
41700 const a = {
41701 ok: s.ok,
41702 url: s.url || o,
41703 status: s.status,
41704 statusText: s.statusText,
41705 headers: serializeHeaders(s.headers),
41706 },
41707 u = a.headers['content-type'],
41708 _ = i || ((s = '') => /(json|xml|yaml|text)\b/.test(s))(u)
41709 return (_ ? s.text : s.blob || s.buffer).call(s).then((s) => {
41710 if (((a.text = s), (a.data = s), _))
41711 try {
41712 const o = (function parseBody(s, o) {
41713 if (o) {
41714 if (0 === o.indexOf('application/json') || o.indexOf('+json') > 0)
41715 return JSON.parse(s)
41716 if (0 === o.indexOf('application/xml') || o.indexOf('+xml') > 0) return s
41717 }
41718 return fn.load(s)
41719 })(s, u)
41720 ;((a.body = o), (a.obj = o))
41721 } catch (s) {
41722 a.parseError = s
41723 }
41724 return a
41725 })
41726 }
41727 async function http_http(s, o = {}) {
41728 ;('object' == typeof s && (s = (o = s).url),

Callers 1

http_httpFunction · 0.85

Calls 4

serializeHeadersFunction · 0.85
thenMethod · 0.45
parseMethod · 0.45
loadMethod · 0.45

Tested by

no test coverage detected