(key, value, options)
| 33182 | exports2.encodeSpaceDelimited = formEncoder(" "); |
| 33183 | exports2.encodePipeDelimited = formEncoder("|"); |
| 33184 | function encodeBodyForm(key, value, options) { |
| 33185 | let out = ""; |
| 33186 | const pairs = (options === null || options === void 0 ? void 0 : options.explode) ? explode(key, value) : [[key, value]]; |
| 33187 | const encodeString = (v5) => { |
| 33188 | return (options === null || options === void 0 ? void 0 : options.charEncoding) === "percent" ? encodeURIComponent(v5) : v5; |
| 33189 | }; |
| 33190 | const encodeValue = (v5) => encodeString(serializeValue(v5)); |
| 33191 | pairs.forEach(([pk, pv]) => { |
| 33192 | let tmp = ""; |
| 33193 | let encValue = ""; |
| 33194 | if (pv === void 0) { |
| 33195 | return; |
| 33196 | } else if (Array.isArray(pv)) { |
| 33197 | encValue = JSON.stringify(pv, jsonReplacer); |
| 33198 | } else if ((0, is_plain_object_js_1.isPlainObject)(pv)) { |
| 33199 | encValue = JSON.stringify(pv, jsonReplacer); |
| 33200 | } else { |
| 33201 | encValue = `${encodeValue(pv)}`; |
| 33202 | } |
| 33203 | tmp = `${encodeString(pk)}=${encValue}`; |
| 33204 | if (!tmp || tmp === "=") { |
| 33205 | return; |
| 33206 | } |
| 33207 | out += `&${tmp}`; |
| 33208 | }); |
| 33209 | return out.slice(1); |
| 33210 | } |
| 33211 | function encodeDeepObject(key, value, options) { |
| 33212 | if (value == null) { |
| 33213 | return ""; |
nothing calls this directly
no test coverage detected
searching dependent graphs…