@x-spacy/class-validator 1.4.11 → 1.4.12

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,14 +3,17 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.isRG = isRG;
4
4
  function isRG(document) {
5
5
  document = document.replace(/[^0-9]/g, '');
6
- if (document.length !== 9) {
6
+ if (document.length < 7) {
7
7
  return false;
8
8
  }
9
- const digits = document.substring(0, 8);
10
- const firstVerifier = document.charAt(8);
11
- if (!/^\d{8}$/.test(digits)) {
9
+ if (!/^\d+$/.test(document)) {
12
10
  return false;
13
11
  }
12
+ if (document.length < 9) {
13
+ return true;
14
+ }
15
+ const digits = document.substring(0, 8);
16
+ const firstVerifier = document.charAt(8);
14
17
  const weights = [2, 3, 4, 5, 6, 7, 8, 9];
15
18
  let sum = 0;
16
19
  for (let i = 0; i < 8; i++) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@x-spacy/class-validator",
3
- "version": "1.4.11",
3
+ "version": "1.4.12",
4
4
  "description": "Validators extension for class-validator lib",
5
5
  "license": "MIT",
6
6
  "private": false,
@@ -28,16 +28,16 @@
28
28
  },
29
29
  "dependencies": {
30
30
  "class-validator": "^0.14.3",
31
- "validator": "^13.15.23"
31
+ "validator": "^13.15.26"
32
32
  },
33
33
  "peerDependencies": {
34
34
  "class-validator": ">=0.14.1"
35
35
  },
36
36
  "devDependencies": {
37
- "@nestjs/cli": "^11.0.14",
38
- "@types/node": "^22.19.3",
37
+ "@nestjs/cli": "^11.0.16",
38
+ "@types/node": "^22.19.11",
39
39
  "@x-spacy/eslint-config": "^1.35.0",
40
- "eslint": "^9.39.2",
40
+ "eslint": "^9.39.3",
41
41
  "typescript": "^5.9.3"
42
42
  }
43
43
  }