Skip to content

Commit 772c458

Browse files
simplify logic
1 parent 2aa8ac1 commit 772c458

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/explain.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ export class Explain {
9393

9494
export function validateExplainTimeoutOptions(options: Document, explain?: Explain) {
9595
const { maxTimeMS, timeoutMS } = options;
96-
if ((maxTimeMS != null && timeoutMS) || (explain?.maxTimeMS != null && timeoutMS != null)) {
96+
if (timeoutMS != null && (maxTimeMS != null || explain?.maxTimeMS != null)) {
9797
throw new MongoAPIError('Cannot use maxTimeMS with timeoutMS for explain commands.');
9898
}
9999
}

0 commit comments

Comments
 (0)