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 1.0.0 to 1.1.0

2

bower.json
{
"name": "couponable",
"version": "1.0.0",
"version": "1.1.0",
"description": "Helper functions for dealing with coupons.",

@@ -5,0 +5,0 @@ "main": [ "index.js" ],

@@ -28,7 +28,10 @@ function priceFormat(amountInCents) {

function totalDueNow(orderItem) {
function totalDueNow(orderItem, includeShipping) {
var quantity = orderItem.quantity || 0,
total = orderItem.priceInCents;
if (orderItem.shippingOption) {
// default to true
includeShipping = includeShipping === false ? false : true;
if (includeShipping && orderItem.shippingOption) {
total += orderItem.shippingOption.priceInCents || 0;

@@ -35,0 +38,0 @@ }

{
"name": "couponable",
"description": "Helper functions for dealing with coupons.",
"version": "1.0.0",
"version": "1.1.0",
"author": "Chris McC",

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

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

it('calculates correctly without shipping', function() {
assert.equal(totalDueNow({
quantity: 2,
shippingOption: {priceInCents: 2},
variation: {priceInCents: 2},
priceInCents: 2
}, false), 8);
});
it('handles coupons correctly', function() {

@@ -23,0 +32,0 @@ assert.equal(totalDueNow({

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