1
0
Fork 0
mirror of synced 2025-04-02 21:06:14 +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
*/
url ({ value }: ValidationContext): boolean {
if (!value) {
return true
}
return isUrl(value)
},