@makerdao/currency
Advanced tools
Comparing version 0.9.5 to 0.9.6
@@ -139,3 +139,5 @@ 'use strict'; | ||
function assertValidOperation(method, left, right) { | ||
var message = 'Invalid operation: ' + left.symbol + ' ' + method + ' ' + right.symbol; | ||
if (!right && right !== 0) { | ||
throw new Error('Invalid operation: ' + left.symbol + ' ' + method + ' with no right operand'); | ||
} | ||
@@ -163,3 +165,3 @@ if (!(right instanceof Currency) || left.isSameType(right)) return; | ||
throw new Error(message); | ||
throw new Error('Invalid operation: ' + left.symbol + ' ' + method + ' ' + right.symbol); | ||
} | ||
@@ -166,0 +168,0 @@ |
{ | ||
"name": "@makerdao/currency", | ||
"description": "Utilities for working with currency amounts", | ||
"version": "0.9.5", | ||
"version": "0.9.6", | ||
"license": "MIT", | ||
@@ -6,0 +6,0 @@ "main": "dist/index.js", |
@@ -87,3 +87,7 @@ import BigNumber from 'bignumber.js'; | ||
function assertValidOperation(method, left, right) { | ||
const message = `Invalid operation: ${left.symbol} ${method} ${right.symbol}`; | ||
if (!right && right !== 0) { | ||
throw new Error( | ||
`Invalid operation: ${left.symbol} ${method} with no right operand` | ||
); | ||
} | ||
@@ -111,3 +115,5 @@ if (!(right instanceof Currency) || left.isSameType(right)) return; | ||
throw new Error(message); | ||
throw new Error( | ||
`Invalid operation: ${left.symbol} ${method} ${right.symbol}` | ||
); | ||
} | ||
@@ -114,0 +120,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
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
28811
709