@scayle/storefront-core 7.41.0 → 7.41.1

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @scayle/storefront-core
2
2
 
3
+ ## 7.41.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Fixes an issue where we were trying to read siblings information from a product where the data was not available
8
+
3
9
  ## 7.41.0
4
10
 
5
11
  ### Minor Changes
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2023 SCAYLE GmbH
3
+ Copyright (c) 2024 SCAYLE GmbH
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -171,8 +171,8 @@ const getLatestCategory = categories => {
171
171
  exports.getLatestCategory = getLatestCategory;
172
172
  const getProductAndSiblingsColors = (product, colorAttributeName = "colorDetail") => {
173
173
  const productColor = (0, _backbone.getFirstAttributeValue)(product.attributes, colorAttributeName);
174
- const siblingsColors = product.siblings?.filter(sibling => sibling.isActive && !sibling.isSoldOut).map(sibling => (0, _backbone.getFirstAttributeValue)(sibling.attributes, colorAttributeName));
175
- return [productColor, ...(siblingsColors || [])].filter(color => !!color);
174
+ const siblingsColors = (product.siblings ?? []).filter(sibling => sibling.isActive).map(sibling => (0, _backbone.getFirstAttributeValue)(sibling.attributes, colorAttributeName));
175
+ return [productColor, ...siblingsColors].filter(color => !!color);
176
176
  };
177
177
  exports.getProductAndSiblingsColors = getProductAndSiblingsColors;
178
178
  const getVariantCrosssellingValues = variants => {
@@ -151,10 +151,10 @@ export const getProductAndSiblingsColors = (product, colorAttributeName = "color
151
151
  product.attributes,
152
152
  colorAttributeName
153
153
  );
154
- const siblingsColors = product.siblings?.filter((sibling) => sibling.isActive && !sibling.isSoldOut).map(
154
+ const siblingsColors = (product.siblings ?? []).filter((sibling) => sibling.isActive).map(
155
155
  (sibling) => getFirstAttributeValue(sibling.attributes, colorAttributeName)
156
156
  );
157
- return [productColor, ...siblingsColors || []].filter(
157
+ return [productColor, ...siblingsColors].filter(
158
158
  (color) => !!color
159
159
  );
160
160
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scayle/storefront-core",
3
- "version": "7.41.0",
3
+ "version": "7.41.1",
4
4
  "description": "Collection of essential utilities to work with the Storefront API",
5
5
  "author": "SCAYLE Commerce Engine",
6
6
  "license": "MIT",
@@ -71,7 +71,7 @@
71
71
  "devDependencies": {
72
72
  "@scayle/eslint-config-storefront": "3.2.6",
73
73
  "@types/crypto-js": "4.2.2",
74
- "@types/node": "20.11.17",
74
+ "@types/node": "20.11.19",
75
75
  "@types/webpack-env": "1.18.4",
76
76
  "@vitest/coverage-v8": "1.2.2",
77
77
  "dprint": "0.45.0",