Why can't I (or how do I) pipe to a union? #1168
Unanswered
matthew-dean
asked this question in
Q&A
Replies: 1 comment
-
Here is the fix: const Schema = v.union([v.pipe(v.string(), v.url()), v.literal('')]); |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I don't understand why this throws a type error:
It seems like a logical construction. First, pipe that it's a string, then allow a union for the next value. What's wrong with this? The type error is:
Beta Was this translation helpful? Give feedback.
All reactions