@nuskin/ns-product-lib
Advanced tools
Comparing version 2.19.0 to 2.19.1-cx24-70222.1
{ | ||
"name": "@nuskin/ns-product-lib", | ||
"version": "2.19.0", | ||
"version": "2.19.1-cx24-70222.1", | ||
"description": "This project contains shared Product models and code between the backend and frontend.", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -109,10 +109,17 @@ const ProductStatus = require("../models/productStatus"); | ||
function mapSkusToProducts(skus, products){ | ||
function mapSkusToProducts(skus , products){ | ||
let newProducts = products.data.productsById.products.filter((n) => { | ||
return n.id != null | ||
}) | ||
const productsData = []; | ||
if (products && products.length) { | ||
if (products && | ||
products.data && | ||
products.data.productsById && | ||
products.data.productsById.products && | ||
products.data.productsById.products.length) { | ||
skus.forEach((sku)=>{ | ||
const matchedProducts = products.filter((product)=>{ | ||
const matchedProducts = newProducts.filter((product)=>{ | ||
let matched = false; | ||
if(product.id) {matched = product.id === sku;} | ||
if(product.variants && product.variants.length){ | ||
if(product.variants.length){ | ||
product.variants.forEach((variant)=>{ | ||
@@ -133,2 +140,3 @@ matched |= variant.sku === sku; | ||
/** | ||
@@ -135,0 +143,0 @@ * |
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
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
128061
3759
1