Merge pull request #30 from 1on/url-validator-fix
fix: Url validator now allows empty value
This commit is contained in:
commit
f054290abd
1 changed files with 4 additions and 0 deletions
|
@ -250,6 +250,10 @@ const rules: Record<string, ValidationRuleFn> = {
|
|||
* Rule: checks if a string is a valid url
|
||||
*/
|
||||
url ({ value }: ValidationContext): boolean {
|
||||
if (!value) {
|
||||
return true
|
||||
}
|
||||
|
||||
return isUrl(value)
|
||||
},
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue