@nuskin/cs-product-lib 1.5.0-td-3879.5 → 1.5.0
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/package.json +1 -1
- package/src/csProduct.js +1 -1
- package/src/formatVariant.js +1 -1
- package/src/helpers.js +21 -11
package/package.json
CHANGED
package/src/csProduct.js
CHANGED
package/src/formatVariant.js
CHANGED
|
@@ -120,7 +120,7 @@ const formatVariant = (parent) => {
|
|
|
120
120
|
foreignOrderLimit: helpers?.getBestSkuData(parent)?.foreign_limit,
|
|
121
121
|
orderType: parent.sap_data?.order_type,
|
|
122
122
|
discontinuedSkuReplacement: helpers?.mapDiscontinuedSkuReplacement(parent)?.sku,
|
|
123
|
-
prysmData: helpers?.
|
|
123
|
+
prysmData: helpers?.mapPrysmData(parent)
|
|
124
124
|
}
|
|
125
125
|
}
|
|
126
126
|
|
package/src/helpers.js
CHANGED
|
@@ -1179,21 +1179,31 @@ function mapDiscontinuedSkuReplacement (product) {
|
|
|
1179
1179
|
}
|
|
1180
1180
|
}
|
|
1181
1181
|
|
|
1182
|
-
function
|
|
1182
|
+
function mapPrysmData(product){
|
|
1183
1183
|
const prysmBadgeGroup = product?.prysm;
|
|
1184
1184
|
const prysmBadge = prysmBadgeGroup?.badge?.[0];
|
|
1185
|
-
|
|
1185
|
+
const parsedPrysmBadge = parsePrysmBadge(prysmBadge);
|
|
1186
|
+
const prysmFunction = prysmBadgeGroup?.function;
|
|
1187
|
+
if(isNullOrEmpty(prysmFunction) && isNullOrEmpty(parsedPrysmBadge)){
|
|
1188
|
+
return null;
|
|
1189
|
+
}
|
|
1190
|
+
return {
|
|
1191
|
+
function: prysmFunction,
|
|
1192
|
+
badge: parsedPrysmBadge
|
|
1193
|
+
}
|
|
1186
1194
|
}
|
|
1187
1195
|
|
|
1188
|
-
function parsePrysmBadge(badge
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
+
function parsePrysmBadge(badge) {
|
|
1197
|
+
if(!isNullOrEmpty(badge)){
|
|
1198
|
+
return {
|
|
1199
|
+
uid: badge?.uid,
|
|
1200
|
+
icon: mapImage(badge?.icon, true, 80, 80, 95, null, true)?.url,
|
|
1201
|
+
label: badge?.label,
|
|
1202
|
+
link: badge?.link?.href,
|
|
1203
|
+
type: badge?.type
|
|
1204
|
+
}
|
|
1196
1205
|
}
|
|
1206
|
+
return null;
|
|
1197
1207
|
}
|
|
1198
1208
|
|
|
1199
1209
|
module.exports = {
|
|
@@ -1243,6 +1253,6 @@ module.exports = {
|
|
|
1243
1253
|
mapActiveEventDisclaimer,
|
|
1244
1254
|
isTopCategory,
|
|
1245
1255
|
mapDiscontinuedSkuReplacement,
|
|
1246
|
-
|
|
1256
|
+
mapPrysmData,
|
|
1247
1257
|
parsePrysmBadge
|
|
1248
1258
|
}
|