Skip to content

Commit

Permalink
chore: fix invalid use of typeof operator (#3076)
Browse files Browse the repository at this point in the history
  • Loading branch information
nbbeeken committed Dec 13, 2021
1 parent 3c041f4 commit 9d84765
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions .eslintrc.json
Expand Up @@ -20,6 +20,7 @@
"prettier/prettier": "error",
"tsdoc/syntax": "warn",
"no-console": "error",
"valid-typeof": "error",
"eqeqeq": [
"error",
"always",
Expand Down
6 changes: 3 additions & 3 deletions src/cmap/stream_description.ts
Expand Up @@ -55,16 +55,16 @@ export class StreamDescription {

receiveResponse(response: Document): void {
this.type = parseServerType(response);
RESPONSE_FIELDS.forEach(field => {
if (typeof response[field] != null) {
for (const field of RESPONSE_FIELDS) {
if (response[field] != null) {
this[field] = response[field];
}

// testing case
if ('__nodejs_mock_server__' in response) {
this.__nodejs_mock_server__ = response['__nodejs_mock_server__'];
}
});
}

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

0 comments on commit 9d84765

Please sign in to comment.