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 1.3.1 to 1.3.2

19

dist/models/product.js

@@ -41,13 +41,14 @@ "use strict";

ProductDetails.getPrice = function (defaultPrice, parameters) {
var maxPrice = defaultPrice;
if (parameters) {
for (var _i = 0, parameters_1 = parameters; _i < parameters_1.length; _i++) {
var parameter = parameters_1[_i];
var price = parameter.price;
if (price && price > maxPrice) {
maxPrice = price;
}
if (!parameters) {
return defaultPrice;
}
var maxPrice = 0;
for (var _i = 0, parameters_1 = parameters; _i < parameters_1.length; _i++) {
var parameter = parameters_1[_i];
var price = parameter.price;
if (price && price > maxPrice) {
maxPrice = price;
}
}
return maxPrice;
return maxPrice > 0 ? maxPrice : defaultPrice;
};

@@ -54,0 +55,0 @@ ProductDetails.getProperty = function (properties, key) {

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

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

@@ -66,15 +66,17 @@ import {IBaseDto, IPropertyDto} from "./base";

static getPrice(defaultPrice: number, parameters?: IParameter[]): number {
let maxPrice = defaultPrice;
if (!parameters) {
return defaultPrice;
}
if (parameters) {
for (const parameter of parameters) {
const price = parameter.price;
let maxPrice = 0;
if (price && price > maxPrice) {
maxPrice = price;
}
for (const parameter of parameters) {
const price = parameter.price;
if (price && price > maxPrice) {
maxPrice = price;
}
}
return maxPrice;
return maxPrice > 0 ? maxPrice : defaultPrice;
}

@@ -81,0 +83,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