Currently the object schemas look like const Schema: z.ZodType<> = ...;
As mentioned in #64 this causes properties to go missing. However, that PR suggests removing this annotation which @omar-dulaimi states causes problems with tRPC.
This PR uses the satisfies operator to provide the type information instead. I am using this approach in a tRPC project without an issue.
References
Compare the difference in explicit type annotation vs satisfies here:
Description
Currently the object schemas look like
const Schema: z.ZodType<> = ...
;As mentioned in #64 this causes properties to go missing. However, that PR suggests removing this annotation which @omar-dulaimi states causes problems with tRPC.
This PR uses the
satisfies
operator to provide the type information instead. I am using this approach in a tRPC project without an issue.References
Compare the difference in explicit type annotation vs
satisfies
here:https://www.typescriptlang.org/play?#code/JYWwDg9gTgLgBAbzgLzgXzgMyhEcDkyEAJvgNxxwD0VcMAnmAKYDOAXHAMwB0ATAIzcALACgRTAB6RYdRkzgBVFkygBhKEwCGMeQF5EIysGIcWMKMAB2Ac0NxLmkEwD8p81dtoxAYwiWzispqGtpMAMreABZMIJoAWiQAKnIcyNwJxMnMADxKKupaOgB8cPppEABGAFZM3jAAFAh2xqncZhY29QCUADR2Dk6t7R7d3BBgMMB+mgA23X1oXWJ5wYXhUTHxSXJjIMAwdpRHxycnNHAAes4+fgErBaER0bFh2sAsmMCspShj1bUNJpGEy-YadXr9RxMIbucFjCZTBxzCGLOAsN4fL4sX4ZLJMXJBB7FZaEkI6J6bV6TTGsXb7Q6nRmM85XERAA