Skip to content

Commit 4ee9530

Browse files
author
NarrowsProjects
committed
chore: improve filteringmodel constructor jsdoc
1 parent 094a95c commit 4ee9530

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

lib/public/components/Filters/common/FilteringModel.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export class FilteringModel extends Observable {
2525
*
2626
* @param {QueryRouter} router router that controls the application's page navigation
2727
* @param {Object<string, FilterModel>} filters the filters with their label and model
28-
* @param {object} warnings object reference used to define warnings.
28+
* @param {Map<string, string>} warnings object reference used to define warnings.
2929
*/
3030
constructor(router, filters, warnings) {
3131
super();
@@ -150,14 +150,12 @@ export class FilteringModel extends Observable {
150150
const unknownFilters = [];
151151
const setFilterErrors = [];
152152

153-
for (const entry of Object.entries(filter)) {
154-
const [key, value] = entry;
155-
153+
for (const [key, value] of Object.entries(filter)) {
156154
if (key in this._filters) {
157155
try {
158156
this._filters[key].normalized = value;
159157
} catch {
160-
setFilterErrors.push(`${buildUrl('', entry).slice(1)}`);
158+
setFilterErrors.push(`${buildUrl('', { [key]: value }).slice(1)}`);
161159
}
162160
} else {
163161
unknownFilters.push(`'${key}'`);

0 commit comments

Comments
 (0)