@lad-tech/nsc-toolkit 1.17.6 → 1.18.0

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.
package/CHANGELOG.md CHANGED
@@ -1,6 +1,6 @@
1
- ## [1.17.6](https://github.com/lad-tech/nsc-toolkit/compare/v1.17.5...v1.17.6) (2024-01-25)
1
+ # [1.18.0](https://github.com/lad-tech/nsc-toolkit/compare/v1.17.6...v1.18.0) (2024-02-26)
2
2
 
3
3
 
4
- ### Bug Fixes
4
+ ### Features
5
5
 
6
- * external timeouts ([#96](https://github.com/lad-tech/nsc-toolkit/issues/96)) ([95a71ef](https://github.com/lad-tech/nsc-toolkit/commit/95a71ef1403beb89b6c775fe9f24eb0eba65f8aa))
6
+ * Сделать передачу logger в BufferToJsonTransform.ts опциональной ([#98](https://github.com/lad-tech/nsc-toolkit/issues/98)) ([01b0686](https://github.com/lad-tech/nsc-toolkit/commit/01b0686d44ec9a636244810b95712062b6fc2049))
@@ -9,6 +9,7 @@ class BufferToJsonTransform extends stream_1.Transform {
9
9
  this.logger = options.logger;
10
10
  }
11
11
  async _transform(tail, _, cb) {
12
+ var _a;
12
13
  try {
13
14
  tail = Buffer.concat([this.head, Buffer.from(tail)]);
14
15
  const jsonData = JSON.parse(tail.toString());
@@ -18,7 +19,7 @@ class BufferToJsonTransform extends stream_1.Transform {
18
19
  catch (error) {
19
20
  if (error instanceof SyntaxError) {
20
21
  this.head = Buffer.from(tail);
21
- this.logger.error(BufferToJsonTransform.errors.CONVERSION_ERROR, tail.toString());
22
+ (_a = this.logger) === null || _a === void 0 ? void 0 : _a.error(BufferToJsonTransform.errors.CONVERSION_ERROR, tail.toString());
22
23
  cb();
23
24
  return;
24
25
  }
@@ -5,9 +5,9 @@ import { Transform, TransformCallback, TransformOptions } from 'stream';
5
5
  export declare class BufferToJsonTransform<T = any> extends Transform {
6
6
  private head;
7
7
  private static errors;
8
- private logger;
8
+ private logger?;
9
9
  constructor(options: TransformOptions & {
10
- logger: Logs.Logger;
10
+ logger?: Logs.Logger;
11
11
  });
12
12
  _transform(tail: Buffer, _: BufferEncoding, cb: TransformCallback): Promise<void>;
13
13
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lad-tech/nsc-toolkit",
3
- "version": "1.17.6",
3
+ "version": "1.18.0",
4
4
  "description": "Toolkit for create microservices around NATS",
5
5
  "main": "dist/index.js",
6
6
  "types": "./dist/types/index.d.ts",