Skip to content

Commit

Permalink
fix typos
Browse files Browse the repository at this point in the history
  • Loading branch information
frankie303 committed Sep 10, 2021
1 parent 7fdfae1 commit 9edca8b
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .dependency-cruiser.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ module.exports = {
{
name: 'no-duplicate-dep-types',
comment:
"Likeley this module depends on an external ('npm') package that occurs more than once " +
"Likely this module depends on an external ('npm') package that occurs more than once " +
"in your package.json i.e. bot as a devDependencies and in dependencies. This will cause " +
"maintenance problems later on.",
severity: 'warn',
Expand Down Expand Up @@ -140,7 +140,7 @@ module.exports = {
"This module depends on an npm package that is declared as an optional dependency " +
"in your package.json. As this makes sense in limited situations only, it's flagged here. " +
"If you're using an optional dependency here by design - add an exception to your" +
"depdency-cruiser configuration.",
"dependency-cruiser configuration.",
from: {},
to: {
dependencyTypes: [
Expand Down
4 changes: 2 additions & 2 deletions ERROR_HANDLING.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ try {
names: ["Dave", 12], // 12 is not a string
address: {
line1: "123 Maple Ave",
zipCode: 123, // zip code isnt 5 digits
zipCode: 123, // zip code isn't 5 digits
extra: "other stuff", // unrecognized key
},
});
Expand Down Expand Up @@ -327,7 +327,7 @@ err.flatten( (i: ZodIssue) => {
```

- `fieldErrors` is an object. The keys are the field(s) that threw the error. The values are an array of error strings that can be easily presented in the interface.
- `formErrors: string[]` is an array of errors that occured on the "root" of the object schema. For instance if you called `FormData.parse(null)`, `formErrors` would be:
- `formErrors: string[]` is an array of errors that occurred on the "root" of the object schema. For instance if you called `FormData.parse(null)`, `formErrors` would be:
```ts
["Invalid input: expected object, received null"];
```
2 changes: 1 addition & 1 deletion MIGRATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Zod 2 is being retired and will not leave beta. This is due to some unintuitive

- The **minimum TypeScript version** is now _4.1_ (up from 3.7 for Zod 2). Several features have been rewritten to use [recursive conditional types](https://devblogs.microsoft.com/typescript/announcing-typescript-4-1/#recursive-conditional-types), an incredibly powerful new feature introduced in TS4.1.

- **Transformers syntax**. Previously, creating a transformer required an input schema, an output schema, and a function to tranform between them. You created transformers like `z.transform(A, B, func)`, where `A` and `B` are Zod schemas. This is no longer the case. Accordingly:
- **Transformers syntax**. Previously, creating a transformer required an input schema, an output schema, and a function to transform between them. You created transformers like `z.transform(A, B, func)`, where `A` and `B` are Zod schemas. This is no longer the case. Accordingly:

The old syntax is no longer available:

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1198,7 +1198,7 @@ myFunction; // (arg: string)=>number[]

## Preprocess

Typically Zod operates under a "parse, then tranform" paradigm. Zod validates the input first, then passes it through a chain of transformation functions. (For more information about transforms, read the [.transform docs](#transform).)
Typically Zod operates under a "parse, then transform" paradigm. Zod validates the input first, then passes it through a chain of transformation functions. (For more information about transforms, read the [.transform docs](#transform).)

But sometimes you want to apply some transformation to the input _before_ parsing happens. A common use case: type coercion. Zod enables this with the `z.preprocess()`.

Expand Down Expand Up @@ -1570,7 +1570,7 @@ z.union([z.string(), z.number()]);

### `.and`

A convenience method for creating interesection types.
A convenience method for creating intersection types.

```ts
z.object({ name: z.string() }).and(z.object({ age: z.number() })); // { name: string } & { age: number }
Expand Down Expand Up @@ -1679,7 +1679,7 @@ Tuples
Recursive Types
Function Schemas
<abbr title="For instance, Yup allows custmo error messages with the syntax yup.number().min(5, 'Number must be more than 5!')">Validation Messages</abbr>
<abbr title="For instance, Yup allows custom error messages with the syntax yup.number().min(5, 'Number must be more than 5!')">Validation Messages</abbr>
Immutable instances
Type Guards
Validity Checking
Expand Down
2 changes: 1 addition & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2902,7 +2902,7 @@ export class ZodEffects<
constructor(def: ZodEffectsDef<T>) {
super(def);
// if (def.schema instanceof ZodEffects) {
// throw new Error(ZodFirstPartyTypeKind.ZodEffectscannot be nested.");
// throw new Error(ZodFirstPartyTypeKind.ZodEffects cannot be nested.");
// }
}

Expand Down

0 comments on commit 9edca8b

Please sign in to comment.