= (
prefix: string,
params: URLSearchParams,
) => {
Object.entries(obj).forEach(([subKey, value]) => {
if (value === undefined) return;
const paramKey = `${prefix}[${subKey}]`;
if (Array.isArray(value)) {
value.forEach((v) => params.append(`${paramKey}[]`,
getValue(v)));
} else if (value !== null && typeof value === "object") {
} else if (["string", "number", "boolean"].includes(typeof value)) {
params.set(paramKey,
getValue(value as
string | number |
boolean));
}
});
}
const getValue
Definition: index.ts:31
const addNestedParams
Definition: index.ts:43
export type QueryParams
Definition: index.ts:1