@nuskin/ns-product-lib 2.14.4 → 2.14.5

Sign up to get free protection for your applications and to get access to all the features.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuskin/ns-product-lib",
3
- "version": "2.14.4",
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": "5.16.0",
28
- "eslint-config-google": "0.14.0",
29
- "eslint-config-prettier": "4.1.0",
30
- "eslint-plugin-json": "2.1.1",
31
- "eslint-plugin-prettier": "3.1.2",
32
- "jest": "29.2.2",
33
- "jest-environment-jsdom": "29.2.2",
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.hasOwnProperty('expectedBackOrderAvailabilityDate')) {
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);
@@ -144,8 +144,10 @@ const ProductData = {
144
144
  * @returns {number} qty
145
145
  */
146
146
  getAvailableQty: function (inventory) {
147
- if (!inventory || (!inventory.hasOwnProperty('backOrdered')
148
- || !inventory.hasOwnProperty('atpQty') || !inventory.hasOwnProperty('backOrderedQty'))) {
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