@backpackjs/transform-product-feed
Advanced tools
Comparing version 4.2.0 to 4.2.1-canary.47.2552574952.0
@@ -12,8 +12,8 @@ "use strict"; | ||
return feed.toRSS({ | ||
title: '', | ||
description: '', | ||
title: "", | ||
description: "", | ||
link: process.env.SITE_URL, | ||
}, { pretty: false }); | ||
}; | ||
const filterDraft = (product) => product.status.toLowerCase() !== 'draft'; | ||
const filterDraft = (product) => product.status.toLowerCase() !== "draft"; | ||
const getProduct = (products) => (handle) => { | ||
@@ -39,4 +39,4 @@ return products.find((product) => product.handle === handle); | ||
brand: product.vendor, | ||
condition: 'new', | ||
availability: variant.availableForSale ? 'in stock' : 'out of stock', | ||
condition: "new", | ||
availability: variant.availableForSale ? "in stock" : "out of stock", | ||
inventory: String(variant.inventoryQuantity), | ||
@@ -61,7 +61,7 @@ shipping_weight: `${variant.weight} ${variant.weightUnit}`, | ||
.flatMap(getFeedItems); | ||
await fs_extra_1.default.outputFile(path_1.default.resolve(input.context.target, 'public/product-feed.xml'), buildXML(feedItems)); | ||
await fs_extra_1.default.outputFile(path_1.default.resolve(input.context.target, "public/product-feed.xml"), buildXML(feedItems)); | ||
return input; | ||
} | ||
catch (error) { | ||
input._task.title = `❌ error in Product Feed Transform: ${error.message}`; | ||
input.task.title = `❌ error in Product Feed Transform: ${error.message}`; | ||
return input; | ||
@@ -68,0 +68,0 @@ // throw error; |
{ | ||
"name": "@backpackjs/transform-product-feed", | ||
"version": "4.2.0", | ||
"version": "4.2.1-canary.47.2552574952.0", | ||
"license": "MIT", | ||
@@ -22,3 +22,3 @@ "author": "BackpackJS <dev@packdigial.com> (http://packdigital.com/)", | ||
}, | ||
"gitHead": "ff414f68854e024e4344a7ff8b16619afd4ce474" | ||
"gitHead": "4ee331912d8ddeca478c2aeaa12f69aaaa8c5d27" | ||
} |
/* eslint-disable camelcase */ | ||
import path from 'path'; | ||
import fs from 'fs-extra'; | ||
import fbcatalog from 'fbcatalog'; | ||
import path from "path"; | ||
import fs from "fs-extra"; | ||
import fbcatalog from "fbcatalog"; | ||
@@ -13,4 +13,4 @@ const buildXML = (feedItems) => { | ||
{ | ||
title: '', | ||
description: '', | ||
title: "", | ||
description: "", | ||
link: process.env.SITE_URL, | ||
@@ -22,3 +22,3 @@ }, | ||
const filterDraft = (product) => product.status.toLowerCase() !== 'draft'; | ||
const filterDraft = (product) => product.status.toLowerCase() !== "draft"; | ||
@@ -48,4 +48,4 @@ const getProduct = (products) => (handle) => { | ||
brand: product.vendor, | ||
condition: 'new', | ||
availability: variant.availableForSale ? 'in stock' : 'out of stock', | ||
condition: "new", | ||
availability: variant.availableForSale ? "in stock" : "out of stock", | ||
inventory: String(variant.inventoryQuantity), | ||
@@ -74,3 +74,3 @@ shipping_weight: `${variant.weight} ${variant.weightUnit}`, | ||
await fs.outputFile( | ||
path.resolve(input.context.target, 'public/product-feed.xml'), | ||
path.resolve(input.context.target, "public/product-feed.xml"), | ||
buildXML(feedItems) | ||
@@ -81,3 +81,3 @@ ); | ||
} catch (error) { | ||
input._task.title = `❌ error in Product Feed Transform: ${error.message}`; | ||
input.task.title = `❌ error in Product Feed Transform: ${error.message}`; | ||
return input; | ||
@@ -84,0 +84,0 @@ // throw error; |
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
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
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
9741
9
2