(s, o, { loadSpec: i = !1 } = {})
| 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), |
no test coverage detected