From 40558e0b1fa3079aefafc3a48dbb4c43f8a0668d Mon Sep 17 00:00:00 2001 From: Aditi Khare Date: Thu, 2 May 2024 13:29:05 -0400 Subject: [PATCH] use bigInt constructor --- src/long.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/long.ts b/src/long.ts index eab44c12..3dd85a03 100644 --- a/src/long.ts +++ b/src/long.ts @@ -243,8 +243,13 @@ export class Long extends BSONValue { * @returns The corresponding Long value */ static fromBigInt(value: bigint, unsigned?: boolean): Long { - // eslint-disable-next-line no-bigint-usage/no-bigint-literals - return new Long(Number(value & 0xffffffffn), Number((value >> 32n) & 0xffffffffn), unsigned); + return new Long( + // eslint-disable-next-line no-restricted-globals + Number(value & BigInt(0xffffffff)), + // eslint-disable-next-line no-restricted-globals + Number((value >> BigInt(32)) & BigInt(0xffffffff)), + unsigned + ); } /**