Closed TheCrowdsecMatt closed 1 month ago
Hello @TheCrowdsecMatt and thanks for reporting.
I see in Zod document about tuples that the rest operator is supported so I think the expected output should be
export const residentSchema = z.object({
id: z.string(),
name: z.string(),
addresses: z.tuple(addressSchema).rest(addressSchema);
})
Hello @tvillaren I agree your suggestion makes sense also 👍 Thanks for the PR creation.
Thanks, I released it in 3.10.0 https://github.com/fabien0102/ts-to-zod/pull/258
Bug description
Incorrect conversion of an array type with a rest element into a Zod schema that includes z.any(), which is not the intended behavior.
Input
Expected output
Actual output
Versions
v5.4.5
v3.22.4