@hg-ts/validation 0.1.16 → 0.1.17

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/.eslintcache CHANGED
@@ -1 +1 @@
1
- [{"/Volumes/Work/ts/hg/framework/packages/async-context/src/async-context.not-found.exception.ts":"1","/Volumes/Work/ts/hg/framework/packages/async-context/src/async-context.provider.ts":"2","/Volumes/Work/ts/hg/framework/packages/async-context/src/async-context.test-suite.ts":"3","/Volumes/Work/ts/hg/framework/packages/async-context/src/index.ts":"4","/Volumes/Work/ts/hg/framework/packages/validation/src/extensions.ts":"5","/Volumes/Work/ts/hg/framework/packages/validation/src/index.ts":"6","/Volumes/Work/ts/hg/framework/packages/validation/src/dto.ts":"7"},{"size":186,"mtime":1698022585968,"results":"8","hashOfConfig":"9"},{"size":2161,"mtime":1698022585968,"results":"10","hashOfConfig":"9"},{"size":3714,"mtime":1698022585968,"results":"11","hashOfConfig":"9"},{"size":95,"mtime":1698022585968,"results":"12","hashOfConfig":"9"},{"size":1381,"mtime":1713667739080,"results":"13","hashOfConfig":"14"},{"size":88,"mtime":1713662918071,"results":"15","hashOfConfig":"14"},{"size":677,"mtime":1713667808791,"results":"16","hashOfConfig":"14"},{"filePath":"17","messages":"18","suppressedMessages":"19","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"1o9szx6",{"filePath":"20","messages":"21","suppressedMessages":"22","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"23","messages":"24","suppressedMessages":"25","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"26","messages":"27","suppressedMessages":"28","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"29","messages":"30","suppressedMessages":"31","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"xqlb75",{"filePath":"32","messages":"33","suppressedMessages":"34","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"35","messages":"36","suppressedMessages":"37","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"/Volumes/Work/ts/hg/framework/packages/async-context/src/async-context.not-found.exception.ts",[],[],"/Volumes/Work/ts/hg/framework/packages/async-context/src/async-context.provider.ts",[],[],"/Volumes/Work/ts/hg/framework/packages/async-context/src/async-context.test-suite.ts",[],[],"/Volumes/Work/ts/hg/framework/packages/async-context/src/index.ts",[],[],"/Volumes/Work/ts/hg/framework/packages/validation/src/extensions.ts",[],["38"],"/Volumes/Work/ts/hg/framework/packages/validation/src/index.ts",[],[],"/Volumes/Work/ts/hg/framework/packages/validation/src/dto.ts",[],[],{"ruleId":"39","severity":2,"message":"40","line":17,"column":12,"nodeType":"41","messageId":"42","endLine":17,"endColumn":21,"fix":"43","suppressions":"44"},"@typescript-eslint/consistent-type-definitions","Use a `type` instead of an `interface`.","Identifier","typeOverInterface",{"range":"45","text":"46"},["47"],[283,370],"type ZodSchema<Output = any, Def extends ZodTypeDef = ZodTypeDef, Input = Output> = ",{"kind":"48","justification":"49"},"directive",""]
1
+ [{"/Volumes/Work/ts/hg/framework/packages/async-context/src/async-context.not-found.exception.ts":"1","/Volumes/Work/ts/hg/framework/packages/async-context/src/async-context.provider.ts":"2","/Volumes/Work/ts/hg/framework/packages/async-context/src/async-context.test-suite.ts":"3","/Volumes/Work/ts/hg/framework/packages/async-context/src/index.ts":"4","/Volumes/Work/ts/hg/framework/packages/validation/src/extensions.ts":"5","/Volumes/Work/ts/hg/framework/packages/validation/src/index.ts":"6","/Volumes/Work/ts/hg/framework/packages/validation/src/dto.ts":"7"},{"size":186,"mtime":1698022585968,"results":"8","hashOfConfig":"9"},{"size":2161,"mtime":1698022585968,"results":"10","hashOfConfig":"9"},{"size":3714,"mtime":1698022585968,"results":"11","hashOfConfig":"9"},{"size":95,"mtime":1698022585968,"results":"12","hashOfConfig":"9"},{"size":1335,"mtime":1713905441410,"results":"13","hashOfConfig":"14"},{"size":88,"mtime":1713662918071,"results":"15","hashOfConfig":"14"},{"size":595,"mtime":1713903104633,"results":"16","hashOfConfig":"14"},{"filePath":"17","messages":"18","suppressedMessages":"19","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"1o9szx6",{"filePath":"20","messages":"21","suppressedMessages":"22","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"23","messages":"24","suppressedMessages":"25","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"26","messages":"27","suppressedMessages":"28","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"29","messages":"30","suppressedMessages":"31","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"xqlb75",{"filePath":"32","messages":"33","suppressedMessages":"34","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"35","messages":"36","suppressedMessages":"37","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"/Volumes/Work/ts/hg/framework/packages/async-context/src/async-context.not-found.exception.ts",[],[],"/Volumes/Work/ts/hg/framework/packages/async-context/src/async-context.provider.ts",[],[],"/Volumes/Work/ts/hg/framework/packages/async-context/src/async-context.test-suite.ts",[],[],"/Volumes/Work/ts/hg/framework/packages/async-context/src/index.ts",[],[],"/Volumes/Work/ts/hg/framework/packages/validation/src/extensions.ts",[],["38"],"/Volumes/Work/ts/hg/framework/packages/validation/src/index.ts",[],[],"/Volumes/Work/ts/hg/framework/packages/validation/src/dto.ts",[],[],{"ruleId":"39","severity":2,"message":"40","line":17,"column":12,"nodeType":"41","messageId":"42","endLine":17,"endColumn":21,"fix":"43","suppressions":"44"},"@typescript-eslint/consistent-type-definitions","Use a `type` instead of an `interface`.","Identifier","typeOverInterface",{"range":"45","text":"46"},["47"],[283,370],"type ZodSchema<Output = any, Def extends ZodTypeDef = ZodTypeDef, Input = Output> = ",{"kind":"48","justification":"49"},"directive",""]
package/dist/dto.d.ts CHANGED
@@ -5,5 +5,5 @@ export type ZodDto<TOutput = any> = {
5
5
  schema: ZodSchema<TOutput, ZodTypeDef, unknown>;
6
6
  create(input: unknown): TOutput;
7
7
  };
8
- export declare function createZodDto<TOutput = any>(schema: ZodSchema<TOutput, ZodTypeDef, unknown>, name: string): ZodDto<TOutput>;
8
+ export declare function createZodDto<TOutput = any>(schema: ZodSchema<TOutput, ZodTypeDef, unknown>): ZodDto<TOutput>;
9
9
  //# sourceMappingURL=dto.d.ts.map
package/dist/dto.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"dto.d.ts","sourceRoot":"","sources":["../src/dto.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,SAAS,EACT,UAAU,EACV,MAAM,KAAK,CAAC;AAEb,MAAM,MAAM,MAAM,CAAC,OAAO,GAAG,GAAG,IAAI;IACnC,QAAQ,OAAO,CAAC;IAChB,QAAQ,EAAE,IAAI,CAAC;IACf,MAAM,EAAE,SAAS,CAAC,OAAO,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC;IAChD,MAAM,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC;CAChC,CAAA;AAED,wBAAgB,YAAY,CAAC,OAAO,GAAG,GAAG,EACzC,MAAM,EAAE,SAAS,CAAC,OAAO,EAAE,UAAU,EAAE,OAAO,CAAC,EAC/C,IAAI,EAAE,MAAM,GACV,MAAM,CAAC,OAAO,CAAC,CAajB"}
1
+ {"version":3,"file":"dto.d.ts","sourceRoot":"","sources":["../src/dto.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,SAAS,EACT,UAAU,EACV,MAAM,KAAK,CAAC;AAEb,MAAM,MAAM,MAAM,CAAC,OAAO,GAAG,GAAG,IAAI;IACnC,QAAQ,OAAO,CAAC;IAChB,QAAQ,EAAE,IAAI,CAAC;IACf,MAAM,EAAE,SAAS,CAAC,OAAO,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC;IAChD,MAAM,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC;CAChC,CAAA;AAED,wBAAgB,YAAY,CAAC,OAAO,GAAG,GAAG,EACzC,MAAM,EAAE,SAAS,CAAC,OAAO,EAAE,UAAU,EAAE,OAAO,CAAC,GAC7C,MAAM,CAAC,OAAO,CAAC,CAWjB"}
package/dist/dto.js CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.createZodDto = void 0;
4
- function createZodDto(schema, name) {
4
+ function createZodDto(schema) {
5
5
  class AugmentedZodDto {
6
6
  static isZodDto = true;
7
7
  static schema = schema;
@@ -9,7 +9,6 @@ function createZodDto(schema, name) {
9
9
  return this.schema.parse(input);
10
10
  }
11
11
  }
12
- Object.defineProperty(AugmentedZodDto, 'name', { value: name });
13
12
  return AugmentedZodDto;
14
13
  }
15
14
  exports.createZodDto = createZodDto;
package/dist/dto.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"dto.js","sourceRoot":"","sources":["../src/dto.ts"],"names":[],"mappings":";;;AAYA,SAAgB,YAAY,CAC3B,MAA+C,EAC/C,IAAY;IAEZ,MAAM,eAAe;QACb,MAAM,CAAC,QAAQ,GAAG,IAAI,CAAC;QACvB,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC;QAEvB,MAAM,CAAC,MAAM,CAAC,KAAc;YAClC,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAoB,CAAC;QACpD,CAAC;;IAGF,MAAM,CAAC,cAAc,CAAC,eAAe,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;IAEhE,OAAO,eAA6C,CAAC;AACtD,CAAC;AAhBD,oCAgBC"}
1
+ {"version":3,"file":"dto.js","sourceRoot":"","sources":["../src/dto.ts"],"names":[],"mappings":";;;AAYA,SAAgB,YAAY,CAC3B,MAA+C;IAE/C,MAAM,eAAe;QACb,MAAM,CAAC,QAAQ,GAAG,IAAI,CAAC;QACvB,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC;QAEvB,MAAM,CAAC,MAAM,CAAC,KAAc;YAClC,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAoB,CAAC;QACpD,CAAC;;IAGF,OAAO,eAA6C,CAAC;AACtD,CAAC;AAbD,oCAaC"}
@@ -4,7 +4,7 @@ declare module 'zod' {
4
4
  interface ZodSchema<Output = any, Def extends ZodTypeDef = ZodTypeDef, Input = Output> {
5
5
  enforceEnv<T extends ZodSchema<Output, Def, Input>>(this: T, name: string): ZodEffects<T, ZodInfer<T> | string>;
6
6
  transformBooleanString<T extends ZodSchema<Output, Def, Input>>(this: T): ZodPipeline<ZodEffects<T, boolean, ZodInput<T>>, ZodBoolean>;
7
- toClass<T extends ZodSchema<Output, Def, Input>>(this: T, name: string): ZodDto<ZodInfer<T>>;
7
+ toClass<T extends ZodSchema<Output, Def, Input>>(this: T): ZodDto<ZodInfer<T>>;
8
8
  }
9
9
  }
10
10
  //# sourceMappingURL=extensions.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"extensions.d.ts","sourceRoot":"","sources":["../src/extensions.ts"],"names":[],"mappings":"AAAA,OAAY,EACX,UAAU,EAEV,UAAU,EACV,KAAK,IAAI,QAAQ,EACjB,KAAK,IAAI,QAAQ,EACjB,WAAW,EACX,UAAU,EACV,MAAM,KAAK,CAAC;AACb,OAAO,EAEN,MAAM,EACN,MAAM,OAAO,CAAC;AAEf,OAAO,QAAQ,KAAK,CAAC;IAEpB,UAAU,SAAS,CAAC,MAAM,GAAG,GAAG,EAAE,GAAG,SAAS,UAAU,GAAG,UAAU,EAAE,KAAK,GAAG,MAAM;QACpF,UAAU,CAAC,CAAC,SAAS,SAAS,CAAC,MAAM,EAAE,GAAG,EAAE,KAAK,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,UAAU,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC;QAChH,sBAAsB,CAAC,CAAC,SAAS,SAAS,CAAC,MAAM,EAAE,GAAG,EAAE,KAAK,CAAC,EAC7D,IAAI,EAAE,CAAC,GACL,WAAW,CAAC,UAAU,CAAC,CAAC,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC;QAChE,OAAO,CAAC,CAAC,SAAS,SAAS,CAAC,MAAM,EAAE,GAAG,EAAE,KAAK,CAAC,EAC9C,IAAI,EAAE,CAAC,EACP,IAAI,EAAE,MAAM,GACV,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;KACvB;CACD"}
1
+ {"version":3,"file":"extensions.d.ts","sourceRoot":"","sources":["../src/extensions.ts"],"names":[],"mappings":"AAAA,OAAY,EACX,UAAU,EAEV,UAAU,EACV,KAAK,IAAI,QAAQ,EACjB,KAAK,IAAI,QAAQ,EACjB,WAAW,EACX,UAAU,EACV,MAAM,KAAK,CAAC;AACb,OAAO,EAEN,MAAM,EACN,MAAM,OAAO,CAAC;AAEf,OAAO,QAAQ,KAAK,CAAC;IAEpB,UAAU,SAAS,CAAC,MAAM,GAAG,GAAG,EAAE,GAAG,SAAS,UAAU,GAAG,UAAU,EAAE,KAAK,GAAG,MAAM;QACpF,UAAU,CAAC,CAAC,SAAS,SAAS,CAAC,MAAM,EAAE,GAAG,EAAE,KAAK,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,UAAU,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC;QAChH,sBAAsB,CAAC,CAAC,SAAS,SAAS,CAAC,MAAM,EAAE,GAAG,EAAE,KAAK,CAAC,EAC7D,IAAI,EAAE,CAAC,GACL,WAAW,CAAC,UAAU,CAAC,CAAC,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC;QAChE,OAAO,CAAC,CAAC,SAAS,SAAS,CAAC,MAAM,EAAE,GAAG,EAAE,KAAK,CAAC,EAAE,IAAI,EAAE,CAAC,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;KAC/E;CACD"}
@@ -11,7 +11,7 @@ zod_1.default.Schema.prototype.transformBooleanString = function () {
11
11
  .transform(value => (typeof value === 'boolean' ? value : value === 'true'))
12
12
  .pipe(zod_1.default.boolean());
13
13
  };
14
- zod_1.default.Schema.prototype.toClass = function (name) {
15
- return (0, dto_1.createZodDto)(this, name);
14
+ zod_1.default.Schema.prototype.toClass = function () {
15
+ return (0, dto_1.createZodDto)(this);
16
16
  };
17
17
  //# sourceMappingURL=extensions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"extensions.js","sourceRoot":"","sources":["../src/extensions.ts"],"names":[],"mappings":";;;AAAA,sDAQa;AACb,+BAGe;AAgBf,aAAG,CAAC,MAAM,CAAC,SAAS,CAAC,UAAU,GAAG,UAEjC,IAAY;IAEZ,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,CAAC;AAC5D,CAAC,CAAC;AAEF,aAAG,CAAC,MAAM,CAAC,SAAS,CAAC,sBAAsB,GAAG;IAG7C,OAAO,IAAI;SACT,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,OAAO,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,KAAK,MAAM,CAAC,CAAC;SAC3E,IAAI,CAAC,aAAG,CAAC,OAAO,EAAE,CAAC,CAAC;AACvB,CAAC,CAAC;AAEF,aAAG,CAAC,MAAM,CAAC,SAAS,CAAC,OAAO,GAAG,UAE9B,IAAY;IAEZ,OAAO,IAAA,kBAAY,EAAc,IAAI,EAAE,IAAI,CAAC,CAAC;AAC9C,CAAC,CAAC"}
1
+ {"version":3,"file":"extensions.js","sourceRoot":"","sources":["../src/extensions.ts"],"names":[],"mappings":";;;AAAA,sDAQa;AACb,+BAGe;AAaf,aAAG,CAAC,MAAM,CAAC,SAAS,CAAC,UAAU,GAAG,UAEjC,IAAY;IAEZ,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,CAAC;AAC5D,CAAC,CAAC;AAEF,aAAG,CAAC,MAAM,CAAC,SAAS,CAAC,sBAAsB,GAAG;IAG7C,OAAO,IAAI;SACT,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,OAAO,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,KAAK,MAAM,CAAC,CAAC;SAC3E,IAAI,CAAC,aAAG,CAAC,OAAO,EAAE,CAAC,CAAC;AACvB,CAAC,CAAC;AAEF,aAAG,CAAC,MAAM,CAAC,SAAS,CAAC,OAAO,GAAG;IAG9B,OAAO,IAAA,kBAAY,EAAc,IAAI,CAAC,CAAC;AACxC,CAAC,CAAC"}
package/dist-esm/dto.d.ts CHANGED
@@ -5,5 +5,5 @@ export type ZodDto<TOutput = any> = {
5
5
  schema: ZodSchema<TOutput, ZodTypeDef, unknown>;
6
6
  create(input: unknown): TOutput;
7
7
  };
8
- export declare function createZodDto<TOutput = any>(schema: ZodSchema<TOutput, ZodTypeDef, unknown>, name: string): ZodDto<TOutput>;
8
+ export declare function createZodDto<TOutput = any>(schema: ZodSchema<TOutput, ZodTypeDef, unknown>): ZodDto<TOutput>;
9
9
  //# sourceMappingURL=dto.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"dto.d.ts","sourceRoot":"","sources":["../src/dto.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,SAAS,EACT,UAAU,EACV,MAAM,KAAK,CAAC;AAEb,MAAM,MAAM,MAAM,CAAC,OAAO,GAAG,GAAG,IAAI;IACnC,QAAQ,OAAO,CAAC;IAChB,QAAQ,EAAE,IAAI,CAAC;IACf,MAAM,EAAE,SAAS,CAAC,OAAO,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC;IAChD,MAAM,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC;CAChC,CAAA;AAED,wBAAgB,YAAY,CAAC,OAAO,GAAG,GAAG,EACzC,MAAM,EAAE,SAAS,CAAC,OAAO,EAAE,UAAU,EAAE,OAAO,CAAC,EAC/C,IAAI,EAAE,MAAM,GACV,MAAM,CAAC,OAAO,CAAC,CAajB"}
1
+ {"version":3,"file":"dto.d.ts","sourceRoot":"","sources":["../src/dto.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,SAAS,EACT,UAAU,EACV,MAAM,KAAK,CAAC;AAEb,MAAM,MAAM,MAAM,CAAC,OAAO,GAAG,GAAG,IAAI;IACnC,QAAQ,OAAO,CAAC;IAChB,QAAQ,EAAE,IAAI,CAAC;IACf,MAAM,EAAE,SAAS,CAAC,OAAO,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC;IAChD,MAAM,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC;CAChC,CAAA;AAED,wBAAgB,YAAY,CAAC,OAAO,GAAG,GAAG,EACzC,MAAM,EAAE,SAAS,CAAC,OAAO,EAAE,UAAU,EAAE,OAAO,CAAC,GAC7C,MAAM,CAAC,OAAO,CAAC,CAWjB"}
package/dist-esm/dto.js CHANGED
@@ -1,4 +1,4 @@
1
- export function createZodDto(schema, name) {
1
+ export function createZodDto(schema) {
2
2
  class AugmentedZodDto {
3
3
  static isZodDto = true;
4
4
  static schema = schema;
@@ -6,7 +6,6 @@ export function createZodDto(schema, name) {
6
6
  return this.schema.parse(input);
7
7
  }
8
8
  }
9
- Object.defineProperty(AugmentedZodDto, 'name', { value: name });
10
9
  return AugmentedZodDto;
11
10
  }
12
11
  //# sourceMappingURL=dto.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"dto.js","sourceRoot":"","sources":["../src/dto.ts"],"names":[],"mappings":"AAYA,MAAM,UAAU,YAAY,CAC3B,MAA+C,EAC/C,IAAY;IAEZ,MAAM,eAAe;QACb,MAAM,CAAC,QAAQ,GAAG,IAAI,CAAC;QACvB,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC;QAEvB,MAAM,CAAC,MAAM,CAAC,KAAc;YAClC,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAoB,CAAC;QACpD,CAAC;;IAGF,MAAM,CAAC,cAAc,CAAC,eAAe,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;IAEhE,OAAO,eAA6C,CAAC;AACtD,CAAC"}
1
+ {"version":3,"file":"dto.js","sourceRoot":"","sources":["../src/dto.ts"],"names":[],"mappings":"AAYA,MAAM,UAAU,YAAY,CAC3B,MAA+C;IAE/C,MAAM,eAAe;QACb,MAAM,CAAC,QAAQ,GAAG,IAAI,CAAC;QACvB,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC;QAEvB,MAAM,CAAC,MAAM,CAAC,KAAc;YAClC,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAoB,CAAC;QACpD,CAAC;;IAGF,OAAO,eAA6C,CAAC;AACtD,CAAC"}
@@ -4,7 +4,7 @@ declare module 'zod' {
4
4
  interface ZodSchema<Output = any, Def extends ZodTypeDef = ZodTypeDef, Input = Output> {
5
5
  enforceEnv<T extends ZodSchema<Output, Def, Input>>(this: T, name: string): ZodEffects<T, ZodInfer<T> | string>;
6
6
  transformBooleanString<T extends ZodSchema<Output, Def, Input>>(this: T): ZodPipeline<ZodEffects<T, boolean, ZodInput<T>>, ZodBoolean>;
7
- toClass<T extends ZodSchema<Output, Def, Input>>(this: T, name: string): ZodDto<ZodInfer<T>>;
7
+ toClass<T extends ZodSchema<Output, Def, Input>>(this: T): ZodDto<ZodInfer<T>>;
8
8
  }
9
9
  }
10
10
  //# sourceMappingURL=extensions.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"extensions.d.ts","sourceRoot":"","sources":["../src/extensions.ts"],"names":[],"mappings":"AAAA,OAAY,EACX,UAAU,EAEV,UAAU,EACV,KAAK,IAAI,QAAQ,EACjB,KAAK,IAAI,QAAQ,EACjB,WAAW,EACX,UAAU,EACV,MAAM,KAAK,CAAC;AACb,OAAO,EAEN,MAAM,EACN,MAAM,OAAO,CAAC;AAEf,OAAO,QAAQ,KAAK,CAAC;IAEpB,UAAU,SAAS,CAAC,MAAM,GAAG,GAAG,EAAE,GAAG,SAAS,UAAU,GAAG,UAAU,EAAE,KAAK,GAAG,MAAM;QACpF,UAAU,CAAC,CAAC,SAAS,SAAS,CAAC,MAAM,EAAE,GAAG,EAAE,KAAK,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,UAAU,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC;QAChH,sBAAsB,CAAC,CAAC,SAAS,SAAS,CAAC,MAAM,EAAE,GAAG,EAAE,KAAK,CAAC,EAC7D,IAAI,EAAE,CAAC,GACL,WAAW,CAAC,UAAU,CAAC,CAAC,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC;QAChE,OAAO,CAAC,CAAC,SAAS,SAAS,CAAC,MAAM,EAAE,GAAG,EAAE,KAAK,CAAC,EAC9C,IAAI,EAAE,CAAC,EACP,IAAI,EAAE,MAAM,GACV,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;KACvB;CACD"}
1
+ {"version":3,"file":"extensions.d.ts","sourceRoot":"","sources":["../src/extensions.ts"],"names":[],"mappings":"AAAA,OAAY,EACX,UAAU,EAEV,UAAU,EACV,KAAK,IAAI,QAAQ,EACjB,KAAK,IAAI,QAAQ,EACjB,WAAW,EACX,UAAU,EACV,MAAM,KAAK,CAAC;AACb,OAAO,EAEN,MAAM,EACN,MAAM,OAAO,CAAC;AAEf,OAAO,QAAQ,KAAK,CAAC;IAEpB,UAAU,SAAS,CAAC,MAAM,GAAG,GAAG,EAAE,GAAG,SAAS,UAAU,GAAG,UAAU,EAAE,KAAK,GAAG,MAAM;QACpF,UAAU,CAAC,CAAC,SAAS,SAAS,CAAC,MAAM,EAAE,GAAG,EAAE,KAAK,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,UAAU,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC;QAChH,sBAAsB,CAAC,CAAC,SAAS,SAAS,CAAC,MAAM,EAAE,GAAG,EAAE,KAAK,CAAC,EAC7D,IAAI,EAAE,CAAC,GACL,WAAW,CAAC,UAAU,CAAC,CAAC,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC;QAChE,OAAO,CAAC,CAAC,SAAS,SAAS,CAAC,MAAM,EAAE,GAAG,EAAE,KAAK,CAAC,EAAE,IAAI,EAAE,CAAC,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;KAC/E;CACD"}
@@ -8,7 +8,7 @@ zod.Schema.prototype.transformBooleanString = function () {
8
8
  .transform(value => (typeof value === 'boolean' ? value : value === 'true'))
9
9
  .pipe(zod.boolean());
10
10
  };
11
- zod.Schema.prototype.toClass = function (name) {
12
- return createZodDto(this, name);
11
+ zod.Schema.prototype.toClass = function () {
12
+ return createZodDto(this);
13
13
  };
14
14
  //# sourceMappingURL=extensions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"extensions.js","sourceRoot":"","sources":["../src/extensions.ts"],"names":[],"mappings":"AAAA,OAAO,GAQN,MAAM,KAAK,CAAC;AACb,OAAO,EACN,YAAY,GAEZ,MAAM,OAAO,CAAC;AAgBf,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,UAAU,GAAG,UAEjC,IAAY;IAEZ,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,CAAC;AAC5D,CAAC,CAAC;AAEF,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,sBAAsB,GAAG;IAG7C,OAAO,IAAI;SACT,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,OAAO,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,KAAK,MAAM,CAAC,CAAC;SAC3E,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC;AACvB,CAAC,CAAC;AAEF,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,OAAO,GAAG,UAE9B,IAAY;IAEZ,OAAO,YAAY,CAAc,IAAI,EAAE,IAAI,CAAC,CAAC;AAC9C,CAAC,CAAC"}
1
+ {"version":3,"file":"extensions.js","sourceRoot":"","sources":["../src/extensions.ts"],"names":[],"mappings":"AAAA,OAAO,GAQN,MAAM,KAAK,CAAC;AACb,OAAO,EACN,YAAY,GAEZ,MAAM,OAAO,CAAC;AAaf,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,UAAU,GAAG,UAEjC,IAAY;IAEZ,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,CAAC;AAC5D,CAAC,CAAC;AAEF,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,sBAAsB,GAAG;IAG7C,OAAO,IAAI;SACT,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,OAAO,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,KAAK,MAAM,CAAC,CAAC;SAC3E,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC;AACvB,CAAC,CAAC;AAEF,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,OAAO,GAAG;IAG9B,OAAO,YAAY,CAAc,IAAI,CAAC,CAAC;AACxC,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hg-ts/validation",
3
- "version": "0.1.16",
3
+ "version": "0.1.17",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist-esm/index.js",
6
6
  "repository": "git@gitlab.com:hyper-graph/framework.git",
@@ -12,10 +12,10 @@
12
12
  "lint:fix": "hg lint:fix"
13
13
  },
14
14
  "devDependencies": {
15
- "@hg-ts-config/eslint-config": "0.1.16",
16
- "@hg-ts-config/typescript": "0.1.16",
17
- "@hg-ts/cli": "0.1.16",
18
- "@hg-ts/types": "0.1.16",
15
+ "@hg-ts-config/eslint-config": "0.1.17",
16
+ "@hg-ts-config/typescript": "0.1.17",
17
+ "@hg-ts/cli": "0.1.17",
18
+ "@hg-ts/types": "0.1.17",
19
19
  "@types/node": "20.8.7",
20
20
  "@typescript-eslint/eslint-plugin": "6.8.0",
21
21
  "@typescript-eslint/parser": "6.8.0",
package/src/dto.ts CHANGED
@@ -12,7 +12,6 @@ export type ZodDto<TOutput = any> = {
12
12
 
13
13
  export function createZodDto<TOutput = any>(
14
14
  schema: ZodSchema<TOutput, ZodTypeDef, unknown>,
15
- name: string,
16
15
  ): ZodDto<TOutput> {
17
16
  class AugmentedZodDto {
18
17
  public static isZodDto = true;
@@ -23,7 +22,5 @@ export function createZodDto<TOutput = any>(
23
22
  }
24
23
  }
25
24
 
26
- Object.defineProperty(AugmentedZodDto, 'name', { value: name });
27
-
28
25
  return AugmentedZodDto as unknown as ZodDto<TOutput>;
29
26
  }
package/src/extensions.ts CHANGED
@@ -19,10 +19,7 @@ declare module 'zod' {
19
19
  transformBooleanString<T extends ZodSchema<Output, Def, Input>>(
20
20
  this: T,
21
21
  ): ZodPipeline<ZodEffects<T, boolean, ZodInput<T>>, ZodBoolean>;
22
- toClass<T extends ZodSchema<Output, Def, Input>>(
23
- this: T,
24
- name: string,
25
- ): ZodDto<ZodInfer<T>>;
22
+ toClass<T extends ZodSchema<Output, Def, Input>>(this: T): ZodDto<ZodInfer<T>>;
26
23
  }
27
24
  }
28
25
 
@@ -43,7 +40,6 @@ zod.Schema.prototype.transformBooleanString = function<T extends ZodSchema>(
43
40
 
44
41
  zod.Schema.prototype.toClass = function<T extends ZodSchema>(
45
42
  this: T,
46
- name: string,
47
43
  ): ZodDto<ZodInfer<T>> {
48
- return createZodDto<ZodInfer<T>>(this, name);
44
+ return createZodDto<ZodInfer<T>>(this);
49
45
  };