@x-spacy/class-validator 1.4.0 → 1.4.3

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.
@@ -3,6 +3,8 @@ declare module '@x-spacy/class-validator' {
3
3
 
4
4
  export declare function isCPF(document: string): boolean;
5
5
 
6
+ export declare function IsRG(document: string): boolean;
7
+
6
8
  export declare function isCREF(document: string): boolean;
7
9
 
8
10
  export declare function isCRM(document: string): boolean;
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ const class_validator_1 = require("class-validator");
13
+ const _1 = require(".");
14
+ class DocumentValidator {
15
+ constructor(document, type) {
16
+ this.document = document;
17
+ this.type = type;
18
+ }
19
+ }
20
+ __decorate([
21
+ (0, _1.IsDocument)(),
22
+ __metadata("design:type", String)
23
+ ], DocumentValidator.prototype, "document", void 0);
24
+ __decorate([
25
+ (0, class_validator_1.IsEnum)(_1.DocumentTypeEnum),
26
+ __metadata("design:type", String)
27
+ ], DocumentValidator.prototype, "type", void 0);
28
+ (0, class_validator_1.validate)(new DocumentValidator('70667148493', _1.DocumentTypeEnum.CNPJ)).then(errors => {
29
+ console.log(errors);
30
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@x-spacy/class-validator",
3
- "version": "1.4.0",
3
+ "version": "1.4.3",
4
4
  "description": "Validators extension for class-validator lib",
5
5
  "license": "MIT",
6
6
  "private": false,
@@ -24,18 +24,18 @@
24
24
  "node": "v22.18.0"
25
25
  },
26
26
  "dependencies": {
27
- "class-validator": "^0.14.2",
28
- "validator": "^13.15.15"
27
+ "class-validator": "^0.14.3",
28
+ "validator": "^13.15.23"
29
29
  },
30
30
  "peerDependencies": {
31
31
  "class-validator": ">=0.14.1"
32
32
  },
33
33
  "devDependencies": {
34
- "@nestjs/cli": "^11.0.10",
35
- "@types/node": "^22.18.0",
34
+ "@nestjs/cli": "^11.0.14",
35
+ "@types/node": "^22.19.3",
36
36
  "@x-spacy/eslint-config": "^1.35.0",
37
- "eslint": "^9.34.0",
38
- "typescript": "^5.9.2"
37
+ "eslint": "^9.39.2",
38
+ "typescript": "^5.9.3"
39
39
  },
40
40
  "scripts": {
41
41
  "build": "nest build"