fix(v1): proper Invalid URL handling
This commit is contained in:
parent
2cbc4c59ce
commit
26f2095de6
|
@ -30,7 +30,14 @@ export const url = z.preprocess(
|
|||
"URL must have a valid top-level domain or be a valid path"
|
||||
)
|
||||
.refine(
|
||||
(x) => checkUrl(x as string),
|
||||
(x) => {
|
||||
try {
|
||||
checkUrl(x as string)
|
||||
return true;
|
||||
} catch (_) {
|
||||
return false;
|
||||
}
|
||||
},
|
||||
"Invalid URL"
|
||||
)
|
||||
.refine(
|
||||
|
|
Loading…
Reference in New Issue