Skip to content

Commit 9d84765

Browse files
authored
chore: fix invalid use of typeof operator (#3076)
1 parent 3c041f4 commit 9d84765

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

.eslintrc.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
"prettier/prettier": "error",
2121
"tsdoc/syntax": "warn",
2222
"no-console": "error",
23+
"valid-typeof": "error",
2324
"eqeqeq": [
2425
"error",
2526
"always",

src/cmap/stream_description.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,16 +55,16 @@ export class StreamDescription {
5555

5656
receiveResponse(response: Document): void {
5757
this.type = parseServerType(response);
58-
RESPONSE_FIELDS.forEach(field => {
59-
if (typeof response[field] != null) {
58+
for (const field of RESPONSE_FIELDS) {
59+
if (response[field] != null) {
6060
this[field] = response[field];
6161
}
6262

6363
// testing case
6464
if ('__nodejs_mock_server__' in response) {
6565
this.__nodejs_mock_server__ = response['__nodejs_mock_server__'];
6666
}
67-
});
67+
}
6868

6969
if (response.compression) {
7070
this.compressor = this.compressors.filter(c => response.compression?.includes(c))[0];

0 commit comments

Comments
 (0)