Skip to content

Commit 1c9acbb

Browse files
authored
Merge branch 'master' into ItMaga-patch-1
2 parents e8fe530 + af08390 commit 1c9acbb

13 files changed

+431
-186
lines changed

README.md

Lines changed: 76 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -45,20 +45,32 @@
4545
4646
#### Go to [zod.js.org](https://zod.js.org) >> -->
4747

48+
- [Table of contents](#table-of-contents)
4849
- [Introduction](#introduction)
4950
- [Sponsors](#sponsors)
51+
- [Gold](#gold)
52+
- [Silver](#silver)
53+
- [Bronze](#bronze)
5054
- [Ecosystem](#ecosystem)
55+
- [Resources](#resources)
56+
- [API libraries](#api-libraries)
57+
- [Form integrations](#form-integrations)
58+
- [Zod to X](#zod-to-x)
59+
- [X to Zod](#x-to-zod)
60+
- [Mocking](#mocking)
61+
- [Powered by Zod](#powered-by-zod)
62+
- [Utilities for Zod](#utilities-for-zod)
5163
- [Installation](#installation)
5264
- [Requirements](#requirements)
53-
- [Node/npm](#from-npm-nodebun)
54-
- [Deno](#from-denolandx-deno)
65+
- [From `npm` (Node/Bun)](#from-npm-nodebun)
66+
- [From `deno.land/x` (Deno)](#from-denolandx-deno)
5567
- [Basic usage](#basic-usage)
5668
- [Primitives](#primitives)
5769
- [Coercion for primitives](#coercion-for-primitives)
5870
- [Literals](#literals)
5971
- [Strings](#strings)
60-
- [Datetime](#iso-datetimes)
61-
- [IP](#ip-addresses)
72+
- [ISO datetimes](#iso-datetimes)
73+
- [IP addresses](#ip-addresses)
6274
- [Numbers](#numbers)
6375
- [BigInts](#bigints)
6476
- [NaNs](#nans)
@@ -69,66 +81,82 @@
6981
- [Optionals](#optionals)
7082
- [Nullables](#nullables)
7183
- [Objects](#objects)
72-
- [.shape](#shape)
73-
- [.keyof](#keyof)
74-
- [.extend](#extend)
75-
- [.merge](#merge)
76-
- [.pick/.omit](#pickomit)
77-
- [.partial](#partial)
78-
- [.deepPartial](#deepPartial)
79-
- [.passthrough](#passthrough)
80-
- [.strict](#strict)
81-
- [.strip](#strip)
82-
- [.catchall](#catchall)
84+
- [`.shape`](#shape)
85+
- [`.keyof`](#keyof)
86+
- [`.extend`](#extend)
87+
- [`.merge`](#merge)
88+
- [`.pick/.omit`](#pickomit)
89+
- [`.partial`](#partial)
90+
- [`.deepPartial`](#deeppartial)
91+
- [`.required`](#required)
92+
- [`.passthrough`](#passthrough)
93+
- [`.strict`](#strict)
94+
- [`.strip`](#strip)
95+
- [`.catchall`](#catchall)
8396
- [Arrays](#arrays)
84-
- [.element](#element)
85-
- [.nonempty](#nonempty)
86-
- [.min/.max/.length](#minmaxlength)
97+
- [`.element`](#element)
98+
- [`.nonempty`](#nonempty)
99+
- [`.min/.max/.length`](#minmaxlength)
87100
- [Tuples](#tuples)
88101
- [Unions](#unions)
89-
- [Discriminated Unions](#discriminated-unions)
102+
- [Discriminated unions](#discriminated-unions)
90103
- [Records](#records)
104+
- [Record key type](#record-key-type)
91105
- [Maps](#maps)
92106
- [Sets](#sets)
93107
- [Intersections](#intersections)
94108
- [Recursive types](#recursive-types)
109+
- [ZodType with ZodEffects](#zodtype-with-zodeffects)
95110
- [JSON type](#json-type)
96-
- [Cyclical data](#cyclical-objects)
111+
- [Cyclical objects](#cyclical-objects)
97112
- [Promises](#promises)
98113
- [Instanceof](#instanceof)
99114
- [Functions](#functions)
100115
- [Preprocess](#preprocess)
101-
- [Custom](#custom-schemas)
116+
- [Custom schemas](#custom-schemas)
102117
- [Schema methods](#schema-methods)
103-
- [.parse](#parse)
104-
- [.parseAsync](#parseasync)
105-
- [.safeParse](#safeparse)
106-
- [.safeParseAsync](#safeparseasync)
107-
- [.refine](#refine)
108-
- [.superRefine](#superRefine)
109-
- [.transform](#transform)
110-
- [.default](#default)
111-
- [.describe](#describe)
112-
- [.catch](#catch)
113-
- [.optional](#optional)
114-
- [.nullable](#nullable)
115-
- [.nullish](#nullish)
116-
- [.array](#array)
117-
- [.promise](#promise)
118-
- [.or](#or)
119-
- [.and](#and)
120-
- [.brand](#brand)
121-
- [.pipe](#pipe)
118+
- [`.parse`](#parse)
119+
- [`.parseAsync`](#parseasync)
120+
- [`.safeParse`](#safeparse)
121+
- [`.safeParseAsync`](#safeparseasync)
122+
- [`.refine`](#refine)
123+
- [Arguments](#arguments)
124+
- [Customize error path](#customize-error-path)
125+
- [Asynchronous refinements](#asynchronous-refinements)
126+
- [Relationship to transforms](#relationship-to-transforms)
127+
- [`.superRefine`](#superrefine)
128+
- [Abort early](#abort-early)
129+
- [Type refinements](#type-refinements)
130+
- [`.transform`](#transform)
131+
- [Chaining order](#chaining-order)
132+
- [Validating during transform](#validating-during-transform)
133+
- [Relationship to refinements](#relationship-to-refinements)
134+
- [Async transforms](#async-transforms)
135+
- [`.default`](#default)
136+
- [`.describe`](#describe)
137+
- [`.catch`](#catch)
138+
- [`.optional`](#optional)
139+
- [`.nullable`](#nullable)
140+
- [`.nullish`](#nullish)
141+
- [`.array`](#array)
142+
- [`.promise`](#promise)
143+
- [`.or`](#or)
144+
- [`.and`](#and)
145+
- [`.brand`](#brand)
146+
- [`.pipe()`](#pipe)
147+
- [You can use `.pipe()` to fix common issues with `z.coerce`.](#you-can-use-pipe-to-fix-common-issues-with-zcoerce)
122148
- [Guides and concepts](#guides-and-concepts)
123149
- [Type inference](#type-inference)
124150
- [Writing generic functions](#writing-generic-functions)
151+
- [Constraining allowable inputs](#constraining-allowable-inputs)
125152
- [Error handling](#error-handling)
126153
- [Error formatting](#error-formatting)
127154
- [Comparison](#comparison)
128155
- [Joi](#joi)
129156
- [Yup](#yup)
130157
- [io-ts](#io-ts)
131158
- [Runtypes](#runtypes)
159+
- [Ow](#ow)
132160
- [Changelog](#changelog)
133161

134162
<!-- **Zod 2 is coming! Follow [@colinhacks](https://twitter.com/colinhacks) to stay updated and discuss the future of Zod.** -->
@@ -386,17 +414,16 @@ Sponsorship at any level is appreciated and encouraged. For individual developer
386414
<a href="https://ill.inc/">ill.inc</a>
387415
<br />
388416
</td>
389-
<!-- <td align="center">
390-
<a href="https://www.avanawallet.com/">
391-
<img src="https://avatars.githubusercontent.com/u/105452197?s=200&v=4" width="100px;" alt="Avana Wallet logo"/>
417+
<td align="center">
418+
<a href="https://www.masterborn.com/career?utm_source=github&utm_medium=referral&utm_campaign=zodsponsoring">
419+
<img src="https://avatars.githubusercontent.com/u/48984031?s=200&v=4" width="100px;" alt="MasterBorn logo"/>
392420
</a>
393421
<br />
394-
<b>Avana Wallet</b>
422+
<b>MasterBorn</b>
395423
<br/>
396-
<a href="https://www.avanawallet.com/">avanawallet.com</a><br/>
397-
<span>Solana non-custodial wallet</span>
424+
<a href="https://www.masterborn.com/career?utm_source=github&utm_medium=referral&utm_campaign=zodsponsoring">masterborn.com</a>
398425
<br />
399-
</td> -->
426+
</td>
400427
</tr>
401428
</table>
402429

@@ -443,6 +470,7 @@ There are a growing number of tools that are built atop or support Zod natively!
443470
- [`fastify-type-provider-zod`](https://github.com/turkerdev/fastify-type-provider-zod): Create Fastify type providers from Zod schemas.
444471
- [`zod-to-openapi`](https://github.com/asteasolutions/zod-to-openapi): Generate full OpenAPI (Swagger) docs from Zod, including schemas, endpoints & parameters.
445472
- [`nestjs-graphql-zod`](https://github.com/incetarik/nestjs-graphql-zod): Generates NestJS GraphQL model classes from Zod schemas. Provides GraphQL method decorators working with Zod schemas.
473+
- [`zod-openapi`](https://github.com/samchungy/zod-openapi): Create full OpenAPI v3.x documentation from Zod Schemas.
446474

447475
#### X to Zod
448476

@@ -974,7 +1002,7 @@ FruitEnum.parse("Cantaloupe"); // fails
9741002

9751003
**Const enums**
9761004

977-
The `.nativeEnum()` function works for `as const` objects as well. ⚠️ `as const` required TypeScript 3.4+!
1005+
The `.nativeEnum()` function works for `as const` objects as well. ⚠️ `as const` requires TypeScript 3.4+!
9781006

9791007
```ts
9801008
const Fruits = {

0 commit comments

Comments
 (0)