@softwear/latestcollectioncore 1.0.46 → 1.0.48
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.
|
@@ -56,7 +56,9 @@ function default_1(brands, strategy) {
|
|
|
56
56
|
var _a;
|
|
57
57
|
const from = sku[pair.from] || '';
|
|
58
58
|
const to = (_a = mapping === null || mapping === void 0 ? void 0 : mapping[pair.category]) === null || _a === void 0 ? void 0 : _a[from];
|
|
59
|
-
if (
|
|
59
|
+
if (!from || !to)
|
|
60
|
+
return;
|
|
61
|
+
if (sku[pair.to] == to || from == sku[pair.to])
|
|
60
62
|
delete sku[pair.to];
|
|
61
63
|
});
|
|
62
64
|
return sku;
|
package/dist/hashBrand.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
function default_1(brand =
|
|
4
|
-
if (typeof brand !=
|
|
5
|
-
return
|
|
6
|
-
const charactersToRemove =
|
|
3
|
+
function default_1(brand = '') {
|
|
4
|
+
if (typeof brand != 'string')
|
|
5
|
+
return '';
|
|
6
|
+
const charactersToRemove = '~.<>!@#$%^&*():\'"? /-\\';
|
|
7
7
|
const l = brand.length;
|
|
8
|
-
let result =
|
|
8
|
+
let result = '';
|
|
9
9
|
for (let i = 0; i < l; i++) {
|
|
10
10
|
const c = brand.charAt(i);
|
|
11
11
|
if (!charactersToRemove.includes(c))
|
package/package.json
CHANGED
|
@@ -52,7 +52,8 @@ export default function (brands: Array<BrandSettingI>, strategy: mappingStrategy
|
|
|
52
52
|
mappingPairs.forEach((pair) => {
|
|
53
53
|
const from = sku[pair.from] || ''
|
|
54
54
|
const to = mapping?.[pair.category]?.[from]
|
|
55
|
-
if (
|
|
55
|
+
if (!from || !to) return
|
|
56
|
+
if (sku[pair.to] == to || from == sku[pair.to]) delete sku[pair.to]
|
|
56
57
|
})
|
|
57
58
|
return sku
|
|
58
59
|
}
|