Fixed cross-package isBigNumber.
This commit is contained in:
parent
f77d5ff909
commit
29cc0795b4
@ -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",
|
||||
|
Loading…
Reference in New Issue
Block a user