'email' is unresolvable

I have a project that was pretty heavily invested in using ArkType for my validation, and with 2.0 coming out as stable i figured I'd start a branch and see if anything broke. While there might be other breaking changes, apparently using the email magic word is breaking. For example
export const emailValidator = type('email');
export const emailValidator = type('email');
Gives me the RSoD with the error
Argument of type '"email"' is not assignable to parameter of type '"'email' is unresolvable "'.ts(2345)
Argument of type '"email"' is not assignable to parameter of type '"'email' is unresolvable "'.ts(2345)
I also don't see other helper types like uuid, or creditCard Anyone else running into this?
4 Replies
TizzySaurus
TizzySaurus5d ago
Iirc it's now string.email, etc
ssalbdivad
ssalbdivad5d ago
You probably won't see a lot of breaking changes, but yeah subtypes/transforms are prefixed under corresponding TS types now as @TizzySaurus mentioned
jhechtf
jhechtfOP5d ago
Ah weird. We should update the docs/Readme because it's got email still in it.
ssalbdivad
ssalbdivad5d ago
Good reminder I will replace the README today with just links to the docs, I've really been slacking on that. Everything on arktype.io will be up to date

Did you find this page helpful?