Colin McDonnell

Results 258 comments of Colin McDonnell

Clever pattern, and thanks for the PR! But this is obscure enough that I'd rather not make a significant addition to the docs - it makes the docs feel more...

In my experiments, this isn't a solvable problem, but perhaps others can succeed where I've failed.

> Wondering if .getLiterals() should be optional Yep this would be defined on `ZodType` with a default implementation, as you say. It would probably also be `protected`...not sure this is...

`deepPartial` is very fragile and probably shouldn't have been added. Zod intentionally avoids "modes" and contextual validation - it's too hard to reason about. Using `z.strictObject` everywhere is the recommended...

> Curious to know what .remap adds vs .transform it's not straighforward to me The `.transform()` method lets you transform the data and returns a `ZodEffects` instance. The `.remap()` is...

So I actually think the ambiguity pointed out by @iiAku is kind of a fatal flaw. I also think `.remap()` would be more valuable as a post-parse transform anyway, as...

This is intentional. Unfortunately the runtime behavior of `.catchall()` does not agree with TypeScript's interpretation of index signatures. For instance you can't declare this type: ```ts type A = {...

@valeneiko Consider `z.record` for your specific use case.

> Nvm, just realized the type is not actually usable, just displays like that. Indeed, this is exactly what threw me off in the first place 😅