mirror of
https://github.com/koush/scrypted.git
synced 2026-03-04 18:33:18 +00:00
cloud: cleanup deps
This commit is contained in:
16
plugins/cloud/src/qs.ts
Normal file
16
plugins/cloud/src/qs.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
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;
|
||||
}
|
||||
Reference in New Issue
Block a user