Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
domoritz committed Jul 31, 2022
1 parent a9f3e95 commit e691ad7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions js/.eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ module.exports = {
"unicorn/prefer-switch": "off",
"unicorn/prefer-node-protocol": "off",
"unicorn/text-encoding-identifier-case": "off",
"unicorn/prefer-top-level-await": "off",

"unicorn/consistent-destructuring": "warn",
"unicorn/no-array-reduce": ["warn", { "allowSimpleOperations": true }],
Expand Down
4 changes: 2 additions & 2 deletions js/src/util/bn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ if (!BigIntAvailable) {

/** @ignore */
function decimalToString<T extends BN<BigNumArray>>(a: T) {
let digits = '';
let digits: string | null = null;
const base64 = new Uint32Array(2);
let base32 = new Uint16Array(a.buffer, a.byteOffset, a.byteLength / 2);
const checks = new Uint32Array((base32 = new Uint16Array(base32).reverse()).buffer);
Expand All @@ -119,7 +119,7 @@ function decimalToString<T extends BN<BigNumArray>>(a: T) {
base64[0] = base64[0] - base64[1] * 10;
digits = `${base64[0]}${digits}`;
} while (checks[0] || checks[1] || checks[2] || checks[3]);
return digits ? digits : `0`;
return digits ?? `0`;
}

/** @ignore */
Expand Down

0 comments on commit e691ad7

Please sign in to comment.