Hey, I found a documentation typo/error in the z.flattenError() section at https://zod.dev/error-formatting.
This is the current example :
flattened.fieldErrors.string; // => [ 'Invalid input: expected string, received number' ]
flattened.fieldErrors.numbers; // => [ 'Invalid input: expected number, received string' ]
But it should be :
flattened.fieldErrors.username; // => [ 'Invalid input: expected string, received number' ]
flattened.fieldErrors.favoriteNumbers; // => [ 'Invalid input: expected number, received string' ]
Hey, I found a documentation typo/error in the
z.flattenError()section at https://zod.dev/error-formatting.This is the current example :
But it should be :