Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions packages/docs/content/api.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -1157,6 +1157,18 @@ Dog.def.shape.age; // => number schema
</Tab>
</Tabs>

<Callout>
When a schema is transformed, the `shape` is accessed from the `in` or `out` key:

```ts
const Puppy = Dog.transform(({ age }) => age < 1);
Puppy.in.shape.name; // => string schema
Puppy.in.shape.age; // => number schema
Puppy.out; // => boolean schema
```

</Callout>

### `.keyof()`

To create a `ZodEnum` schema from the keys of an object schema:
Expand Down