@hodfords/nestjs-grpc-helper 11.3.3 → 11.3.4

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.
@@ -1 +1,3 @@
1
- export declare function AnyType(): PropertyDecorator;
1
+ export declare function AnyType({ isDto }?: {
2
+ isDto?: boolean;
3
+ }): PropertyDecorator;
@@ -2,8 +2,11 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.AnyType = AnyType;
4
4
  const class_transformer_1 = require("class-transformer");
5
- function AnyType() {
5
+ function AnyType({ isDto } = {}) {
6
6
  return (0, class_transformer_1.Transform)((object) => {
7
+ if (isDto && typeof object.value === 'string') {
8
+ return JSON.parse(object.value);
9
+ }
7
10
  if (object.options.groups?.includes('__sendData')) {
8
11
  return JSON.stringify(object.value);
9
12
  }
@@ -1 +1 @@
1
- {"version":3,"file":"any-type.decorator.js","sourceRoot":"","sources":["../../../lib/decorators/any-type.decorator.ts"],"names":[],"mappings":";;AAEA,0BAWC;AAbD,yDAA8C;AAE9C,SAAgB,OAAO;IACnB,OAAO,IAAA,6BAAS,EAAC,CAAC,MAAM,EAAE,EAAE;QACxB,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,EAAE,QAAQ,CAAC,YAAY,CAAC,EAAE,CAAC;YAChD,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACxC,CAAC;QACD,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,EAAE,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC;YAC/C,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACpC,CAAC;QAED,OAAO,MAAM,CAAC,KAAK,CAAC;IACxB,CAAC,CAAC,CAAC;AACP,CAAC"}
1
+ {"version":3,"file":"any-type.decorator.js","sourceRoot":"","sources":["../../../lib/decorators/any-type.decorator.ts"],"names":[],"mappings":";;AAEA,0BAeC;AAjBD,yDAA8C;AAE9C,SAAgB,OAAO,CAAC,EAAE,KAAK,KAA0B,EAAE;IACvD,OAAO,IAAA,6BAAS,EAAC,CAAC,MAAM,EAAE,EAAE;QACxB,IAAI,KAAK,IAAI,OAAO,MAAM,CAAC,KAAK,KAAK,QAAQ,EAAE,CAAC;YAC5C,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACpC,CAAC;QAED,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,EAAE,QAAQ,CAAC,YAAY,CAAC,EAAE,CAAC;YAChD,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACxC,CAAC;QACD,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,EAAE,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC;YAC/C,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACpC,CAAC;QAED,OAAO,MAAM,CAAC,KAAK,CAAC;IACxB,CAAC,CAAC,CAAC;AACP,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hodfords/nestjs-grpc-helper",
3
- "version": "11.3.3",
3
+ "version": "11.3.4",
4
4
  "description": "A utility for simplifying gRPC integration and communication in NestJS applications",
5
5
  "author": "",
6
6
  "license": "UNLICENSED",