davidmdm / myzod

MIT License
315 stars 20 forks source link

How can I extend object? #51

Closed Code-Hex closed 2 years ago

Code-Hex commented 2 years ago

zod has been supported extend API. Is it possible like this in myzod also?

davidmdm commented 2 years ago

No, there is no extend API. Since schema's should be static for best performance, it was not deemed an important feature. However you can manipulate schemas by using omit and intersections.

Myzod aims to be a simpler more performant version of zod not to be a 1:1 reimplementation.

It was very useful when zod was not performant enough to be viable on the server, but I believe that has changed recently.