@exodus/bigint 2.0.0 → 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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exodus/bigint",
3
- "version": "2.0.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": "8e7de47c76a1bfcb1e29a7663a445ee8cf7268c7"
31
+ "gitHead": "fe5f3cc710fe3d04abc948db742208133479673a"
32
32
  }
package/src/bn.js CHANGED
@@ -1,5 +1,5 @@
1
- import assert from 'minimalistic-assert'
2
- import BN from 'bn.js'
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,8 +10,8 @@ const unwrap = (value) => (value instanceof Wrapper ? value.unwrap() : value)
10
10
 
11
11
  const BI_ZERO = new BN(0)
12
12
 
13
- export default class Wrapper {
14
- static name = 'bn.js'
13
+ class Wrapper {
14
+ static wrapperName = 'bn.js'
15
15
  static isUnderlyingInstance(a) {
16
16
  return BN.isBN(a)
17
17
  }
@@ -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
@@ -1,4 +1,3 @@
1
- const Wrapper =
2
- typeof BigInt === 'function' ? require('./native-bigint').default : require('./bn').default
1
+ const Wrapper = typeof BigInt === 'function' ? require('./native-bigint') : require('./bn')
3
2
 
4
- export default Wrapper
3
+ module.exports = Wrapper
@@ -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
- import assert from 'minimalistic-assert'
4
+ const assert = require('minimalistic-assert')
5
5
 
6
6
  const FACTORY_SYMBOL = Symbol('bigint-wrapper')
7
7
 
@@ -9,8 +9,8 @@ const unwrap = (value) => (value instanceof Wrapper ? value.unwrap() : value)
9
9
 
10
10
  const BI_ZERO = BigInt(0)
11
11
 
12
- export default class Wrapper {
13
- static name = 'native-bigint'
12
+ class Wrapper {
13
+ static wrapperName = 'native-bigint'
14
14
 
15
15
  static wrap(numberLike, base = 10) {
16
16
  if (typeof numberLike === 'bigint') return new Wrapper(FACTORY_SYMBOL, numberLike)
@@ -166,3 +166,5 @@ export default class Wrapper {
166
166
  return true
167
167
  }
168
168
  }
169
+
170
+ module.exports = Wrapper