Colin McDonnell

Results 258 comments of Colin McDonnell

Thanks, great stuff. I'm merging this into the `v4` branch as a starting point, but the API is likely to change before this lands. I actually think this would be...

Yes, a schema that encapsulates the `JSON.parse` step. `Input` is `string`, `Output` is inferred from the arguments: ```ts const schema = z.json(z.object({ name: z.string() })) schema.parse(`{ "name": "Maarten" }`) ```

Thanks! Great PR. I think this is a good step towards better error reporting for intersections so I'm merging it into the `v4` branch. That said, this is likely to...

Thanks @ibr4qr! Zod's docs are getting a big refresh soon and I'll make sure this is fixed.

Fixed in https://github.com/colinhacks/zod/commit/4a618ef798231cdf152e55e506e7f21096d27468 👍

@benllshua The line & column number should appear a few lines above the part that you screenshotted. I agree it would be nice to clean up the stack trace a...

I disagree, this is a very real issue: > The default error needs to include the location of the error, line of code, and variable name... currently, I think it's...

This has landed in Zod 3.23. https://github.com/colinhacks/zod/releases/tag/v3.23.0

I understand the impulse here, but Zod schemas are designed to be self-contained. The idea of a schema behaving differently based on its parent schema breaks encapsulation. If the transformation...