Update validation.ts (#3324)
Describe what your pull request does. If appropriate, add GIFs or images showing the before and after. ### Change Type <!-- ❗ Please select a 'Scope' label ❗️ --> - [ ] `sdk` — Changes the tldraw SDK - [ ] `dotcom` — Changes the tldraw.com web app - [x] `docs` — Changes to the documentation, examples, or templates. - [ ] `vs code` — Changes to the vscode plugin - [ ] `internal` — Does not affect user-facing stuff <!-- ❗ Please select a 'Type' label ❗️ --> - [ ] `bugfix` — Bug fix - [ ] `feature` — New feature - [ ] `improvement` — Improving existing features - [x] `chore` — Updating dependencies, other boring stuff - [ ] `galaxy brain` — Architectural changes - [ ] `tests` — Changes to any test code - [ ] `tools` — Changes to infrastructure, CI, internal scripts, debugging tools, etc. - [ ] `dunno` — I don't know ### Test Plan N/A - [ ] Unit Tests - [ ] End to end tests ### Release Notes - Update example for Union type --- I believe this type was changed and `literal` is what it should be now.
This commit is contained in:
parent
b7933d7e08
commit
38b1f7d0c9
1 changed files with 2 additions and 2 deletions
|
@ -821,8 +821,8 @@ export function dict<Key extends string, Value>(
|
|||
* @example
|
||||
*
|
||||
* ```ts
|
||||
* const catValidator = T.object({ kind: T.value('cat'), meow: T.boolean })
|
||||
* const dogValidator = T.object({ kind: T.value('dog'), bark: T.boolean })
|
||||
* const catValidator = T.object({ kind: T.literal('cat'), meow: T.boolean })
|
||||
* const dogValidator = T.object({ kind: T.literal('dog'), bark: T.boolean })
|
||||
* const animalValidator = T.union('kind', { cat: catValidator, dog: dogValidator })
|
||||
* ```
|
||||
*
|
||||
|
|
Loading…
Reference in a new issue