Skip to content

Commit

Permalink
Fix prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
colinhacks committed Aug 6, 2023
1 parent 78a4090 commit 1ecd624
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 13 deletions.
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1270,10 +1270,12 @@ Contrary to the `.partial` method, the `.required` method makes all properties r
Starting from this object:
```ts
const user = z.object({
email: z.string(),
username: z.string(),
}).partial();
const user = z
.object({
email: z.string(),
username: z.string(),
})
.partial();
// { email?: string | undefined; username?: string | undefined }
```
Expand Down
22 changes: 13 additions & 9 deletions deno/lib/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,7 @@ There are a growing number of tools that are built atop or support Zod natively!

#### Form integrations

- [`conform`](https://conform.guide/api/zod): A progressive enhancement first form validation library for Remix and React Router
- [`react-hook-form`](https://github.com/react-hook-form/resolvers#zod): A first-party Zod resolver for React Hook Form.
- [`zod-validation-error`](https://github.com/causaly/zod-validation-error): Generate user-friendly error messages from `ZodError`s.
- [`zod-formik-adapter`](https://github.com/robertLichtnow/zod-formik-adapter): A community-maintained Formik adapter for Zod.
Expand All @@ -471,7 +472,8 @@ There are a growing number of tools that are built atop or support Zod natively!
- [`@modular-forms/solid`](https://github.com/fabian-hiller/modular-forms): Modular form library for SolidJS that supports Zod for validation.
- [`houseform`](https://github.com/crutchcorn/houseform/): A React form library that uses Zod for validation.
- [`sveltekit-superforms`](https://github.com/ciscoheat/sveltekit-superforms): Supercharged form library for SvelteKit with Zod validation.
- [`mobx-zod-form`](https://github.com/MonoidDev/mobx-zod-form): Data-first form builder based on MobX & Zod
- [`mobx-zod-form`](https://github.com/MonoidDev/mobx-zod-form): Data-first form builder based on MobX & Zod.
- [`@vee-validate/zod`](https://github.com/logaretm/vee-validate/tree/main/packages/zod): Form library for Vue.js with Zod schema validation.

#### Zod to X

Expand All @@ -483,7 +485,8 @@ 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.
- [`zod-openapi`](https://github.com/samchungy/zod-openapi): Create full OpenAPI v3.x documentation from Zod schemas.
- [`fastify-zod-openapi`](https://github.com/samchungy/fastify-zod-openapi): Fastify type provider, validation, serialization and @fastify/swagger support for Zod schemas.

#### X to Zod

Expand Down Expand Up @@ -1203,7 +1206,7 @@ Starting from this object:
```ts
const user = z.object({
email: z.string()
email: z.string(),
username: z.string(),
});
// { email: string; username: string }
Expand Down Expand Up @@ -1267,10 +1270,12 @@ Contrary to the `.partial` method, the `.required` method makes all properties r
Starting from this object:
```ts
const user = z.object({
email: z.string()
username: z.string(),
}).partial();
const user = z
.object({
email: z.string(),
username: z.string(),
})
.partial();
// { email?: string | undefined; username?: string | undefined }
```
Expand Down Expand Up @@ -2724,7 +2729,6 @@ Yup is a full-featured library that was implemented first in vanilla JS, and lat

- Supports casting and transforms
- All object fields are optional by default
- Missing object methods: (partial, deepPartial)
<!-- - Missing nonempty arrays with proper typing (`[T, ...T[]]`) -->
- Missing promise schemas
- Missing function schemas
Expand Down Expand Up @@ -2787,7 +2791,7 @@ This more declarative API makes schema definitions vastly more concise.

[https://github.com/pelotom/runtypes](https://github.com/pelotom/runtypes)

Good type inference support, but limited options for object type masking (no `.pick` , `.omit` , `.extend` , etc.). No support for `Record` s (their `Record` is equivalent to Zod's `object` ). They DO support readonly types, which Zod does not.
Good type inference support. They DO support readonly types, which Zod does not.

- Supports "pattern matching": computed properties that distribute over unions
- Supports readonly types
Expand Down

0 comments on commit 1ecd624

Please sign in to comment.