@sledge-app/react-instant-search 2.0.75 → 2.0.76

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.
@@ -709,7 +709,8 @@ const getSortMap = ({
709
709
  }) => {
710
710
  activeCollectionId = activeCollectionId || "default";
711
711
  collectionAllId = collectionAllId || activeCollectionId || "all";
712
- return {
712
+ const fallbackValue = `featuredSort.${activeCollectionId}:asc`;
713
+ const sortMap = {
713
714
  "best-selling": `bestSellingSort.${collectionAllId}:asc`,
714
715
  "manual": `featuredSort.${activeCollectionId}:asc`,
715
716
  "created-ascending": "created_at:asc",
@@ -719,6 +720,14 @@ const getSortMap = ({
719
720
  "title-ascending": "title:asc",
720
721
  "title-descending": "title:desc"
721
722
  };
723
+ return new Proxy(sortMap, {
724
+ get(target, prop, receiver) {
725
+ if (typeof prop === "string" && !(prop in target)) {
726
+ return fallbackValue;
727
+ }
728
+ return Reflect.get(target, prop, receiver);
729
+ }
730
+ });
722
731
  };
723
732
  let onStorageFallback;
724
733
  const getWindowStore = () => {