@softwear/latestcollectioncore 1.0.18 → 1.0.20
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.
|
@@ -89,8 +89,8 @@ function default_1(brands) {
|
|
|
89
89
|
const from = sku.sizeSupplier;
|
|
90
90
|
if (from) {
|
|
91
91
|
const to = indexedPropertyMapping[brand].CustomSize[from];
|
|
92
|
-
if (to && to != sku["
|
|
93
|
-
sku["
|
|
92
|
+
if (to && to != sku["_customsize"])
|
|
93
|
+
sku["_customsize"] = to;
|
|
94
94
|
}
|
|
95
95
|
}
|
|
96
96
|
return sku;
|
package/dist/types.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -81,7 +81,7 @@ export default function (brands: Array<any>): (sku: SkuI) => SkuI {
|
|
|
81
81
|
const from = sku.sizeSupplier
|
|
82
82
|
if (from) {
|
|
83
83
|
const to = indexedPropertyMapping[brand].CustomSize[from]
|
|
84
|
-
if (to && to != sku["
|
|
84
|
+
if (to && to != sku["_customsize"]) sku["_customsize"] = to
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
87
|
return sku
|
package/src/types.ts
CHANGED
|
@@ -15,6 +15,7 @@ const skus = [
|
|
|
15
15
|
colorCodeSupplier: "100",
|
|
16
16
|
colorFamily: "White",
|
|
17
17
|
size: "S",
|
|
18
|
+
sizeSupplier: "S",
|
|
18
19
|
},
|
|
19
20
|
{
|
|
20
21
|
id: "1234567890129",
|
|
@@ -24,6 +25,7 @@ const skus = [
|
|
|
24
25
|
colorCodeSupplier: "100",
|
|
25
26
|
colorFamily: "White",
|
|
26
27
|
size: "M",
|
|
28
|
+
sizeSupplier: "M",
|
|
27
29
|
},
|
|
28
30
|
{
|
|
29
31
|
id: "1234567890130",
|
|
@@ -33,6 +35,7 @@ const skus = [
|
|
|
33
35
|
colorCodeSupplier: "100",
|
|
34
36
|
colorFamily: "White",
|
|
35
37
|
size: "L",
|
|
38
|
+
sizeSupplier: "L",
|
|
36
39
|
},
|
|
37
40
|
{
|
|
38
41
|
id: "1234567890131",
|
|
@@ -42,6 +45,7 @@ const skus = [
|
|
|
42
45
|
colorCodeSupplier: "200",
|
|
43
46
|
colorFamily: "Blue",
|
|
44
47
|
size: "S",
|
|
48
|
+
sizeSupplier: "S",
|
|
45
49
|
},
|
|
46
50
|
{
|
|
47
51
|
id: "1234567890132",
|
|
@@ -51,6 +55,7 @@ const skus = [
|
|
|
51
55
|
colorCodeSupplier: "200",
|
|
52
56
|
colorFamily: "Blue",
|
|
53
57
|
size: "M",
|
|
58
|
+
sizeSupplier: "M",
|
|
54
59
|
},
|
|
55
60
|
{
|
|
56
61
|
id: "1234567890133",
|
|
@@ -60,6 +65,7 @@ const skus = [
|
|
|
60
65
|
colorCodeSupplier: "200",
|
|
61
66
|
colorFamily: "Blue",
|
|
62
67
|
size: "L",
|
|
68
|
+
sizeSupplier: "L",
|
|
63
69
|
},
|
|
64
70
|
{
|
|
65
71
|
id: "1234567890134",
|
|
@@ -69,6 +75,7 @@ const skus = [
|
|
|
69
75
|
colorCodeSupplier: "200",
|
|
70
76
|
colorFamily: "Blue",
|
|
71
77
|
size: "S",
|
|
78
|
+
sizeSupplier: "S",
|
|
72
79
|
},
|
|
73
80
|
{
|
|
74
81
|
id: "1234567890135",
|
|
@@ -78,6 +85,7 @@ const skus = [
|
|
|
78
85
|
colorCodeSupplier: "200",
|
|
79
86
|
colorFamily: "Blue",
|
|
80
87
|
size: "M",
|
|
88
|
+
sizeSupplier: "M",
|
|
81
89
|
},
|
|
82
90
|
{
|
|
83
91
|
id: "1234567890136",
|
|
@@ -87,6 +95,7 @@ const skus = [
|
|
|
87
95
|
colorCodeSupplier: "200",
|
|
88
96
|
colorFamily: "Blue",
|
|
89
97
|
size: "L",
|
|
98
|
+
sizeSupplier: "L",
|
|
90
99
|
},
|
|
91
100
|
]
|
|
92
101
|
|
|
@@ -122,7 +131,10 @@ const fullMapping = [
|
|
|
122
131
|
},
|
|
123
132
|
{
|
|
124
133
|
id: "gstar",
|
|
125
|
-
propertyMapping: [
|
|
134
|
+
propertyMapping: [
|
|
135
|
+
{ category: "Collection", from: "SUMMER 2022", to: "22zomer" },
|
|
136
|
+
{ category: "CustomSize", from: "M", to: "medium" },
|
|
137
|
+
],
|
|
126
138
|
},
|
|
127
139
|
]
|
|
128
140
|
|
|
@@ -204,5 +216,8 @@ describe("applyPropertyMapping", () => {
|
|
|
204
216
|
expect(mappedSkus[6].collection).to.equal("22zomer")
|
|
205
217
|
expect(mappedSkus[7].collection).to.equal("22zomer")
|
|
206
218
|
expect(mappedSkus[8].collection).to.equal("22zomer")
|
|
219
|
+
|
|
220
|
+
expect(mappedSkus[1]._customsize).to.equal(undefined)
|
|
221
|
+
expect(mappedSkus[7]._customsize).to.equal("medium")
|
|
207
222
|
})
|
|
208
223
|
})
|