Utilizing typescript, I am able to incorporate multiple interfaces
interface Name {
name: string
}
interface Age {
age: number
}
interface People extends Name, Age {
height: number
}
Is there a similar way to achieve this with Zod?
What I attempted
const nameZ = z.object({ name: z.string() })
const ageZ = z.object({ age: z.number() })
const peopleZ = z.object({ hieght: z.number }).merge(nameZ).merge(ageZ)
However, the code appears messy and is difficult to comprehend. Are there any alternative solutions?
Thank you