typesense-instantsearch-adapter 2.9.0 → 2.9.1-0

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.
@@ -151,13 +151,15 @@ var FacetSearchResponseAdapter = /*#__PURE__*/function () {
151
151
  var facet = typesenseFacetCounts.find(function (facet) {
152
152
  return facet.field_name === _this.instantsearchRequest.params.facetName;
153
153
  });
154
- adaptedResult = facet.counts.map(function (facetCount) {
155
- return {
156
- value: facetCount.value,
157
- highlighted: _this._adaptHighlightTag(facetCount.highlighted, _this.instantsearchRequest.params.highlightPreTag, _this.instantsearchRequest.params.highlightPostTag),
158
- count: facetCount.count
159
- };
160
- });
154
+ if (typeof facet !== 'undefined') {
155
+ adaptedResult = facet.counts.map(function (facetCount) {
156
+ return {
157
+ value: facetCount.value,
158
+ highlighted: _this._adaptHighlightTag(facetCount.highlighted, _this.instantsearchRequest.params.highlightPreTag, _this.instantsearchRequest.params.highlightPostTag),
159
+ count: facetCount.count
160
+ };
161
+ });
162
+ }
161
163
  return adaptedResult;
162
164
  }
163
165
  }, {