Skip to content

Commit

Permalink
Update to 2.1.20
Browse files Browse the repository at this point in the history
  • Loading branch information
cigolpl committed Jul 29, 2022
1 parent 688fc31 commit 6b8edea
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
12 changes: 10 additions & 2 deletions dist/itemsjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -20646,6 +20646,7 @@ var getBuckets = function getBuckets(data, input, aggregations) {
var title;
var show_facet_stats;
var chosen_filters_on_top;
var hide_zero_doc_count;

if (aggregations[k]) {
order = aggregations[k].order;
Expand All @@ -20654,6 +20655,7 @@ var getBuckets = function getBuckets(data, input, aggregations) {
title = aggregations[k].title;
show_facet_stats = aggregations[k].show_facet_stats || false;
chosen_filters_on_top = aggregations[k].chosen_filters_on_top !== false;
hide_zero_doc_count = aggregations[k].hide_zero_doc_count || false;
}

var buckets = _.chain(v).toPairs().map(function (v2) {
Expand All @@ -20663,12 +20665,18 @@ var getBuckets = function getBuckets(data, input, aggregations) {
filters = input.filters[k];
}

var doc_count = v2[1].array().length;

if (hide_zero_doc_count && doc_count === 0) {
return;
}

return {
key: v2[0],
doc_count: v2[1].array().length,
doc_count: doc_count,
selected: filters.indexOf(v2[0]) !== -1
};
}).value();
}).compact().value();

var iteratees;
var sort_order;
Expand Down
2 changes: 1 addition & 1 deletion dist/itemsjs.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "itemsjs",
"version": "2.1.19",
"version": "2.1.20",
"description": "Created to perform fast search on small json dataset (up to 1000 elements).",
"main": "lib/index.js",
"scripts": {
Expand Down

0 comments on commit 6b8edea

Please sign in to comment.