@swell/apps-sdk 1.0.169 → 1.0.170

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/dist/index.js CHANGED
@@ -15810,7 +15810,10 @@ ${formattedMessage}`;
15810
15810
  tags: [],
15811
15811
  template_suffix: defer(() => category.theme_template),
15812
15812
  title: defer(() => category.name),
15813
- url: deferWith(category, (category2) => `/collections/${category2.slug}`)
15813
+ url: deferWith(
15814
+ category,
15815
+ (category2) => category2.slug ? `/collections/${category2.slug}` : ""
15816
+ )
15814
15817
  });
15815
15818
  }
15816
15819
  function getFirstImage(category) {
@@ -15839,9 +15842,7 @@ ${formattedMessage}`;
15839
15842
  function getProducts(instance, object, mapper) {
15840
15843
  return deferWith(object, (object2) => {
15841
15844
  const { page, limit: limit2 } = instance.swell.queryParams;
15842
- const productQuery = {
15843
- $variants: true
15844
- };
15845
+ const productQuery = { $variants: true };
15845
15846
  if (typeof object2.id === "string" && object2.id !== "all") {
15846
15847
  productQuery.category = object2.id;
15847
15848
  }
@@ -15852,11 +15853,7 @@ ${formattedMessage}`;
15852
15853
  const products = new SwellStorefrontCollection(
15853
15854
  instance.swell,
15854
15855
  "products",
15855
- {
15856
- page,
15857
- limit: limit2,
15858
- ...filterQuery
15859
- },
15856
+ { page, limit: limit2, ...filterQuery },
15860
15857
  async function() {
15861
15858
  return this._defaultGetter().call(this);
15862
15859
  }
@@ -17363,10 +17360,9 @@ ${formattedMessage}`;
17363
17360
  ({ from }) => from === key || from.startsWith(keyObject)
17364
17361
  );
17365
17362
  if (resourceMap && value instanceof StorefrontResource) {
17366
- const resource = resourceMap.object(this, value);
17367
- const composed = Object.assign({}, value.toObject(), resource);
17368
- Object.setPrototypeOf(composed, Object.getPrototypeOf(resource));
17369
- pageData[resourceMap.to] = composed;
17363
+ const resourceProps = resourceMap.object(this, value);
17364
+ value.setCompatibilityProps(resourceProps);
17365
+ pageData[resourceMap.to] = value;
17370
17366
  }
17371
17367
  }
17372
17368
  }