Skip to content

Commit

Permalink
rid off mapValues
Browse files Browse the repository at this point in the history
  • Loading branch information
cigolpl committed Sep 13, 2024
1 parent 5274c73 commit b7133c5
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions src/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -261,15 +261,12 @@ export const index = function(items = [], fields = []) {
* calculates ids for filters
*/
export const filters_ids = function(facets_data) {
let output = new FastBitSet([]);

mapValues(facets_data, function(values, key) {
mapValues(facets_data[key], function(facet_indexes, key2) {
output = output.new_union(facets_data[key][key2]);
return Object.values(facets_data).reduce((output, values) => {
Object.values(values).forEach(facet_indexes => {
output = output.new_union(facet_indexes);
});
});

return output;
return output;
}, new FastBitSet([]));
};

/**
Expand Down

0 comments on commit b7133c5

Please sign in to comment.