Skip to content

Commit a6a2787

Browse files
committed
style(NODE-4874): fixup condition
1 parent 15b3ce8 commit a6a2787

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/extended_json.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,8 @@ function deserializeValue(value: any, options: EJSONOptions = {}) {
7474
if (typeof value === 'number') {
7575
const in32BitRange = value <= BSON_INT32_MAX && value >= BSON_INT32_MIN;
7676
const in64BitRange = value <= BSON_INT64_MAX && value >= BSON_INT64_MIN;
77-
if (options.useBigInt64) {
78-
if (!in32BitRange && in64BitRange) {
79-
return BigInt(value);
80-
}
77+
if (options.useBigInt64 && !in32BitRange && in64BitRange) {
78+
return BigInt(value);
8179
}
8280

8381
if (options.relaxed || options.legacy) {
@@ -211,8 +209,8 @@ function serializeValue(value: any, options: EJSONSerializeOptions): any {
211209

212210
throw new BSONError(
213211
'Converting circular structure to EJSON:\n' +
214-
` ${leadingPart}${alreadySeen}${circularPart}${current}\n` +
215-
` ${leadingSpace}\\${dashes}/`
212+
` ${leadingPart}${alreadySeen}${circularPart}${current}\n` +
213+
` ${leadingSpace}\\${dashes}/`
216214
);
217215
}
218216
options.seenObjects[options.seenObjects.length - 1].obj = value;

0 commit comments

Comments
 (0)