@nuskin/cs-product-lib 1.6.2-nge1-4189.1 → 1.6.2
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/helpers.js +3 -3
package/package.json
CHANGED
package/src/helpers.js
CHANGED
|
@@ -1214,16 +1214,16 @@ function mapUnitPrice(unitPrice) {
|
|
|
1214
1214
|
const unitQuantity = unitPrice.unit_quantity !== undefined ? unitPrice.unit_quantity : unitPrice.unitQuantity
|
|
1215
1215
|
const unitOfMeasure = unitPrice.unit_of_measure !== undefined ? unitPrice.unit_of_measure : unitPrice.unitOfMeasure
|
|
1216
1216
|
|
|
1217
|
-
if (unitQuantity != null && (
|
|
1217
|
+
if (unitQuantity != null && (!Number.isFinite(unitQuantity) || unitQuantity <= 0)) {
|
|
1218
1218
|
return null
|
|
1219
1219
|
}
|
|
1220
|
-
if (
|
|
1220
|
+
if (typeof unitOfMeasure !== 'string' || unitOfMeasure.trimEnd().length === 0) {
|
|
1221
1221
|
return null
|
|
1222
1222
|
}
|
|
1223
1223
|
|
|
1224
1224
|
return {
|
|
1225
1225
|
unitQuantity,
|
|
1226
|
-
unitOfMeasure:
|
|
1226
|
+
unitOfMeasure: unitOfMeasure.trimEnd()
|
|
1227
1227
|
}
|
|
1228
1228
|
}
|
|
1229
1229
|
|