mirror of
https://github.com/koush/scrypted.git
synced 2026-04-19 06:30:28 +01:00
16 lines
374 B
TypeScript
16 lines
374 B
TypeScript
export function qsstringify(dict: any) {
|
|
const params = new URLSearchParams();
|
|
for (const [k, v] of Object.entries(dict)) {
|
|
params.set(k, v?.toString());
|
|
}
|
|
|
|
return params.toString();
|
|
}
|
|
|
|
export function qsparse(search: URLSearchParams) {
|
|
const ret: any = {};
|
|
for (const [k, v] of search.entries()) {
|
|
ret[k] = v;
|
|
}
|
|
return ret;
|
|
} |