Early codependent field validation
I’m making a signup form following the example here https://arktype.io/docs/expressions#narrow
If you add another field, e.g. email, the narrow doesn’t run until email is valid.
After reading other posts, I believe this is intended behavior. So then I went to try and add the .narrow into confirmPassword, but the type of
Since it’s unknown, this means having to do some really gross checks and type coercions to correctly check that password and confirmPassword don’t match. Wondering if there’s anything better I can do here.
If you add another field, e.g. email, the narrow doesn’t run until email is valid.
After reading other posts, I believe this is intended behavior. So then I went to try and add the .narrow into confirmPassword, but the type of
ctx.root ends up being unknown, since we’re still validating the type, which makes sense.Since it’s unknown, this means having to do some really gross checks and type coercions to correctly check that password and confirmPassword don’t match. Wondering if there’s anything better I can do here.