fix: Validator groups enlargement, number validation rule
This commit is contained in:
parent
c85f3332eb
commit
434b288a3c
@ -225,7 +225,7 @@ export default {
|
||||
* Rule: checks if the value is only alpha numeric
|
||||
*/
|
||||
number ({ value }: { value: any }): Promise<boolean> {
|
||||
return Promise.resolve(!isNaN(Number(value)))
|
||||
return Promise.resolve(String(value).length > 0 && !isNaN(Number(value)))
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -68,7 +68,7 @@ export function createValidatorGroups (rules: [ValidationRule, any[], string, st
|
||||
bail: true,
|
||||
})))
|
||||
} else {
|
||||
groups.push(...rules.map(mapper))
|
||||
groups.push(...enlarge(rules.map(mapper)))
|
||||
}
|
||||
|
||||
return groups
|
||||
|
Loading…
Reference in New Issue
Block a user