@depay/local-currency
Advanced tools
Comparing version 3.7.0 to 3.8.0
@@ -457,2 +457,18 @@ var timezoneToCurrency = { | ||
static fromUSDSync({ amount, code, timeZone }) { | ||
let currency = new Currency({ amount, code, timeZone }); | ||
const cacheKey = Currency.getCacheKey(currency.code); | ||
let cachedValue = localStorage.getItem(cacheKey); | ||
let rate; | ||
if(cachedValue) { | ||
rate = cachedValue; | ||
} else { | ||
Currency.fromUSD({ amount, code, timeZone }); | ||
currency.code = "USD"; | ||
rate = 1; | ||
} | ||
currency.amount = currency.amount * rate; | ||
return currency | ||
} | ||
static async fromUSD({ amount, code, timeZone }) { | ||
@@ -459,0 +475,0 @@ let currency = new Currency({ amount, code, timeZone }); |
@@ -463,2 +463,18 @@ (function (global, factory) { | ||
static fromUSDSync({ amount, code, timeZone }) { | ||
let currency = new Currency({ amount, code, timeZone }); | ||
const cacheKey = Currency.getCacheKey(currency.code); | ||
let cachedValue = localStorage.getItem(cacheKey); | ||
let rate; | ||
if(cachedValue) { | ||
rate = cachedValue; | ||
} else { | ||
Currency.fromUSD({ amount, code, timeZone }); | ||
currency.code = "USD"; | ||
rate = 1; | ||
} | ||
currency.amount = currency.amount * rate; | ||
return currency | ||
} | ||
static async fromUSD({ amount, code, timeZone }) { | ||
@@ -465,0 +481,0 @@ let currency = new Currency({ amount, code, timeZone }); |
{ | ||
"name": "@depay/local-currency", | ||
"moduleName": "LocalCurrency", | ||
"version": "3.7.0", | ||
"version": "3.8.0", | ||
"description": "JavaScript library that detects user's local currency and provides functionalities to convert between multiple currencies.", | ||
@@ -6,0 +6,0 @@ "main": "dist/umd/index.js", |
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
35768
1017
428