New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

couponable

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

couponable - npm Package Compare versions

Comparing version 6.0.0 to 6.0.1

6

index.js

@@ -35,3 +35,3 @@ // if the comma or decimal portions of the price need internationalization

var quantity = orderItem.quantity || 0,
total = orderItem.priceInCents;
total = orderItem.priceInCents;

@@ -43,2 +43,6 @@ if (orderItem.variation) {

if (orderItem.coupon) {
if (orderItem.purchasableType === 'bundle' && quantity > 1) {
total = total * quantity;
quantity = 1;
}
total = Math.round(discountable(total, orderItem.coupon.percentOff, orderItem.coupon.amountOffInCents));

@@ -45,0 +49,0 @@ }

2

package.json
{
"name": "couponable",
"description": "Helper functions for dealing with coupons.",
"version": "6.0.0",
"version": "6.0.1",
"author": "Chris McC",

@@ -6,0 +6,0 @@ "license": "MIT",

@@ -33,2 +33,11 @@ var couponable = require('.');

});
it('handles coupons for bundles correctly', function() {
assert.equal(totalDueNow({
quantity: 10,
coupon: {amountOffInCents: 5},
priceInCents: 10,
purchasableType: 'bundle'
}), 95)
});
});

@@ -35,0 +44,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc