Skip to content

Commit

Permalink
Update encoder.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
whtiehack authored Oct 17, 2024
1 parent 52b0f8a commit c1acf2e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/pinus-protobuf/lib/encoder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,12 @@ export class Encoder {

switch (type) {
case 'uInt32':
case 'uInt64':
offset = this.writeBytes(buffer, offset, codec.encodeUInt32(value));
break;
case 'int32':
case 'sInt32':
case 'sInt64':
offset = this.writeBytes(buffer, offset, codec.encodeSInt32(value));
break;
case 'float':
Expand Down Expand Up @@ -248,4 +250,4 @@ export class Encoder {

return codec.encodeUInt32((tag << 3) | value);
}
}
}

0 comments on commit c1acf2e

Please sign in to comment.