Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
result.items = result.items.map((item) => {
let sgnObj = item
if (config.tax.calculateServerSide === true) {
sgnObj = { priceInclTax: item.price_info.final_price }
} else {
sgnObj = { price: item.price_info.extension_attributes.tax_adjustments.final_price }
}
item.sgn = hmac.sign(sgnSrc(sgnObj, item), config.objHashSecret); // for products we sign off only price and id becase only such data is getting back with orders
return item
})
apiStatus(res, result, 200);