Skip to content
This repository has been archived by the owner on Jul 21, 2023. It is now read-only.

Commit

Permalink
fix: type errors (#230)
Browse files Browse the repository at this point in the history
  • Loading branch information
mpetrunic committed Nov 21, 2022
1 parent b69f9cb commit e9c390a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/encode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ class Encoder {
let offset = this._poolOffset

varint.encode(msg.id << 3 | msg.type, pool, offset)
offset += varint.encode.bytes
offset += varint.encode.bytes ?? 0

if ((msg.type === MessageTypes.NEW_STREAM || msg.type === MessageTypes.MESSAGE_INITIATOR || msg.type === MessageTypes.MESSAGE_RECEIVER) && msg.data != null) {
varint.encode(msg.data.length, pool, offset)
} else {
varint.encode(0, pool, offset)
}

offset += varint.encode.bytes
offset += varint.encode.bytes ?? 0

const header = pool.subarray(this._poolOffset, offset)

Expand Down

0 comments on commit e9c390a

Please sign in to comment.