Comment by alpinisme

Comment by alpinisme 2 days ago

1 reply

Most languages have a way to represent a blob of bytes that you don’t care about the internal shape or meaning of. The point of parsing is to validate the stuff that you want to use. To use the Zod example from up-thread, you can use z.unknown() or use z.looseObject() if you care about some keys but not others (while wanting to propagate the whole object).

skybrian 2 days ago

Yep. Although, sometimes checking the data is the point. It will depend on whether you want to catch errors early.