You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/zod/README.md
+15Lines changed: 15 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -438,6 +438,9 @@ Convert a zod schema into a codec that applies a bi-directional **key transforma
438
438
439
439
#### Example
440
440
441
+
> [!NOTE]
442
+
> You can play with this example on [StackBlitz](https://stackblitz.com/edit/traversable-zod-snakecase-camelcase?file=test%2Fdemo.test.ts&initialPath=__vitest__/)
443
+
441
444
```typescript
442
445
import*aszfrom'zod'
443
446
import { zx } from'@traversable/zod'
@@ -510,13 +513,19 @@ console.log(
510
513
511
514
### `zx.deepCamelCaseCodec` (🔬)
512
515
516
+
> [!WARN]
517
+
> Support for this feature is **experimental**.
518
+
513
519
Convert a zod schema into a codec that **decodes any objects's keys to camel case** and **encode any object's keys to snake case**, recursively.
514
520
515
521
> [!NOTE]
516
522
> This feature was implemented in terms of [`zx.convertCaseCodec`](https://github.com/traversable/schema/tree/main/packages/zod#zxconvertcasecodec).
517
523
518
524
#### Example
519
525
526
+
> [!NOTE]
527
+
> You can play with this example on [StackBlitz](https://stackblitz.com/edit/traversable-zod-snakecase-camelcase?file=test%2Fdemo.test.ts&initialPath=__vitest__/)
528
+
520
529
```typescript
521
530
import*aszfrom'zod'
522
531
import { zx } from'@traversable/zod'
@@ -605,13 +614,19 @@ console.log(
605
614
606
615
### `zx.deepSnakeCaseCodec` (🔬)
607
616
617
+
> [!WARN]
618
+
> Support for this feature is **experimental**.
619
+
608
620
Convert a zod schema into a codec that **decodes any objects's keys to snake case** and **encode any object's keys to camel case**, recursively.
609
621
610
622
> [!NOTE]
611
623
> This feature was implemented in terms of [`zx.convertCaseCodec`](https://github.com/traversable/schema/tree/main/packages/zod#zxconvertcasecodec).
612
624
613
625
#### Example
614
626
627
+
> [!NOTE]
628
+
> You can play with this example on [StackBlitz](https://stackblitz.com/edit/traversable-zod-snakecase-camelcase?file=test%2Fdemo.test.ts&initialPath=__vitest__/)
0 commit comments