From 1023ae2fc17b4a170d1ba444f1222fd0563b5caa Mon Sep 17 00:00:00 2001 From: 1on Date: Tue, 3 Aug 2021 10:52:10 +0300 Subject: [PATCH] fix: Url validator now allows empty value --- src/validation/rules.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/validation/rules.ts b/src/validation/rules.ts index 383453a..3ee278b 100644 --- a/src/validation/rules.ts +++ b/src/validation/rules.ts @@ -250,6 +250,10 @@ const rules: Record = { * Rule: checks if a string is a valid url */ url ({ value }: ValidationContext): boolean { + if (!value) { + return true + } + return isUrl(value) },