Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@coinify/currency

Package Overview
Dependencies
Maintainers
2
Versions
57
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@coinify/currency - npm Package Compare versions

Comparing version 1.1.0 to 1.1.1

src/currencies.json

2

package.json
{
"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 @@

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