Skip to content

Commit 40558e0

Browse files
use bigInt constructor
1 parent e6d2fb9 commit 40558e0

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/long.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,8 +243,13 @@ export class Long extends BSONValue {
243243
* @returns The corresponding Long value
244244
*/
245245
static fromBigInt(value: bigint, unsigned?: boolean): Long {
246-
// eslint-disable-next-line no-bigint-usage/no-bigint-literals
247-
return new Long(Number(value & 0xffffffffn), Number((value >> 32n) & 0xffffffffn), unsigned);
246+
return new Long(
247+
// eslint-disable-next-line no-restricted-globals
248+
Number(value & BigInt(0xffffffff)),
249+
// eslint-disable-next-line no-restricted-globals
250+
Number((value >> BigInt(32)) & BigInt(0xffffffff)),
251+
unsigned
252+
);
248253
}
249254

250255
/**

0 commit comments

Comments
 (0)