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

@makerdao/currency

Package Overview
Dependencies
Maintainers
19
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@makerdao/currency - npm Package Compare versions

Comparing version 0.9.8 to 0.9.9

1

dist/Currency.js

@@ -50,3 +50,2 @@ 'use strict';

var value = (0, _bignumber2.default)(amount);
if (value.lt(0)) throw new Error('amount cannot be negative');
if (value.isNaN()) throw new Error('amount "' + amount + '" is not a number');

@@ -53,0 +52,0 @@ return value;

2

package.json
{
"name": "@makerdao/currency",
"description": "Utilities for working with currency amounts",
"version": "0.9.8",
"version": "0.9.9",
"license": "MIT",

@@ -6,0 +6,0 @@ "main": "dist/index.js",

@@ -8,3 +8,2 @@ import BigNumber from 'bignumber.js';

const value = BigNumber(amount);
if (value.lt(0)) throw new Error('amount cannot be negative');
if (value.isNaN()) throw new Error(`amount "${amount}" is not a number`);

@@ -11,0 +10,0 @@ return value;

@@ -61,8 +61,2 @@ import { createCurrency, createGetCurrency } from '../src';

test('throws an error if amount is negative', () => {
expect(() => {
getCurrency('-1', 'eth');
}).toThrowError('amount cannot be negative');
});
test('throws an error if symbol is unrecognized', () => {

@@ -69,0 +63,0 @@ expect(() => {

import { Currency, createCurrency, createCurrencyRatio } from '../src';
import BigNumber from 'bignumber.js';

@@ -148,1 +149,6 @@ const DAI = createCurrency('DAI');

});
test('constructor flexibility', () => {
const val = ETH({ toBigNumber: () => BigNumber(5) });
expect(val.eq(5)).toBeTruthy();
});
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