1
0
mirror of synced 2024-11-25 06:46:02 +03:00

Merge pull request #30 from 1on/url-validator-fix

fix: Url validator now allows empty value
This commit is contained in:
Kruglov Kirill 2021-08-03 10:53:51 +03:00 committed by GitHub
commit f054290abd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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)
}, },