We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b69f9cb commit e9c390aCopy full SHA for e9c390a
src/encode.ts
@@ -22,15 +22,15 @@ class Encoder {
22
let offset = this._poolOffset
23
24
varint.encode(msg.id << 3 | msg.type, pool, offset)
25
- offset += varint.encode.bytes
+ offset += varint.encode.bytes ?? 0
26
27
if ((msg.type === MessageTypes.NEW_STREAM || msg.type === MessageTypes.MESSAGE_INITIATOR || msg.type === MessageTypes.MESSAGE_RECEIVER) && msg.data != null) {
28
varint.encode(msg.data.length, pool, offset)
29
} else {
30
varint.encode(0, pool, offset)
31
}
32
33
34
35
const header = pool.subarray(this._poolOffset, offset)
36
0 commit comments