Skip to content

Commit

Permalink
v0.3.13 released
Browse files Browse the repository at this point in the history
fix the `byte`, `short` and `int` minimum boundary on `Message.Encoder` class
  • Loading branch information
TheNorthMemory committed Dec 3, 2022
1 parent c7c51e4 commit 976b3ef
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions lib/message.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,13 +131,13 @@ class Encoder {

if (type === 'number') {
switch (true) {
case value > -128 && value < 127:
case value >= -128 && value < 127:
return this.put(Byte).put(value);

case value > -32_768 && value < 32_767:
case value >= -32_768 && value < 32_767:
return this.put(Int16).putShort(value);

case value > -2_147_483_648 && value < 2_147_483_647:
case value >= -2_147_483_648 && value < 2_147_483_647:
return this.put(Int32).putInt(value);

default:
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tmc.js",
"version": "0.3.12",
"version": "0.3.13",
"description": "Events driven and chained Taobao Message Channel(TMC) for NodeJS",
"author": "James ZHANG",
"license": "MIT",
Expand Down

0 comments on commit 976b3ef

Please sign in to comment.