3 ms·
I have been using zod to create validation functions. The validation functions give the TS compiler hints about the types that are output after validation. I t
by emadda 3y ago
I have been using zod to create validation functions. The validation functions give the TS compiler hints about the types that are output after validation.
I think you either:
(1) start with the runtime code and derive the types (what TS does by default).
or (2) start with the types and derive the runtime code (like "macros" in some languages).
Does anyone have any suggestions for the best way to do this in a Node runtime?