From 48244b6bc88ff0defd79eef31320f6696df7549d Mon Sep 17 00:00:00 2001 From: Durran Jordan Date: Tue, 22 Nov 2022 20:47:35 +0100 Subject: [PATCH] fix(NODE-4831): check for null --- src/cmap/connection.ts | 3 +-- test/unit/cmap/connection.test.ts | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/cmap/connection.ts b/src/cmap/connection.ts index 265ea7a1c0..85f6000817 100644 --- a/src/cmap/connection.ts +++ b/src/cmap/connection.ts @@ -384,8 +384,7 @@ export class Connection extends TypedEventEmitter { } else { // Get the first orphaned operation description. const entry = this[kQueue].entries().next(); - /* eslint no-restricted-syntax: 0 */ - if (entry.value !== undefined) { + if (entry.value != null) { const [requestId, orphaned]: [number, OperationDescription] = entry.value; // If the orphaned operation description exists then set it. operationDescription = orphaned; diff --git a/test/unit/cmap/connection.test.ts b/test/unit/cmap/connection.test.ts index b6ab033a11..5c8d872bb8 100644 --- a/test/unit/cmap/connection.test.ts +++ b/test/unit/cmap/connection.test.ts @@ -311,7 +311,7 @@ describe('new Connection()', function () { const message = new BinMsg(msg, msgHeader, msgBody); expect(() => { connection.onMessage(message); - }).to.not.throw(/undefined is not iterable/); + }).to.not.throw(); }); });