@win2win/shared 1.0.106 → 1.0.108

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.
@@ -11,7 +11,8 @@ export declare enum PropValidatorKeys {
11
11
  SOLO_NUMEROS = "onlyNumbers",
12
12
  EMAIL = "email",
13
13
  URL = "url",
14
- DNI = "dni"
14
+ DNI = "dni",
15
+ IBAN = "iban"
15
16
  }
16
17
  export declare const VALIDATORS: {
17
18
  fn: (val: number) => (control: GamaPropModel) => boolean;
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VALIDATORS = exports.PropValidatorKeys = exports.GamaPropValidatorsMap = void 0;
4
4
  const better_dni_1 = require("better-dni");
5
+ const iban = require("iban");
5
6
  exports.GamaPropValidatorsMap = {
6
7
  required: {
7
8
  fn: () => (control) => {
@@ -87,6 +88,15 @@ exports.GamaPropValidatorsMap = {
87
88
  message: "El dni no es válido",
88
89
  label: "Identificación (DNI, NIF, NIE)",
89
90
  },
91
+ iban: {
92
+ fn: () => (control) => {
93
+ if (!control.value)
94
+ return true;
95
+ return iban.isValid(String(control.value) || "");
96
+ },
97
+ message: "El IBAN no es válido",
98
+ label: "Cuenta Bancaria (IBAN)",
99
+ },
90
100
  };
91
101
  var PropValidatorKeys;
92
102
  (function (PropValidatorKeys) {
@@ -97,5 +107,6 @@ var PropValidatorKeys;
97
107
  PropValidatorKeys["EMAIL"] = "email";
98
108
  PropValidatorKeys["URL"] = "url";
99
109
  PropValidatorKeys["DNI"] = "dni";
110
+ PropValidatorKeys["IBAN"] = "iban";
100
111
  })(PropValidatorKeys || (exports.PropValidatorKeys = PropValidatorKeys = {}));
101
112
  exports.VALIDATORS = Object.entries(exports.GamaPropValidatorsMap).map(([key, value]) => ({ value: key, ...value }));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@win2win/shared",
3
- "version": "1.0.106",
3
+ "version": "1.0.108",
4
4
  "description": "Tipos, interfaces, funciones, constantes, clases y enums compartidos por todos los proyectos de Win2Win",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -15,9 +15,11 @@
15
15
  "dist/**/*"
16
16
  ],
17
17
  "devDependencies": {
18
+ "@types/iban": "^0.0.35",
18
19
  "typescript": "^5.5.2"
19
20
  },
20
21
  "dependencies": {
21
- "better-dni": "^4.4.2"
22
+ "better-dni": "^4.4.2",
23
+ "iban": "^0.0.14"
22
24
  }
23
25
  }