vanilli-shop-client
Advanced tools
Comparing version 1.6.8 to 1.6.9
@@ -34,2 +34,3 @@ import { IBaseDto, IPropertyDto } from "./base"; | ||
static getLinkWithCategory(product: IProductDto): string; | ||
private static parseCategoryName; | ||
static getDiscountPercentage(product: IProductBaseDto): number; | ||
@@ -36,0 +37,0 @@ static hasStock(product: IProductBaseDto): boolean; |
@@ -26,4 +26,14 @@ "use strict"; | ||
} | ||
return "/products/" + product.categoryName + "/" + ref + "?refType=" + refType; | ||
var category = this.parseCategoryName(product); | ||
return "/products/" + category + "/" + ref + "?refType=" + refType; | ||
}; | ||
Product.parseCategoryName = function (product) { | ||
var category = product.categoryName; | ||
category = category.replace("/", "-"); | ||
category = category.replace(" ", "-"); | ||
category = category.replace("õ", "o"); | ||
category = category.replace("ä", "a"); | ||
category = category.replace("ö", "o"); | ||
return category.replace("ü", "u"); | ||
}; | ||
Product.getDiscountPercentage = function (product) { | ||
@@ -30,0 +40,0 @@ var discountPrice = product.discountPrice; |
{ | ||
"name": "vanilli-shop-client", | ||
"version": "1.6.8", | ||
"version": "1.6.9", | ||
"description": "Client for Vanilli Shop API", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -57,5 +57,16 @@ import {IBaseDto, IPropertyDto} from "./base"; | ||
return `/products/${product.categoryName}/${ref}?refType=${refType}`; | ||
const category = this.parseCategoryName(product); | ||
return `/products/${category}/${ref}?refType=${refType}`; | ||
} | ||
private static parseCategoryName(product: IProductDto) { | ||
let category = product.categoryName; | ||
category = category.replace("/", "-"); | ||
category = category.replace(" ", "-"); | ||
category = category.replace("õ", "o"); | ||
category = category.replace("ä", "a"); | ||
category = category.replace("ö", "o"); | ||
return category.replace("ü", "u"); | ||
} | ||
static getDiscountPercentage(product: IProductBaseDto): number { | ||
@@ -62,0 +73,0 @@ const discountPrice = product.discountPrice; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
271386
6054