@coinify/currency
Advanced tools
Comparing version 1.1.0 to 1.1.1
{ | ||
"name": "@coinify/currency", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "Helper functions for managing amounts in different currencies", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
const _ = require('lodash'); | ||
const constants = require('./constants'); | ||
const constants = require('./currencies.json'); | ||
@@ -17,3 +17,3 @@ /** | ||
return _.get(constants.CURRENCIES_NOT_DIVIDED_IN_HUNDREDS, currency, 2); | ||
return constants[currency].decimals; | ||
} | ||
@@ -122,3 +122,3 @@ | ||
function isValidCurrency(code) { | ||
return isValidFiatCurrency(code) || isValidCryptoCurrency(code); | ||
return constants[code]!==undefined; | ||
} | ||
@@ -133,3 +133,3 @@ | ||
function isValidFiatCurrency(code) { | ||
return _.has(constants.FIAT_CURRENCIES, code); | ||
return isValidCurrency(code) && !constants[code].crypto; | ||
} | ||
@@ -146,3 +146,3 @@ | ||
function isValidCryptoCurrency(code) { | ||
return constants.CRYPTO_CURRENCIES.includes(code); | ||
return isValidCurrency(code) && constants[code].crypto; | ||
} | ||
@@ -149,0 +149,0 @@ |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
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
22816
306
1