1
0
mirror of synced 2024-11-25 14:56:03 +03:00

fix: Validator groups enlargement, number validation rule

This commit is contained in:
Zaytsev Kirill 2020-10-22 14:20:50 +03:00
parent c85f3332eb
commit 434b288a3c
2 changed files with 2 additions and 2 deletions

View File

@ -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)))
},
/**

View File

@ -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