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

@exodus/currency

Package Overview
Dependencies
Maintainers
0
Versions
46
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@exodus/currency - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

5

CHANGELOG.md

@@ -0,1 +1,6 @@

1.0.2 / 2019-06-19
------------------
- Parameter type checking in conversion-by-rate
1.0.1 / 2019-06-12

@@ -2,0 +7,0 @@ ------------------

@@ -8,3 +8,8 @@ "use strict";

var _unitType = _interopRequireDefault(require("./unit-type"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function conversionByRate(ut1, ut2, rate, opts = {}) {
if (!(ut1 instanceof _unitType.default) || !(ut2 instanceof _unitType.default)) throw new Error('Must pass in an instance of UnitType for ut1 and ut2.');
const {

@@ -17,2 +22,4 @@ unit1,

}, opts);
if (!ut1[unit1]) throw new Error(`unit1 (${unit1}) is not from ut1`);
if (!ut2[unit2]) throw new Error(`unit2 (${unit2}) is not from ut2`);

@@ -19,0 +26,0 @@ let converter = function converter(someNumberUnit) {

5

lib/number-unit.js

@@ -63,3 +63,6 @@ "use strict";

} = {}) {
if (typeof num === 'number') num = num.toString();else num = num.toLowerCase();
if (typeof num === 'number') {
if (num === Infinity || num === -Infinity) throw new Error('Infinity is not supported');
num = num.toString();
} else num = num.toLowerCase();

@@ -66,0 +69,0 @@ if (num.length > 2 && num[0] === '0' && num[1] === 'x') {

2

package.json
{
"name": "@exodus/currency",
"version": "1.0.1",
"version": "1.0.2",
"description": "Currency support.",

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

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