colinhacks/zod — reverse-engineered prompt

Reverse engineered prompt

I want a small TypeScript first data validation library I can use in Node or the browser. The idea is that I should be able to define schemas for things like strings, numbers, objects, arrays, and nested data, then validate unknown input against them and get back clean typed data I can trust. Please make the API feel simple and fluent, with basic methods to parse data, a safe version that returns success or error instead of throwing, and async versions for cases where validation or transforms need to wait.

It should give really clear validation errors with useful paths and messages, and it should infer TypeScript types from the schemas automatically so I do not have to write the same types twice. If input and output types differ because of transforms, support that too. Keep it lightweight, dependency free if possible, and include examples, tests, and a way to convert schemas to JSON Schema. Look up current docs online if you need to.

Want more depth? Deep Reverse