@zengenti/contensis-react-base 3.0.0-beta.35 → 3.0.0-beta.39

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/cjs/search.js CHANGED
@@ -291,7 +291,7 @@ const getSelectedFilters = (state, facet = '', context = Context$1.facets, retur
291
291
  const selectedFilters = Object.fromEntries(Object.entries(filters).map(([key, filter = {}]) => [key, (filter.items || []).filter(item => !!(item.isSelected || false)).map(item => {
292
292
  const key = (item === null || item === void 0 ? void 0 : item.key) || '';
293
293
  const isIsoDate = isoDateRegex.test(key);
294
- return isIsoDate ? key : key.toLowerCase();
294
+ return isIsoDate ? key : typeof key.toLowerCase !== 'undefined' ? key.toLowerCase() : key;
295
295
  })]));
296
296
  const fromJS = makeFromJS(returnType);
297
297
  return fromJS(selectedFilters);
@@ -2242,7 +2242,10 @@ const generateFiltersState = ({
2242
2242
  // the search results during SSR without needing to fetch the filters first
2243
2243
 
2244
2244
 
2245
- Object.entries(filterParams).map(([paramName = '', paramValue]) => typeof paramValue === 'string' && paramValue.split(',').map(pVal => filters = addFilterItem(filters, paramName, pVal)));
2245
+ Object.entries(filterParams).map(([paramName = '', paramValue]) => {
2246
+ if (typeof paramValue === 'string') return paramValue.split(',').map(pVal => filters = addFilterItem(filters, paramName, pVal));
2247
+ if (typeof paramValue === 'boolean') filters = addFilterItem(filters, paramName, paramValue);
2248
+ });
2246
2249
  return Object.fromEntries(filters);
2247
2250
  };
2248
2251