Skip to content

Commit b7133c5

Browse files
committed
rid off mapValues
1 parent 5274c73 commit b7133c5

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

src/helpers.js

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -261,15 +261,12 @@ export const index = function(items = [], fields = []) {
261261
* calculates ids for filters
262262
*/
263263
export const filters_ids = function(facets_data) {
264-
let output = new FastBitSet([]);
265-
266-
mapValues(facets_data, function(values, key) {
267-
mapValues(facets_data[key], function(facet_indexes, key2) {
268-
output = output.new_union(facets_data[key][key2]);
264+
return Object.values(facets_data).reduce((output, values) => {
265+
Object.values(values).forEach(facet_indexes => {
266+
output = output.new_union(facet_indexes);
269267
});
270-
});
271-
272-
return output;
268+
return output;
269+
}, new FastBitSet([]));
273270
};
274271

275272
/**

0 commit comments

Comments
 (0)