@nuskin/ns-product-lib 2.15.0 → 2.15.2

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.15.0",
3
+ "version": "2.15.2",
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": {
@@ -21,7 +21,7 @@
21
21
  "devDependencies": {
22
22
  "@nuskin/configuration-sdk": "2.3.2",
23
23
  "@nuskin/ns-common-lib": "1.4.7",
24
- "@nuskin/ns-util": "4.5.3",
24
+ "@nuskin/ns-util": "4.5.4",
25
25
  "axios": ">=1.6.5",
26
26
  "axios-mock-adapter": "1.21.2",
27
27
  "eslint": "^8.56.0",
@@ -45,7 +45,9 @@
45
45
  },
46
46
  "resolutions": {
47
47
  "word-wrap": "1.2.4",
48
- "follow-redirects": "1.15.4"
48
+ "follow-redirects": "1.15.4",
49
+ "tough-cookie": "4.1.3",
50
+ "moment-timezone": "0.5.35"
49
51
  },
50
52
  "files": [
51
53
  "src/"
@@ -7,7 +7,7 @@
7
7
  * @returns {number}
8
8
  */
9
9
  function backOrderDate(product) {
10
- if (product.inventoryProperties && product.inventoryProperties.expectedBackOrderAvailabilityDate) {
10
+ if (product.inventoryProperties && Object.hasOwnProperty.call(product.inventoryProperties, 'expectedBackOrderAvailabilityDate')) {
11
11
  return product.inventoryProperties.expectedBackOrderAvailabilityDate;
12
12
  }
13
13
 
@@ -25,12 +25,12 @@ const ProductData = {
25
25
 
26
26
  const config = (await getConfiguration(['Equinox_Markets'])).Equinox_Markets;
27
27
  if (config.active) {
28
- return (config.MySite_graphql_active_list.includes(market)) ?
29
- await getProduct(skus[0], market, locale, config) :
28
+ return (config.MySite_graphql_active_list.includes(market)) ?
29
+ await getProduct(skus[0], market, locale, config) :
30
30
  await this.getProductFromEquinox(skus, localeMarket, config)
31
31
  } else {
32
- return (config.MySite_graphql_active_list.includes(market)) ?
33
- await getProduct(skus[0], market, locale, config) :
32
+ return (config.MySite_graphql_active_list.includes(market)) ?
33
+ await getProduct(skus[0], market, locale, config) :
34
34
  await this.getProductFromLegacy(skus, localeMarket);
35
35
  }
36
36
 
@@ -150,10 +150,8 @@ const ProductData = {
150
150
  * @returns {number} qty
151
151
  */
152
152
  getAvailableQty: function (inventory) {
153
- if (!inventory || (!Object.prototype.hasOwnProperty.call(inventory, 'backOrdered')
154
- || !Object.prototype.hasOwnProperty.call(inventory, 'atpQty')
155
- || !Object.prototype.hasOwnProperty.call(inventory, 'backOrderedQty'))
156
- ) {
153
+ if (!inventory || !Object.hasOwnProperty.call(inventory, 'backOrdered')
154
+ || !Object.hasOwnProperty.call(inventory, 'atpQty') || !Object.hasOwnProperty.call(inventory, 'backOrderedQty')) {
157
155
  return 0;
158
156
  }
159
157