updates
This commit is contained in:
@@ -150,8 +150,6 @@ export class FormValidator extends Validator {
|
|||||||
|
|
||||||
let result = this.handlers[ rule ] (val ?? null, !!input, args, format);
|
let result = this.handlers[ rule ] (val ?? null, !!input, args, format);
|
||||||
|
|
||||||
console.log( val + ' ' + rule + ' ' + JSON.stringify ( format) )
|
|
||||||
|
|
||||||
if (result === false) {
|
if (result === false) {
|
||||||
|
|
||||||
pass = false;
|
pass = false;
|
||||||
|
|||||||
@@ -38,6 +38,11 @@ export class Validator {
|
|||||||
return !present ? null : Number.isInteger(Number(val));
|
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) => {
|
boolean: (val, present, arg, format) => {
|
||||||
format.value = Validator.INPUT_NUM;
|
format.value = Validator.INPUT_NUM;
|
||||||
return !present ? null : [true, false, 0, 1, '0', '1'].includes(val);
|
return !present ? null : [true, false, 0, 1, '0', '1'].includes(val);
|
||||||
|
|||||||
Reference in New Issue
Block a user