We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e6d2fb9 commit 40558e0Copy full SHA for 40558e0
src/long.ts
@@ -243,8 +243,13 @@ export class Long extends BSONValue {
243
* @returns The corresponding Long value
244
*/
245
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);
+ return new Long(
+ // eslint-disable-next-line no-restricted-globals
248
+ Number(value & BigInt(0xffffffff)),
249
250
+ Number((value >> BigInt(32)) & BigInt(0xffffffff)),
251
+ unsigned
252
+ );
253
}
254
255
/**
0 commit comments