Skip to content

Commit

Permalink
use bigInt constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
aditi-khare-mongoDB committed May 2, 2024
1 parent e6d2fb9 commit 40558e0
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/long.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
);
}

/**
Expand Down

0 comments on commit 40558e0

Please sign in to comment.