sanitizing output based on output schema
As i understand, the
.output will only ensure the schema is respected, but will not sanitize output on the go (even tho it could be possible with a z.strictObject()):
but for some reason the typing does not work. could somebody point out how to achieve similar but in a working way? is there no way to do what i want?1 Reply
it's super ugly but it works:
use as:
myQuery's output will be typed properly as { id: string } but imho the wild use of .use() and .concat() in the wild is not good. i'd really love that we can do named procedure extensions to have a meaningful way to express these kind of plugins.