domoritz commented on code in PR #33682:
URL: https://github.com/apache/arrow/pull/33682#discussion_r1072304245
##########
js/src/util/bn.ts:
##########
@@ -90,17 +90,9 @@ function bignumToNumber<T extends BN<BigNumArray>>(bn: T) {
}
/** @ignore */
-export let bignumToString: { <T extends BN<BigNumArray>>(a: T): string };
+export const bignumToString = (<T extends BN<BigNumArray>>(a: T) =>
a.byteLength === 8 ? new a['BigIntArray'](a.buffer, a.byteOffset, 1)[0] :
<any>decimalToString(a));
/** @ignore */
-export let bignumToBigInt: { <T extends BN<BigNumArray>>(a: T): bigint };
-
-if (!BigIntAvailable) {
- bignumToString = decimalToString;
- bignumToBigInt = <any>bignumToString;
-} else {
- bignumToBigInt = (<T extends BN<BigNumArray>>(a: T) => a.byteLength === 8
? new a['BigIntArray'](a.buffer, a.byteOffset, 1)[0] : <any>decimalToString(a));
- bignumToString = (<T extends BN<BigNumArray>>(a: T) => a.byteLength === 8
? `${new a['BigIntArray'](a.buffer, a.byteOffset, 1)[0]}` : decimalToString(a));
-}
+export const bignumToBigInt = (<T extends BN<BigNumArray>>(a: T) =>
a.byteLength === 8 ? `${new a['BigIntArray'](a.buffer, a.byteOffset, 1)[0]}` :
decimalToString(a));
Review Comment:
🤦 yes,I swapped them because the order of variables was different in the
else.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]