Skip to content

Commit 1e71ca9

Browse files
docs: fix refine fn to encode works properly (#5148)
1 parent 309f358 commit 1e71ca9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/docs/content/codecs.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ During regular decoding, a `ZodPipe<A, B>` schema will first parse the data with
191191
All checks (`.refine()`, `.min()`, `.max()`, etc.) are still executed in both directions.
192192

193193
```ts
194-
const schema = stringToDate.refine((date) => date.getFullYear() > 2000, "Must be this millenium");
194+
const schema = stringToDate.refine((date) => date.getFullYear() >= 2000, "Must be this millenium");
195195

196196
schema.encode(new Date("2000-01-01"));
197197
// => Date

0 commit comments

Comments
 (0)