@softwear/latestcollectioncore 1.0.51 → 1.0.52

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.
@@ -84,10 +84,13 @@ function default_1(brands, strategy) {
84
84
  const to = ((_b = mapping === null || mapping === void 0 ? void 0 : mapping[pair.category]) === null || _b === void 0 ? void 0 : _b[from]) || ((_c = mapping === null || mapping === void 0 ? void 0 : mapping[pair.category]) === null || _c === void 0 ? void 0 : _c['']) || ((_d = redirectedMapping === null || redirectedMapping === void 0 ? void 0 : redirectedMapping[pair.category]) === null || _d === void 0 ? void 0 : _d[from]) || ((_e = redirectedMapping === null || redirectedMapping === void 0 ? void 0 : redirectedMapping[pair.category]) === null || _e === void 0 ? void 0 : _e['']);
85
85
  if (!from && !to)
86
86
  return;
87
- if (pair.mustMatch && to)
88
- sku[pair.to] = to;
89
- else
87
+ if (pair.mustMatch) {
88
+ if (to)
89
+ sku[pair.to] = to;
90
+ }
91
+ else {
90
92
  sku[pair.to] = to ? to : from;
93
+ }
91
94
  });
92
95
  return sku;
93
96
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@softwear/latestcollectioncore",
3
- "version": "1.0.51",
3
+ "version": "1.0.52",
4
4
  "description": "Core functions for LatestCollections applications",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -74,8 +74,11 @@ export default function (brands: Array<BrandSettingI>, strategy: mappingStrategy
74
74
 
75
75
  const to = mapping?.[pair.category]?.[from] || mapping?.[pair.category]?.[''] || redirectedMapping?.[pair.category]?.[from] || redirectedMapping?.[pair.category]?.['']
76
76
  if (!from && !to) return
77
- if (pair.mustMatch && to) sku[pair.to] = to
78
- else sku[pair.to] = to ? to : from
77
+ if (pair.mustMatch) {
78
+ if (to) sku[pair.to] = to
79
+ } else {
80
+ sku[pair.to] = to ? to : from
81
+ }
79
82
  })
80
83
  return sku
81
84
  }