(opts, handler)
| 11072 | const replyData = typeof data === "function" ? { callback: data } : __spreadValues({}, data); |
| 11073 | const newMockDispatch = __spreadProps(__spreadValues(__spreadValues({}, baseData), key), { pending: true, data: __spreadValues({ error: null }, replyData) }); |
| 11074 | mockDispatches.push(newMockDispatch); |
| 11075 | return newMockDispatch; |
| 11076 | } |
| 11077 | function deleteMockDispatch(mockDispatches, key) { |
| 11078 | const index = mockDispatches.findIndex((dispatch) => { |
| 11079 | if (!dispatch.consumed) { |
| 11080 | return false; |
| 11081 | } |
| 11082 | return matchKey(dispatch, key); |
| 11083 | }); |
| 11084 | if (index !== -1) { |
| 11085 | mockDispatches.splice(index, 1); |
| 11086 | } |
| 11087 | } |
| 11088 | function buildKey(opts) { |
| 11089 | const { path: path5, method, body, headers, query } = opts; |
| 11090 | return { |
| 11091 | path: path5, |
| 11092 | method, |
| 11093 | body, |
| 11094 | headers, |
| 11095 | query |
| 11096 | }; |
| 11097 | } |
| 11098 | function generateKeyValues(data) { |
| 11099 | const keys = Object.keys(data); |
| 11100 | const result = []; |
| 11101 | for (let i = 0; i < keys.length; ++i) { |
| 11102 | const key = keys[i]; |
| 11103 | const value = data[key]; |
| 11104 | const name = Buffer.from(`${key}`); |
| 11105 | if (Array.isArray(value)) { |
| 11106 | for (let j = 0; j < value.length; ++j) { |
| 11107 | result.push(name, Buffer.from(`${value[j]}`)); |
| 11108 | } |
| 11109 | } else { |
| 11110 | result.push(name, Buffer.from(`${value}`)); |
| 11111 | } |
| 11112 | } |
| 11113 | return result; |
| 11114 | } |
| 11115 | function getStatusText(statusCode) { |
| 11116 | return STATUS_CODES[statusCode] || "unknown"; |
| 11117 | } |
| 11118 | function getResponse(body) { |
| 11119 | return __async(this, null, function* () { |
| 11120 | const buffers = []; |
nothing calls this directly
no test coverage detected