This commit is contained in:
2026-06-08 00:47:06 +03:00
parent 3fe22b1700
commit ddfeae6cd1
2 changed files with 5 additions and 2 deletions
-2
View File
@@ -150,8 +150,6 @@ export class FormValidator extends Validator {
let result = this.handlers[ rule ] (val ?? null, !!input, args, format);
console.log( val + ' ' + rule + ' ' + JSON.stringify ( format) )
if (result === false) {
pass = false;
+5
View File
@@ -38,6 +38,11 @@ export class Validator {
return !present ? null : Number.isInteger(Number(val));
},
digits: (val, present, arg, format) => {
format.value = Validator.INPUT_NUM;
return !present ? null : (Number.isInteger(Number(val)) && String(val).length == arg);
},
boolean: (val, present, arg, format) => {
format.value = Validator.INPUT_NUM;
return !present ? null : [true, false, 0, 1, '0', '1'].includes(val);