Sikari
ZZod
•Created by Maxiviper117 on 4/2/2025 in #questions
Maxiviper117 - I'm working on validating an obj...
Anyways, I hope that helps!
7 replies
ZZod
•Created by Maxiviper117 on 4/2/2025 in #questions
Maxiviper117 - I'm working on validating an obj...
You might be able to swap the order of the schemas in the intersection, not sure if that would work.
Alternatively, you could extract the known schema to a variable and exclude that way:
7 replies
ZZod
•Created by Maxiviper117 on 4/2/2025 in #questions
Maxiviper117 - I'm working on validating an obj...
If you wish to get more type safety, here is something: https://tsplay.dev/N5oVdW
7 replies
ZZod
•Created by Maxiviper117 on 4/2/2025 in #questions
Maxiviper117 - I'm working on validating an obj...
You would intersect your known object with the "unknown" record just like in pure types.
Here's a playground for one of the implementations: https://tsplay.dev/ND9Ajm
7 replies
ZZod
•Created by Gludek on 5/11/2024 in #questions
Gludek - Just to confirm z.string().email() can...
Perhaps you're looking for:
8 replies
ZZod
•Created by Gludek on 5/11/2024 in #questions
Gludek - Just to confirm z.string().email() can...
Your form most likely is not passing
null
or undefined
, most likely you have ""
8 replies