@nuskin/ns-product-lib
Advanced tools
Comparing version 2.17.0-cx24-5822.7 to 2.17.0-cx24-5822.8
{ | ||
"name": "@nuskin/ns-product-lib", | ||
"version": "2.17.0-cx24-5822.7", | ||
"version": "2.17.0-cx24-5822.8", | ||
"description": "This project contains shared Product models and code between the backend and frontend.", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -148,8 +148,12 @@ const axios = require('axios').default; | ||
const productsData = []; | ||
if (products?.data?.productsById?.products?.length) { | ||
if (products && | ||
products.data && | ||
products.data.productsById && | ||
products.data.productsById.products && | ||
products.data.productsById.products.length) { | ||
skus.forEach((sku)=>{ | ||
const matchedProducts = products.data.productsById.products.filter((product)=>{ | ||
let matched = false; | ||
if(product?.id) {matched = product.id === sku;} | ||
if(product?.variants?.length){ | ||
if(product.id) {matched = product.id === sku;} | ||
if(product.variants.length){ | ||
product.variants.forEach((variant)=>{ | ||
@@ -156,0 +160,0 @@ matched |= variant.sku === sku; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
145868
4914