Skip to content

Commit

Permalink
Merge branch 'master' into ItMaga-patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
ItMaga authored May 21, 2023
2 parents e8fe530 + af08390 commit 1c9acbb
Show file tree
Hide file tree
Showing 13 changed files with 431 additions and 186 deletions.
124 changes: 76 additions & 48 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,20 +45,32 @@
#### Go to [zod.js.org](https://zod.js.org) >> -->

- [Table of contents](#table-of-contents)
- [Introduction](#introduction)
- [Sponsors](#sponsors)
- [Gold](#gold)
- [Silver](#silver)
- [Bronze](#bronze)
- [Ecosystem](#ecosystem)
- [Resources](#resources)
- [API libraries](#api-libraries)
- [Form integrations](#form-integrations)
- [Zod to X](#zod-to-x)
- [X to Zod](#x-to-zod)
- [Mocking](#mocking)
- [Powered by Zod](#powered-by-zod)
- [Utilities for Zod](#utilities-for-zod)
- [Installation](#installation)
- [Requirements](#requirements)
- [Node/npm](#from-npm-nodebun)
- [Deno](#from-denolandx-deno)
- [From `npm` (Node/Bun)](#from-npm-nodebun)
- [From `deno.land/x` (Deno)](#from-denolandx-deno)
- [Basic usage](#basic-usage)
- [Primitives](#primitives)
- [Coercion for primitives](#coercion-for-primitives)
- [Literals](#literals)
- [Strings](#strings)
- [Datetime](#iso-datetimes)
- [IP](#ip-addresses)
- [ISO datetimes](#iso-datetimes)
- [IP addresses](#ip-addresses)
- [Numbers](#numbers)
- [BigInts](#bigints)
- [NaNs](#nans)
Expand All @@ -69,66 +81,82 @@
- [Optionals](#optionals)
- [Nullables](#nullables)
- [Objects](#objects)
- [.shape](#shape)
- [.keyof](#keyof)
- [.extend](#extend)
- [.merge](#merge)
- [.pick/.omit](#pickomit)
- [.partial](#partial)
- [.deepPartial](#deepPartial)
- [.passthrough](#passthrough)
- [.strict](#strict)
- [.strip](#strip)
- [.catchall](#catchall)
- [`.shape`](#shape)
- [`.keyof`](#keyof)
- [`.extend`](#extend)
- [`.merge`](#merge)
- [`.pick/.omit`](#pickomit)
- [`.partial`](#partial)
- [`.deepPartial`](#deeppartial)
- [`.required`](#required)
- [`.passthrough`](#passthrough)
- [`.strict`](#strict)
- [`.strip`](#strip)
- [`.catchall`](#catchall)
- [Arrays](#arrays)
- [.element](#element)
- [.nonempty](#nonempty)
- [.min/.max/.length](#minmaxlength)
- [`.element`](#element)
- [`.nonempty`](#nonempty)
- [`.min/.max/.length`](#minmaxlength)
- [Tuples](#tuples)
- [Unions](#unions)
- [Discriminated Unions](#discriminated-unions)
- [Discriminated unions](#discriminated-unions)
- [Records](#records)
- [Record key type](#record-key-type)
- [Maps](#maps)
- [Sets](#sets)
- [Intersections](#intersections)
- [Recursive types](#recursive-types)
- [ZodType with ZodEffects](#zodtype-with-zodeffects)
- [JSON type](#json-type)
- [Cyclical data](#cyclical-objects)
- [Cyclical objects](#cyclical-objects)
- [Promises](#promises)
- [Instanceof](#instanceof)
- [Functions](#functions)
- [Preprocess](#preprocess)
- [Custom](#custom-schemas)
- [Custom schemas](#custom-schemas)
- [Schema methods](#schema-methods)
- [.parse](#parse)
- [.parseAsync](#parseasync)
- [.safeParse](#safeparse)
- [.safeParseAsync](#safeparseasync)
- [.refine](#refine)
- [.superRefine](#superRefine)
- [.transform](#transform)
- [.default](#default)
- [.describe](#describe)
- [.catch](#catch)
- [.optional](#optional)
- [.nullable](#nullable)
- [.nullish](#nullish)
- [.array](#array)
- [.promise](#promise)
- [.or](#or)
- [.and](#and)
- [.brand](#brand)
- [.pipe](#pipe)
- [`.parse`](#parse)
- [`.parseAsync`](#parseasync)
- [`.safeParse`](#safeparse)
- [`.safeParseAsync`](#safeparseasync)
- [`.refine`](#refine)
- [Arguments](#arguments)
- [Customize error path](#customize-error-path)
- [Asynchronous refinements](#asynchronous-refinements)
- [Relationship to transforms](#relationship-to-transforms)
- [`.superRefine`](#superrefine)
- [Abort early](#abort-early)
- [Type refinements](#type-refinements)
- [`.transform`](#transform)
- [Chaining order](#chaining-order)
- [Validating during transform](#validating-during-transform)
- [Relationship to refinements](#relationship-to-refinements)
- [Async transforms](#async-transforms)
- [`.default`](#default)
- [`.describe`](#describe)
- [`.catch`](#catch)
- [`.optional`](#optional)
- [`.nullable`](#nullable)
- [`.nullish`](#nullish)
- [`.array`](#array)
- [`.promise`](#promise)
- [`.or`](#or)
- [`.and`](#and)
- [`.brand`](#brand)
- [`.pipe()`](#pipe)
- [You can use `.pipe()` to fix common issues with `z.coerce`.](#you-can-use-pipe-to-fix-common-issues-with-zcoerce)
- [Guides and concepts](#guides-and-concepts)
- [Type inference](#type-inference)
- [Writing generic functions](#writing-generic-functions)
- [Constraining allowable inputs](#constraining-allowable-inputs)
- [Error handling](#error-handling)
- [Error formatting](#error-formatting)
- [Comparison](#comparison)
- [Joi](#joi)
- [Yup](#yup)
- [io-ts](#io-ts)
- [Runtypes](#runtypes)
- [Ow](#ow)
- [Changelog](#changelog)

<!-- **Zod 2 is coming! Follow [@colinhacks](https://twitter.com/colinhacks) to stay updated and discuss the future of Zod.** -->
Expand Down Expand Up @@ -386,17 +414,16 @@ Sponsorship at any level is appreciated and encouraged. For individual developer
<a href="https://ill.inc/">ill.inc</a>
<br />
</td>
<!-- <td align="center">
<a href="https://www.avanawallet.com/">
<img src="https://avatars.githubusercontent.com/u/105452197?s=200&v=4" width="100px;" alt="Avana Wallet logo"/>
<td align="center">
<a href="https://www.masterborn.com/career?utm_source=github&utm_medium=referral&utm_campaign=zodsponsoring">
<img src="https://avatars.githubusercontent.com/u/48984031?s=200&v=4" width="100px;" alt="MasterBorn logo"/>
</a>
<br />
<b>Avana Wallet</b>
<b>MasterBorn</b>
<br/>
<a href="https://www.avanawallet.com/">avanawallet.com</a><br/>
<span>Solana non-custodial wallet</span>
<a href="https://www.masterborn.com/career?utm_source=github&utm_medium=referral&utm_campaign=zodsponsoring">masterborn.com</a>
<br />
</td> -->
</td>
</tr>
</table>

Expand Down Expand Up @@ -443,6 +470,7 @@ There are a growing number of tools that are built atop or support Zod natively!
- [`fastify-type-provider-zod`](https://github.com/turkerdev/fastify-type-provider-zod): Create Fastify type providers from Zod schemas.
- [`zod-to-openapi`](https://github.com/asteasolutions/zod-to-openapi): Generate full OpenAPI (Swagger) docs from Zod, including schemas, endpoints & parameters.
- [`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.
- [`zod-openapi`](https://github.com/samchungy/zod-openapi): Create full OpenAPI v3.x documentation from Zod Schemas.

#### X to Zod

Expand Down Expand Up @@ -974,7 +1002,7 @@ FruitEnum.parse("Cantaloupe"); // fails
**Const enums**
The `.nativeEnum()` function works for `as const` objects as well. ⚠️ `as const` required TypeScript 3.4+!
The `.nativeEnum()` function works for `as const` objects as well. ⚠️ `as const` requires TypeScript 3.4+!
```ts
const Fruits = {
Expand Down
Loading

0 comments on commit 1c9acbb

Please sign in to comment.