1
0
mirror of synced 2024-11-24 22:36:02 +03:00

fix: Url validator now allows empty value

This commit is contained in:
1on 2021-08-03 10:52:10 +03:00
parent b5961c52eb
commit 1023ae2fc1

View File

@ -250,6 +250,10 @@ const rules: Record<string, ValidationRuleFn> = {
* Rule: checks if a string is a valid url * Rule: checks if a string is a valid url
*/ */
url ({ value }: ValidationContext): boolean { url ({ value }: ValidationContext): boolean {
if (!value) {
return true
}
return isUrl(value) return isUrl(value)
}, },