Fixed cross-package isBigNumber.

This commit is contained in:
ricmoo 2017-04-05 16:33:37 -04:00
parent f77d5ff909
commit 29cc0795b4
2 changed files with 4 additions and 4 deletions

@ -28,7 +28,7 @@ function BigNumber(value) {
} else if (BN.isBN(value)) {
//value = value
} else if (value instanceof BigNumber) {
} else if (isBigNumber(value)) {
value = value._bn;
} else if (convert.isArrayish(value)) {
@ -124,11 +124,11 @@ defineProperty(BigNumber.prototype, 'toHexString', function() {
function isBigNumber(value) {
return (value instanceof BigNumber);
return (value._bn && value._bn.mod);
}
function bigNumberify(value) {
if (value instanceof BigNumber) { return value; }
if (isBigNumber(value)) { return value; }
return new BigNumber(value);
}

@ -1,6 +1,6 @@
{
"name": "ethers-utils",
"version": "2.0.1",
"version": "2.0.2",
"description": "Utilities for the Ethers Ethereum library.",
"bugs": {
"url": "http://github.com/ethers-io/ethers.js/issues",