Safer popup params to object logic

This commit is contained in:
2022-08-13 00:40:20 +02:00
parent b7ac8bce83
commit 577a64a32f
4 changed files with 10 additions and 12 deletions

View File

@@ -11,9 +11,12 @@ const removeIncludedQueryParams = (params, key) => {
function paramsToObject(entries) {
const result = {};
return entries.forEach((key, value) => {
// eslint-disable-next-line no-restricted-syntax
for (const [key, value] of entries) {
result[key] = value;
});
}
return result;
}
const updateQueryParams = (id: number = null, type: MediaTypes = null) => {