3 ms·
That's not necessarily true. You can write type assertion functions that validate the input is a given shape. In theory, you'd use these type assertion method
by gavinray 2y ago
That's not necessarily true.
You can write type assertion functions that validate the input is a given shape.
In theory, you'd use these type assertion methods at any API boundaries a single time for external inputs/outputs in a "Parse, Don't Validate" approach to cover your bases.
- mijamo 2y agoSoooo exactly what Zod is doing?