Skip to content

Commit c6b261c

Browse files
committed
chore: comments
1 parent a4863e4 commit c6b261c

File tree

2 files changed

+6
-11
lines changed

2 files changed

+6
-11
lines changed

src/cmap/commands.ts

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -732,15 +732,15 @@ const COMPRESSION_DETAILS_SIZE = 9; // originalOpcode + uncompressedSize, compre
732732
*/
733733
export class OpCompressedRequest {
734734
private command: WriteProtocolMessageType;
735-
private options: { zLibCompressionLevel: number; agreedCompressor: CompressorName };
735+
private options: { zlibCompressionLevel: number; agreedCompressor: CompressorName };
736736

737737
constructor(
738738
command: WriteProtocolMessageType,
739739
options: { zlibCompressionLevel: number; agreedCompressor: CompressorName }
740740
) {
741741
this.command = command;
742742
this.options = {
743-
zLibCompressionLevel: options.zlibCompressionLevel,
743+
zlibCompressionLevel: options.zlibCompressionLevel,
744744
agreedCompressor: options.agreedCompressor
745745
};
746746
}
@@ -762,13 +762,7 @@ export class OpCompressedRequest {
762762
const originalCommandOpCode = concatenatedOriginalCommandBuffer.readInt32LE(12);
763763

764764
// Compress the message body
765-
const compressedMessage = await compress(
766-
{
767-
zlibCompressionLevel: this.options.zLibCompressionLevel,
768-
agreedCompressor: this.options.agreedCompressor
769-
},
770-
messageToBeCompressed
771-
);
765+
const compressedMessage = await compress(this.options, messageToBeCompressed);
772766
// Create the msgHeader of OP_COMPRESSED
773767
const msgHeader = Buffer.alloc(MESSAGE_HEADER_SIZE);
774768
msgHeader.writeInt32LE(

src/cmap/wire_protocol/on_data.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,9 @@ export function onData(
8989
return this;
9090
},
9191

92-
[Symbol.asyncDispose]: function (): PromiseLike<void> {
93-
return closeHandler().then(() => undefined);
92+
// Note this should currently not be used, but is required by the AsyncGenerator interface.
93+
async [Symbol.asyncDispose]() {
94+
await closeHandler();
9495
}
9596
};
9697

0 commit comments

Comments
 (0)