Closed t-col closed 4 months ago
Maybe we could give this another go? It shouldn't be too complex to build something of our own. For example:
function stringify(obj) {
function stringifyInner(obj, parentKey) {
return Object.entries(obj).flatMap(([key, value]) => {
const fullKey = `${parentKey}[${key}]`;
if (typeof value === 'object') return stringifyInner(value, fullKey)
return [[fullKey, value]]
})
}
return new URLSearchParams(Object.entries(obj).flatMap(([k, v]) => {
if (typeof v === 'object') return stringifyInner(v, k)
return [[k, v]]
}));
}
This reverts commit 8020f4e389f85a86ce27d24b806148bf43f68342.
URLSearchParams does not stringify nested objects