Handling whether properties are optional or not optional based on generic parameter
I’m trying to infer the right data types from a Zod schema collection from within a function
.
Zod Schema transform an array of objects to one big object
I have a couple schemas, where one uses an array of the other as a value. In example,
Enforce Base Schema Type in Generic Constraint
Is it possible for Zod to enforce that a passed schema’s type is constrained to a base schema? I suspect I might be way off base here, but hopefully it is clear what I’m trying to achieve in the example.
zod refine on z.object
I have a custom object myItem. And I want whenever id is passed in, it will call a function myService.getName(id) to fetch the name, and adding the name to myItem.
How do I type this zod helper correctly that the return type is inferred correctly by TypeScript?
I have two helper functions I use in TypeScript in combination with the zod library. I wrote zfd
first and later had a need to pass not a raw shape object, but a predefined ZodType. I tried writing a single function with variably typed arguments, but I cannot figure out the typing and always loose the specific parsed types when combining functions.
How to narrow return type of generic function?
Given a general RPC 2.0 request schema defined as
Zod on new Typescript project errors with “Private identifiers are only available when targeting ECMAScript 2015 and higher”
I’ve created a new Typescript project using
Zod on new Typescript prodject errors with Private identifiers are only available when targeting ECMAScript 2015 and higher
I’ve created a brand new Typescript project using
TypeScript zod schema issue
how can I fix the issue mentioned in assignment, I am new to typescript and zod? I tried to fix by using generics but failed to do so
How to do Zod Schema conditional validation based on another field
I have a Zod schema defined as follows: