Socket
Socket
Sign inDemoInstall

vanilli-shop-client

Package Overview
Dependencies
Maintainers
1
Versions
115
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vanilli-shop-client - npm Package Compare versions

Comparing version 0.9.17 to 0.9.18

1

dist/models/shipping.d.ts

@@ -8,2 +8,3 @@ export interface IShippingMethodDto {

fee?: number;
freeShippingThreshold?: number;
estimationInDays: number;

@@ -10,0 +11,0 @@ }

24

dist/stores/cart-store.js

@@ -45,13 +45,8 @@ "use strict";

CartStore.prototype.calculateSubTotal = function () {
var _a;
var total = 0;
for (var _i = 0, _b = this.cartItems; _i < _b.length; _i++) {
var item = _b[_i];
for (var _i = 0, _a = this.cartItems; _i < _a.length; _i++) {
var item = _a[_i];
var itemTotal = cart_1.CartItem.getTotal(item);
total = total + itemTotal;
}
var shippingFee = (_a = this.rootStore.shippingStore.selectedMethod) === null || _a === void 0 ? void 0 : _a.fee;
if (shippingFee) {
total = total + shippingFee;
}
return total;

@@ -62,2 +57,9 @@ };

if (shippingMethod) {
var freeShippingThreshold = shippingMethod.freeShippingThreshold;
if (freeShippingThreshold) {
var total = this.calculateSubTotal();
if (total >= freeShippingThreshold) {
return 0;
}
}
return shippingMethod.fee || 0;

@@ -68,3 +70,5 @@ }

CartStore.prototype.calculateTotal = function () {
var total = this.calculateSubTotal();
var subTotal = this.calculateSubTotal();
var shipping = this.calculateShipping();
var total = subTotal + shipping;
var discount = this.calculateDiscount();

@@ -81,3 +85,5 @@ if (discount) {

}
var total = this.calculateSubTotal();
var subTotal = this.calculateSubTotal();
var shipping = this.calculateShipping();
var total = subTotal + shipping;
var discount = discountPercentage / 100;

@@ -84,0 +90,0 @@ return total * discount;

{
"name": "vanilli-shop-client",
"version": "0.9.17",
"version": "0.9.18",
"description": "Client for Vanilli Shop API",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

@@ -8,2 +8,3 @@ export interface IShippingMethodDto {

fee?: number,
freeShippingThreshold?: number,
estimationInDays: number

@@ -10,0 +11,0 @@ }

@@ -36,8 +36,2 @@ import BaseStore from "./base-store";

const shippingFee = this.rootStore.shippingStore.selectedMethod?.fee;
if (shippingFee) {
total = total + shippingFee;
}
return total;

@@ -50,2 +44,12 @@ }

if (shippingMethod) {
const freeShippingThreshold = shippingMethod.freeShippingThreshold;
if (freeShippingThreshold) {
const total = this.calculateSubTotal();
if (total >= freeShippingThreshold) {
return 0;
}
}
return shippingMethod.fee || 0;

@@ -58,3 +62,5 @@ }

calculateTotal(): number {
const total = this.calculateSubTotal();
const subTotal = this.calculateSubTotal();
const shipping = this.calculateShipping();
const total = subTotal + shipping;
const discount = this.calculateDiscount();

@@ -76,3 +82,5 @@

const total = this.calculateSubTotal();
const subTotal = this.calculateSubTotal();
const shipping = this.calculateShipping();
const total = subTotal + shipping;
const discount = discountPercentage / 100;

@@ -79,0 +87,0 @@ return total * discount;

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