@talismn/util 0.0.0-pr677-20230413212044 → 0.0.0-pr677-20230414055701

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 CHANGED
@@ -1,10 +1,10 @@
1
1
  # @talismn/util
2
2
 
3
- ## 0.0.0-pr677-20230413212044
3
+ ## 0.0.0-pr677-20230414055701
4
4
 
5
5
  ### Patch Changes
6
6
 
7
- - 6e5f12bc: feat: crowdloan and nom pool balances
7
+ - 7440f96a: feat: crowdloan and nom pool balances
8
8
 
9
9
  ## 0.1.8
10
10
 
@@ -4,7 +4,7 @@
4
4
  */
5
5
  export declare const BigMath: {
6
6
  abs(x: bigint): bigint;
7
- sign(x: bigint): bigint;
7
+ sign(x: bigint): 0n | 1n | -1n;
8
8
  min(value: bigint, ...values: bigint[]): bigint;
9
9
  max(value: bigint, ...values: bigint[]): bigint;
10
10
  };
@@ -17,11 +17,11 @@ var BigNumber__default = /*#__PURE__*/_interopDefault(BigNumber);
17
17
  */
18
18
  const BigMath = {
19
19
  abs(x) {
20
- return x < BigInt("0") ? -x : x;
20
+ return x < 0n ? -x : x;
21
21
  },
22
22
  sign(x) {
23
- if (x === BigInt("0")) return BigInt("0");
24
- return x < BigInt("0") ? BigInt("-1") : BigInt("1");
23
+ if (x === 0n) return 0n;
24
+ return x < 0n ? -1n : 1n;
25
25
  },
26
26
  // TODO: Improve our babel/tsc config to let us use the `**` operator on bigint values.
27
27
  // Error thrown: Exponentiation cannot be performed on 'bigint' values unless the 'target' option is set to 'es2016' or later. ts(2791)
@@ -17,11 +17,11 @@ var BigNumber__default = /*#__PURE__*/_interopDefault(BigNumber);
17
17
  */
18
18
  const BigMath = {
19
19
  abs(x) {
20
- return x < BigInt("0") ? -x : x;
20
+ return x < 0n ? -x : x;
21
21
  },
22
22
  sign(x) {
23
- if (x === BigInt("0")) return BigInt("0");
24
- return x < BigInt("0") ? BigInt("-1") : BigInt("1");
23
+ if (x === 0n) return 0n;
24
+ return x < 0n ? -1n : 1n;
25
25
  },
26
26
  // TODO: Improve our babel/tsc config to let us use the `**` operator on bigint values.
27
27
  // Error thrown: Exponentiation cannot be performed on 'bigint' values unless the 'target' option is set to 'es2016' or later. ts(2791)
@@ -9,11 +9,11 @@ import BigNumber from 'bignumber.js';
9
9
  */
10
10
  const BigMath = {
11
11
  abs(x) {
12
- return x < BigInt("0") ? -x : x;
12
+ return x < 0n ? -x : x;
13
13
  },
14
14
  sign(x) {
15
- if (x === BigInt("0")) return BigInt("0");
16
- return x < BigInt("0") ? BigInt("-1") : BigInt("1");
15
+ if (x === 0n) return 0n;
16
+ return x < 0n ? -1n : 1n;
17
17
  },
18
18
  // TODO: Improve our babel/tsc config to let us use the `**` operator on bigint values.
19
19
  // Error thrown: Exponentiation cannot be performed on 'bigint' values unless the 'target' option is set to 'es2016' or later. ts(2791)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@talismn/util",
3
- "version": "0.0.0-pr677-20230413212044",
3
+ "version": "0.0.0-pr677-20230414055701",
4
4
  "author": "Talisman",
5
5
  "homepage": "https://talisman.xyz",
6
6
  "license": "UNLICENSED",