@backpackjs/transform-product-feed
Advanced tools
Comparing version 4.27.9-next.0 to 4.27.9-next.1
@@ -18,3 +18,2 @@ "use strict"; | ||
const filterDraft = (product) => product.status.toLowerCase() !== 'draft'; | ||
const filterOutItemsTaggedNoIndex = (product) => !product.tags.includes('no-index') && !product.tags.includes('no index'); | ||
const getProduct = (products) => (handle) => { | ||
@@ -70,3 +69,3 @@ return products.find((product) => product.handle === handle); | ||
const remainingItemsCount = invalidItems.length - 5; | ||
const invalidItemsList = invalidItems.slice(0, 5).map((item) => item.id); | ||
const invalidItemsList = invalidItems.slice(0, 5).map((item) => item.handle); | ||
if (remainingItemsCount > 0) { | ||
@@ -76,5 +75,5 @@ invalidItemsList.push(`... ${remainingItemsCount} more items`); | ||
if (invalidItems.length > 0) { | ||
const message = `The following ids are invalid and will be removed from the feed:`; | ||
const items = `- [ ${invalidItemsList.join(', ')} ]`; | ||
log.error(`${message}\n${items}`); | ||
const message = `The following products have a property that is null or undefined and were not included:`; | ||
log.error(message); | ||
invalidItemsList.forEach((item) => log.error(`• ${item}`)); | ||
} | ||
@@ -87,3 +86,2 @@ }; | ||
.filter(filterDraft) | ||
.filter(filterOutItemsTaggedNoIndex) | ||
.flatMap(getFeedItems); | ||
@@ -90,0 +88,0 @@ logInvalidItems(feedItems, log); |
{ | ||
"name": "@backpackjs/transform-product-feed", | ||
"version": "4.27.9-next.0", | ||
"version": "4.27.9-next.1", | ||
"license": "MIT", | ||
@@ -25,3 +25,3 @@ "author": "BackpackJS <dev@packdigial.com> (http://packdigital.com/)", | ||
}, | ||
"gitHead": "c344aade5446c5ca0733872cce61d310330250f9" | ||
"gitHead": "b227d9af9e46c747b7b6373baed6011936cc08d0" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
9917
97