-
-
Notifications
You must be signed in to change notification settings - Fork 220
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: return a template literal for uuid
action
#945
Comments
Thanks for creating this issue. At the moment |
Thanks, once you do tell me if I can help somehow |
Feel free to join our discussion in #986, which is strongly related to this issue. |
As I wrote in PR #986, I plan to look at this again before releasing v2. If you would like such a feature (for other similar actions as well), please give this comment a thumbs up and share your use case with us. |
I was looking for similar functionality in the output of From a user perspective, it makes sense that after passing validation the type should be narrowed After reading #986 I understand it may not be as straightforward as it seems on the surface. But for my use-case, const NarrowingIpv4 = v.custom<`${number}.${number}.${number}.${number}`>(
(input) => (typeof input === "string" ? v.IPV4_REGEX.test(input) : false)
); It would be nice if that behavior was built-in |
Thank you for your feedback! I will consider it in the long run. |
This is just a small idea, feel free to close.
While working with node/web crypto I've noticed that
randomUUID
returns a template literal:Would it be possible to do the same for
uuid
action? Is it sufficient to change theTOutput
of itsBaseValidation
?valibot/library/src/actions/uuid/uuid.ts
Line 41 in eac543c
The text was updated successfully, but these errors were encountered: