typesense-instantsearch-adapter 2.5.0-4 → 2.5.0-5

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.
@@ -2950,7 +2950,9 @@ var SearchResponseAdapter = /*#__PURE__*/function () {
2950
2950
 
2951
2951
  var adaptedValue;
2952
2952
 
2953
- if (Array.isArray(value)) {
2953
+ if (value == null) {
2954
+ adaptedValue = _this4._adaptHighlightNullValue(value);
2955
+ } else if (Array.isArray(value)) {
2954
2956
  var _highlightObjectValue;
2955
2957
 
2956
2958
  adaptedValue = _this4._adaptHighlightInArrayValue(value, (_highlightObjectValue = highlightObjectValue === null || highlightObjectValue === void 0 ? void 0 : highlightObjectValue[attribute]) !== null && _highlightObjectValue !== void 0 ? _highlightObjectValue : [], snippetOrValue);
@@ -2973,7 +2975,9 @@ var SearchResponseAdapter = /*#__PURE__*/function () {
2973
2975
  return arrayValue.map(function (value, index) {
2974
2976
  var adaptedValue;
2975
2977
 
2976
- if (Array.isArray(value)) {
2978
+ if (value == null) {
2979
+ adaptedValue = _this5._adaptHighlightNullValue(value);
2980
+ } else if (Array.isArray(value)) {
2977
2981
  var _highlightArrayValue$;
2978
2982
 
2979
2983
  adaptedValue = _this5._adaptHighlightInArrayValue(value, (_highlightArrayValue$ = highlightArrayValue === null || highlightArrayValue === void 0 ? void 0 : highlightArrayValue[index]) !== null && _highlightArrayValue$ !== void 0 ? _highlightArrayValue$ : [], snippetOrValue);
@@ -3006,6 +3010,15 @@ var SearchResponseAdapter = /*#__PURE__*/function () {
3006
3010
  };
3007
3011
  }
3008
3012
  }
3013
+ }, {
3014
+ key: "_adaptHighlightNullValue",
3015
+ value: function _adaptHighlightNullValue(value) {
3016
+ return {
3017
+ value: value,
3018
+ matchLevel: "none",
3019
+ matchedWords: []
3020
+ };
3021
+ }
3009
3022
  }, {
3010
3023
  key: "_adaptFacets",
3011
3024
  value: function _adaptFacets(typesenseFacetCounts) {