@nuskin/ns-product-lib 2.14.4 → 2.14.5
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
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@nuskin/ns-product-lib",
|
3
|
-
"version": "2.14.
|
3
|
+
"version": "2.14.5",
|
4
4
|
"description": "This project contains shared Product models and code between the backend and frontend.",
|
5
5
|
"main": "src/index.js",
|
6
6
|
"scripts": {
|
@@ -24,13 +24,13 @@
|
|
24
24
|
"@nuskin/ns-util": "4.5.3",
|
25
25
|
"axios": ">=1.6.5",
|
26
26
|
"axios-mock-adapter": "1.21.2",
|
27
|
-
"eslint": "
|
28
|
-
"eslint-config-google": "0.14.0",
|
29
|
-
"eslint-config-prettier": "
|
30
|
-
"eslint-plugin-json": "
|
31
|
-
"eslint-plugin-prettier": "
|
32
|
-
"jest": "29.
|
33
|
-
"jest-environment-jsdom": "29.
|
27
|
+
"eslint": "^8.56.0",
|
28
|
+
"eslint-config-google": "^0.14.0",
|
29
|
+
"eslint-config-prettier": "^9.1.0",
|
30
|
+
"eslint-plugin-json": "^3.1.0",
|
31
|
+
"eslint-plugin-prettier": "^5.1.3",
|
32
|
+
"jest": "29.7.0",
|
33
|
+
"jest-environment-jsdom": "29.7.0",
|
34
34
|
"jest-sonar-reporter": "2.0.0",
|
35
35
|
"prettier": "1.19.1"
|
36
36
|
},
|
@@ -43,6 +43,10 @@
|
|
43
43
|
"dependencies": {
|
44
44
|
"qs": "6.11.0"
|
45
45
|
},
|
46
|
+
"resolutions": {
|
47
|
+
"word-wrap": "1.2.4",
|
48
|
+
"follow-redirects": "1.15.4"
|
49
|
+
},
|
46
50
|
"files": [
|
47
51
|
"src/"
|
48
52
|
]
|
@@ -7,7 +7,7 @@
|
|
7
7
|
* @returns {number}
|
8
8
|
*/
|
9
9
|
function backOrderDate(product) {
|
10
|
-
if (product.inventoryProperties && product.inventoryProperties.
|
10
|
+
if (product.inventoryProperties && product.inventoryProperties.expectedBackOrderAvailabilityDate) {
|
11
11
|
return product.inventoryProperties.expectedBackOrderAvailabilityDate;
|
12
12
|
}
|
13
13
|
|
@@ -15,7 +15,7 @@ function mapVariantProperties(properties = {}) {
|
|
15
15
|
model.title = mapTitle(properties.title);
|
16
16
|
model.scanQualifiedCount = mapScanQualifiedCount(properties.scanQualifiedCount);
|
17
17
|
model.division = mapDivision(properties.division);
|
18
|
-
model.isExclusive = mapIsExclusive('false'
|
18
|
+
model.isExclusive = mapIsExclusive('false');
|
19
19
|
model.imageURL = mapImageURL(properties.imageURL);
|
20
20
|
model.customerTypes = mapCustomerTypes(properties.customerTypes);
|
21
21
|
model.ingredients = mapIngredients(properties.ingredients);
|
package/src/productData.js
CHANGED
@@ -144,8 +144,10 @@ const ProductData = {
|
|
144
144
|
* @returns {number} qty
|
145
145
|
*/
|
146
146
|
getAvailableQty: function (inventory) {
|
147
|
-
if (!inventory || (!
|
148
|
-
|| !
|
147
|
+
if (!inventory || (!Object.prototype.hasOwnProperty.call(inventory, 'backOrdered')
|
148
|
+
|| !Object.prototype.hasOwnProperty.call(inventory, 'atpQty')
|
149
|
+
|| !Object.prototype.hasOwnProperty.call(inventory, 'backOrderedQty'))
|
150
|
+
) {
|
149
151
|
return 0;
|
150
152
|
}
|
151
153
|
|