Skip to content

Commit

Permalink
Improve code example of Input and Output API reference
Browse files Browse the repository at this point in the history
  • Loading branch information
fabian-hiller committed Dec 9, 2023
1 parent 2cb2757 commit b58a974
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions website/src/routes/api/(types)/Input/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ contributors:
Input inference type.

```ts
// Create schema
const Schema = object({
// Create object schema
const ObjectSchema = object({
key: transform(string(), (input) => input.length),
});

// Infer input type
type SchemaInput = Input<typeof Schema>; // { key: string }
// Infer object input type
type ObjectInput = Input<typeof ObjectSchema>; // { key: string }
```
8 changes: 4 additions & 4 deletions website/src/routes/api/(types)/Output/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ contributors:
Output inference type.

```ts
// Create schema
const Schema = object({
// Create object schema
const ObjectSchema = object({
key: transform(string(), (input) => input.length),
});

// Infer output type
type SchemaOutput = Output<typeof Schema>; // { key: number }
// Infer object output type
type ObjectOutput = Output<typeof ObjectSchema>; // { key: number }
```

0 comments on commit b58a974

Please sign in to comment.