Zod Sandbox
Data To Validate:
›
⌄
{
shape
:
'square'
,
side
:
12
,
colors
: [
'black'
,
'blue'
,
'white'
]
,
}
Schema:
›
⌄
z
.
object
({
shape
:
z
.
string
()
,
side
:
z
.
number
()
,
colors
:
z
.
array
(
z
.
enum
([
'black'
,
'blue'
,
'white'
]))
})
.
strict
()
Validate
Result:
›