@exodus/bigint 2.0.2 → 3.0.1

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/CHANGELOG.md ADDED
@@ -0,0 +1,58 @@
1
+ # Change Log
2
+
3
+ All notable changes to this project will be documented in this file.
4
+ See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
+
6
+ ## [3.0.1](https://github.com/ExodusMovement/hydra/compare/@exodus/bigint@3.0.0...@exodus/bigint@3.0.1) (2024-11-01)
7
+
8
+ Re-licensed under MIT license.
9
+
10
+ ### Reverts
11
+
12
+ - Revert "chore: disable lint/test for imported packages temporarily" ([b826a4a](https://github.com/ExodusMovement/hydra/commit/b826a4a49ddd77048958986a59b1eadf7430cc7e))
13
+
14
+ ## [3.0.0](https://github.com/ExodusMovement/exodus-core/compare/@exodus/bigint@2.0.2...@exodus/bigint@3.0.0) (2024-07-06)
15
+
16
+ ### ⚠ BREAKING CHANGES
17
+
18
+ - make bigint always native, switch it ESM (#1232)
19
+
20
+ ### Features
21
+
22
+ - make bigint always native, switch it ESM ([#1232](https://github.com/ExodusMovement/exodus-core/issues/1232)) ([ffbeb9d](https://github.com/ExodusMovement/exodus-core/commit/ffbeb9d73dcb89d34667d6d7f8db14139dbb7b12))
23
+
24
+ ## [2.0.2](https://github.com/ExodusMovement/exodus-core/compare/@exodus/bigint@2.0.1...@exodus/bigint@2.0.2) (2024-07-05)
25
+
26
+ ### Bug Fixes
27
+
28
+ - bigint is a CJS module ([#1218](https://github.com/ExodusMovement/exodus-core/issues/1218)) ([e482cf4](https://github.com/ExodusMovement/exodus-core/commit/e482cf44eff24f90919465de178bda94a6fc3f91))
29
+
30
+ ## [2.0.1](https://github.com/ExodusMovement/exodus-core/compare/@exodus/bigint@2.0.0...@exodus/bigint@2.0.1) (2024-04-01)
31
+
32
+ ### Bug Fixes
33
+
34
+ - don't use reserved property 'name' ([#1135](https://github.com/ExodusMovement/exodus-core/issues/1135)) ([0c2e549](https://github.com/ExodusMovement/exodus-core/commit/0c2e54936e322c0f5eeeae4794b0d89be6896408))
35
+
36
+ # [2.0.0](https://github.com/ExodusMovement/exodus-core/compare/@exodus/bigint@1.1.1...@exodus/bigint@2.0.0) (2024-03-20)
37
+
38
+ ### ⚠ BREAKING CHANGES
39
+
40
+ - remove ZERO and TEN BigIntWrapper constants ([#1111](https://github.com/ExodusMovement/exodus-core/issues/1111)) ([b6c8486a](https://github.com/ExodusMovement/exodus-core/commit/b6c8486acd388d7fac0139e062f9c9009fe76785))
41
+
42
+ ### Features
43
+
44
+ - bigIntWrapper.isBigIntWrapper ([#1112](https://github.com/ExodusMovement/exodus-core/issues/1112)) ([11be301](https://github.com/ExodusMovement/exodus-core/commit/11be301a62c12b001cdbd027d14aa5f41fdcf885))
45
+
46
+ ## [1.1.1](https://github.com/ExodusMovement/exodus-core/compare/@exodus/bigint@1.1.0...@exodus/bigint@1.1.1) (2024-03-08)
47
+
48
+ ### Bug Fixes
49
+
50
+ - BigInt wrappers .ZERO, .TEN ([#1106](https://github.com/ExodusMovement/exodus-core/issues/1106)) ([c009d61](https://github.com/ExodusMovement/exodus-core/commit/c009d610c5f9648a6e3e1e7b4f0d5bc6a93936ea))
51
+
52
+ # [1.1.0](https://github.com/ExodusMovement/exodus-core/compare/@exodus/bigint@1.0.0...@exodus/bigint@1.1.0) (2024-02-08)
53
+
54
+ - refactor: no BigInt literals, to make uglify happy ([#1048](https://github.com/ExodusMovement/exodus-core/issues/1048)) ([aa162a2](https://github.com/ExodusMovement/exodus-core/commit/aa162a23b7f55cfcf3c9db3a1321742f39d1e9ec))
55
+
56
+ # 1.0.0 (2023-10-31)
57
+
58
+ Initial release
package/LICENSE ADDED
@@ -0,0 +1,7 @@
1
+ Copyright (c) 2024 Exodus Movement, Inc.
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4
+
5
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6
+
7
+ THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/package.json CHANGED
@@ -1,32 +1,33 @@
1
1
  {
2
2
  "name": "@exodus/bigint",
3
- "version": "2.0.2",
3
+ "version": "3.0.1",
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
- "license": "UNLICENSED",
8
- "homepage": "https://github.com/ExodusMovement/exodus-core/tree/master/packages/bigint#readme",
8
+ "license": "MIT",
9
+ "homepage": "https://github.com/ExodusMovement/hydra/tree/master/libraries/bigint",
9
10
  "files": [
10
11
  "src",
11
12
  "!**/__tests__",
13
+ "CHANGELOG.md",
12
14
  "README.md"
13
15
  ],
14
16
  "dependencies": {
15
17
  "bn.js": "^4.11.0",
16
- "lodash": "^4.17.11",
17
18
  "minimalistic-assert": "^1.0.1"
18
19
  },
19
20
  "scripts": {
20
- "test": "run -T jest",
21
- "lint": "run -T eslint . --ignore-path ../../.gitignore",
21
+ "test": "run -T exodus-test --jest",
22
+ "lint": "run -T eslint .",
22
23
  "lint:fix": "yarn lint --fix"
23
24
  },
24
25
  "repository": {
25
26
  "type": "git",
26
- "url": "git+https://github.com/ExodusMovement/exodus-core.git"
27
+ "url": "git+https://github.com/ExodusMovement/hydra.git"
27
28
  },
28
29
  "bugs": {
29
- "url": "https://github.com/ExodusMovement/exodus-core/issues?q=is%3Aissue+is%3Aopen+label%3Abigint"
30
+ "url": "https://github.com/ExodusMovement/hydra/issues?q=is%3Aissue+is%3Aopen+label%3Abigint"
30
31
  },
31
- "gitHead": "fe5f3cc710fe3d04abc948db742208133479673a"
32
+ "gitHead": "2de0257f0ed62679c297cfc80a27fdda50bb57f1"
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)
@@ -136,6 +136,8 @@ class Wrapper {
136
136
  }
137
137
 
138
138
  toNumber() {
139
+ // false alarm, this is not a NumberUnit instance
140
+ // eslint-disable-next-line @exodus/hydra/no-unsafe-number-unit-methods
139
141
  return this.__value__.toNumber()
140
142
  }
141
143
 
@@ -156,5 +158,3 @@ class Wrapper {
156
158
  return true
157
159
  }
158
160
  }
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