algoliasearch-helper 3.22.0 → 3.22.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -24,6 +24,7 @@ This module is the companion of the [algolia/algoliasearch-client-javascript](ht
24
24
  <!-- START doctoc generated TOC please keep comment here to allow auto update -->
25
25
  <!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
26
26
 
27
+
27
28
  - [Features](#features)
28
29
  - [Examples](#examples)
29
30
  - [Vanilla JavaScript](#vanilla-javascript)
@@ -2859,7 +2859,7 @@ function findMatchingHierarchicalFacetFromAttributeName(
2859
2859
  }
2860
2860
  **/
2861
2861
  function SearchResults(state, results, options) {
2862
- var mainSubResponse = results[0];
2862
+ var mainSubResponse = results[0] || {};
2863
2863
 
2864
2864
  this._rawResults = results;
2865
2865
 
@@ -6336,10 +6336,15 @@ var requestBuilder = {
6336
6336
  var facetFilters = requestBuilder._getFacetFilters(state);
6337
6337
  var numericFilters = requestBuilder._getNumericFilters(state);
6338
6338
  var tagFilters = requestBuilder._getTagFilters(state);
6339
- var additionalParams = {
6340
- facets: facets.indexOf('*') > -1 ? ['*'] : facets,
6341
- tagFilters: tagFilters,
6342
- };
6339
+ var additionalParams = {};
6340
+
6341
+ if (facets.length > 0) {
6342
+ additionalParams.facets = facets.indexOf('*') > -1 ? ['*'] : facets;
6343
+ }
6344
+
6345
+ if (tagFilters.length > 0) {
6346
+ additionalParams.tagFilters = tagFilters;
6347
+ }
6343
6348
 
6344
6349
  if (facetFilters.length > 0) {
6345
6350
  additionalParams.facetFilters = facetFilters;
@@ -6715,7 +6720,7 @@ module.exports = sortAndMergeRecommendations;
6715
6720
  },{"../functions/find":14,"../functions/flat":16}],28:[function(require,module,exports){
6716
6721
  'use strict';
6717
6722
 
6718
- module.exports = '3.22.0';
6723
+ module.exports = '3.22.1';
6719
6724
 
6720
6725
  },{}]},{},[2])(2)
6721
6726
  });