Easier way to chain off of string.integer.parse?
I'm essentially trying to replicate this behavior from Zod:
The best way I've found to do it with Arktype is with a
.narrow
, but I'm wondering if theres something simpler
5 Replies
Check out the last example on the morphs and more page.
.to
allows you to pipe a morph to another definition directly
I will be sure to add a section for that to the primary expression docs as wellI guess
type("string.integer.parse).to("number>5")
is what you're afterI SWEAR i tried that 😠ðŸ˜
thanks!
I hacked into your local network and had previously modified the source to not enforce anything, just switched it back
😂 not completely convinced its not true..
I think i saw a diff example that was
.to.
and i tried that and saw nothing useful to chain off that