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 0a9606f commit e6d2fb9Copy full SHA for e6d2fb9
src/long.ts
@@ -243,13 +243,8 @@ export class Long extends BSONValue {
243
* @returns The corresponding Long value
244
*/
245
static fromBigInt(value: bigint, unsigned?: boolean): Long {
246
- /* eslint-disable no-bigint-usage/no-bigint-literals */
247
- const bit32Mask = 0xffffffffn;
248
-
249
- const lowBits = value & bit32Mask;
250
- const highBits = (value >> 32n) & bit32Mask;
251
- /* eslint-enable no-bigint-usage/no-bigint-literals */
252
- return new Long(Number(lowBits), Number(highBits), unsigned);
+ // eslint-disable-next-line no-bigint-usage/no-bigint-literals
+ return new Long(Number(value & 0xffffffffn), Number((value >> 32n) & 0xffffffffn), unsigned);
253
}
254
255
/**
0 commit comments