mirror of
https://github.com/thinkjs/thinkjs.git
synced 2026-02-01 15:23:03 +00:00
Fix: fix validate error by regexp when value is empty
This commit is contained in:
parent
4f596b154f
commit
34de1bfa43
@ -763,6 +763,9 @@ Validator.object = value => {
|
||||
* @return {Boolean} []
|
||||
*/
|
||||
Validator.regexp = (value, reg) => {
|
||||
if(!value){
|
||||
return true;
|
||||
}
|
||||
return reg.test(value);
|
||||
};
|
||||
/**
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user