kafka-ts 0.0.6-beta.7 → 0.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -130,7 +130,7 @@ class Connection {
130
130
  write(buffer) {
131
131
  return new Promise((resolve, reject) => {
132
132
  const { stack } = new Error('Write error');
133
- this.socket.write(buffer, (error) => {
133
+ this.socket.write(buffer, 'binary', (error) => {
134
134
  if (error) {
135
135
  const err = new error_1.ConnectionError(error.message);
136
136
  err.stack += `\n${stack}`;
@@ -43,7 +43,7 @@ class Encoder {
43
43
  }
44
44
  writeUVarInt(value) {
45
45
  const byteArray = [];
46
- while ((value & 0xffffffff) !== 0) {
46
+ while ((value & 0xffffff80) !== 0) {
47
47
  byteArray.push((value & 0x7f) | 0x80);
48
48
  value >>>= 7;
49
49
  }
@@ -56,11 +56,11 @@ class Encoder {
56
56
  }
57
57
  writeUVarLong(value) {
58
58
  const byteArray = [];
59
- while ((value & BigInt(0xffffffffffffffff)) !== BigInt(0)) {
59
+ while ((value & 0xffffffffffffff80n) !== 0n) {
60
60
  byteArray.push(Number((value & BigInt(0x7f)) | BigInt(0x80)));
61
- value = value >> BigInt(7);
61
+ value >>= 7n;
62
62
  }
63
- byteArray.push(Number(value));
63
+ byteArray.push(Number(value & BigInt(0x7f)));
64
64
  return this.write(Buffer.from(byteArray));
65
65
  }
66
66
  writeVarLong(value) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kafka-ts",
3
- "version": "0.0.6-beta.7",
3
+ "version": "0.0.6",
4
4
  "main": "dist/index.js",
5
5
  "author": "Priit Käärd",
6
6
  "license": "MIT",