(sep)
| 33147 | return out; |
| 33148 | } |
| 33149 | function formEncoder(sep) { |
| 33150 | return (key, value, options) => { |
| 33151 | let out = ""; |
| 33152 | const pairs = (options === null || options === void 0 ? void 0 : options.explode) ? explode(key, value) : [[key, value]]; |
| 33153 | const encodeString = (v5) => { |
| 33154 | return (options === null || options === void 0 ? void 0 : options.charEncoding) === "percent" ? encodeURIComponent(v5) : v5; |
| 33155 | }; |
| 33156 | const encodeValue = (v5) => encodeString(serializeValue(v5)); |
| 33157 | const encodedSep = encodeString(sep); |
| 33158 | pairs.forEach(([pk, pv]) => { |
| 33159 | let tmp = ""; |
| 33160 | let encValue = ""; |
| 33161 | if (pv === void 0) { |
| 33162 | return; |
| 33163 | } else if (Array.isArray(pv)) { |
| 33164 | encValue = mapDefined(pv, (v5) => `${encodeValue(v5)}`).join(encodedSep); |
| 33165 | } else if ((0, is_plain_object_js_1.isPlainObject)(pv)) { |
| 33166 | encValue = mapDefinedEntries(Object.entries(pv), ([k7, v5]) => { |
| 33167 | return `${encodeString(k7)}${encodedSep}${encodeValue(v5)}`; |
| 33168 | }).join(encodedSep); |
| 33169 | } else { |
| 33170 | encValue = `${encodeValue(pv)}`; |
| 33171 | } |
| 33172 | tmp = `${encodeString(pk)}=${encValue}`; |
| 33173 | if (!tmp || tmp === "=") { |
| 33174 | return; |
| 33175 | } |
| 33176 | out += `&${tmp}`; |
| 33177 | }); |
| 33178 | return out.slice(1); |
| 33179 | }; |
| 33180 | } |
| 33181 | exports2.encodeForm = formEncoder(","); |
| 33182 | exports2.encodeSpaceDelimited = formEncoder(" "); |
| 33183 | exports2.encodePipeDelimited = formEncoder("|"); |
no test coverage detected
searching dependent graphs…