Marco Santos

Results 14 issues of Marco Santos

# Overview - Added support for the `ZodReadonly` type. - Added support for `deep readonly` as well. - Added option to toggle on/off the object freezing (`Object.freeze`) behavior This type...

# Pattern matching in Unions ## Overview This PR adds a pattern matching function to `ZodUnions`, similar to [`Runtypes`](https://github.com/pelotom/runtypes#pattern-matching) The code is a bit complex so I can go through...

# Overview As we know, the `passthrough` option allows any key to, as the name suggests, pass through the parser. This PR adds a `{ [k: string] any }` index...

# Overview This tiny PR adds overflows to `pick`, `omit`, `partial`, and `required` in ZodObject's methods. Now you can define which keys to pick, omit, or make partial/required by passing...

This PR adds two methods to `ZodEnum`: 1. `extract` 2. `exclude` Both work exactly like the TS utility types of the same name. You call `.extract()` with values that exist...

# Closes #1582 This PR makes it possible to pass an `enum` or an instance of a `ZodNativeEnum` to a `ZodObject` as its shape. Output/Input types are inferred correctly, and...

## Closes #1690 This PR adds the `ZodRequired` type, which removes any `undefined` from both the schema's output _and_ input. > ~Note: I couldn't add `.required()` to the root `ZodType`...

zod4

```ts const MySchema = z.string({ description: 'this is a string schema' }).optional() // => No longer has the description associated with it ``` This is because we are not passing...

This PR adds `mergeDeep` to `ZodObject`. It's now possible to merge two `ZodObjects` deeply. The method follows the same rules as `merge`—keys of `B` have priority over those from `A`,...

This PR adds the following extra coercions: 1. `Set` -> `Array` in `ZodArray` 2. `Set` -> `Array` in `ZodTuple` 3. `Array` -> `Set` in `ZodSet` 4. `Object` -> `Map` in...