@exodus/bigint 2.0.2 → 3.0.0

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,7 +1,8 @@
1
1
  {
2
2
  "name": "@exodus/bigint",
3
- "version": "2.0.2",
3
+ "version": "3.0.0",
4
4
  "description": "bigint wrappers for native BigUnt, bn.js and others",
5
+ "type": "module",
5
6
  "main": "src/index.js",
6
7
  "author": "Exodus Movement, Inc.",
7
8
  "license": "UNLICENSED",
@@ -28,5 +29,5 @@
28
29
  "bugs": {
29
30
  "url": "https://github.com/ExodusMovement/exodus-core/issues?q=is%3Aissue+is%3Aopen+label%3Abigint"
30
31
  },
31
- "gitHead": "fe5f3cc710fe3d04abc948db742208133479673a"
32
+ "gitHead": "317d2c4f88d6359f84f5c56519a6a59bbfa9bc55"
32
33
  }
package/src/bn.js CHANGED
@@ -1,5 +1,5 @@
1
- const assert = require('minimalistic-assert')
2
- const BN = require('bn.js')
1
+ import assert from 'minimalistic-assert'
2
+ import BN from '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
- class Wrapper {
13
+ export default class Wrapper {
14
14
  static wrapperName = 'bn.js'
15
15
  static isUnderlyingInstance(a) {
16
16
  return BN.isBN(a)
@@ -156,5 +156,3 @@ class Wrapper {
156
156
  return true
157
157
  }
158
158
  }
159
-
160
- module.exports = Wrapper
package/src/index.js CHANGED
@@ -1,3 +1 @@
1
- const Wrapper = typeof BigInt === 'function' ? require('./native-bigint') : require('./bn')
2
-
3
- module.exports = Wrapper
1
+ export { default } from './native-bigint.js'
@@ -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
- const assert = require('minimalistic-assert')
4
+ import assert from '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
- class Wrapper {
12
+ export default class Wrapper {
13
13
  static wrapperName = 'native-bigint'
14
14
 
15
15
  static wrap(numberLike, base = 10) {
@@ -166,5 +166,3 @@ class Wrapper {
166
166
  return true
167
167
  }
168
168
  }
169
-
170
- module.exports = Wrapper