@exodus/bigint 2.0.1 → 2.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/src/bn.js +5 -3
- package/src/index.js +2 -3
- package/src/native-bigint.js +4 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exodus/bigint",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.2",
|
|
4
4
|
"description": "bigint wrappers for native BigUnt, bn.js and others",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"author": "Exodus Movement, Inc.",
|
|
@@ -28,5 +28,5 @@
|
|
|
28
28
|
"bugs": {
|
|
29
29
|
"url": "https://github.com/ExodusMovement/exodus-core/issues?q=is%3Aissue+is%3Aopen+label%3Abigint"
|
|
30
30
|
},
|
|
31
|
-
"gitHead": "
|
|
31
|
+
"gitHead": "fe5f3cc710fe3d04abc948db742208133479673a"
|
|
32
32
|
}
|
package/src/bn.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
const assert = require('minimalistic-assert')
|
|
2
|
+
const BN = require('bn.js')
|
|
3
3
|
|
|
4
4
|
// TODO: calculator delegator should wrap/unwrap all BN instances
|
|
5
5
|
// so that callers never gett a raw BN instance back
|
|
@@ -10,7 +10,7 @@ const unwrap = (value) => (value instanceof Wrapper ? value.unwrap() : value)
|
|
|
10
10
|
|
|
11
11
|
const BI_ZERO = new BN(0)
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
class Wrapper {
|
|
14
14
|
static wrapperName = 'bn.js'
|
|
15
15
|
static isUnderlyingInstance(a) {
|
|
16
16
|
return BN.isBN(a)
|
|
@@ -156,3 +156,5 @@ export default class Wrapper {
|
|
|
156
156
|
return true
|
|
157
157
|
}
|
|
158
158
|
}
|
|
159
|
+
|
|
160
|
+
module.exports = Wrapper
|
package/src/index.js
CHANGED
package/src/native-bigint.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// TODO: calculator delegator should wrap/unwrap all BigInt instances
|
|
2
2
|
// so that callers never gett a raw BigInt instance back
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
const assert = require('minimalistic-assert')
|
|
5
5
|
|
|
6
6
|
const FACTORY_SYMBOL = Symbol('bigint-wrapper')
|
|
7
7
|
|
|
@@ -9,7 +9,7 @@ const unwrap = (value) => (value instanceof Wrapper ? value.unwrap() : value)
|
|
|
9
9
|
|
|
10
10
|
const BI_ZERO = BigInt(0)
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
class Wrapper {
|
|
13
13
|
static wrapperName = 'native-bigint'
|
|
14
14
|
|
|
15
15
|
static wrap(numberLike, base = 10) {
|
|
@@ -166,3 +166,5 @@ export default class Wrapper {
|
|
|
166
166
|
return true
|
|
167
167
|
}
|
|
168
168
|
}
|
|
169
|
+
|
|
170
|
+
module.exports = Wrapper
|