typescript simplify a type guard
I have this code. I want the if statement to be able to verify that
validationResullt.error is a ZodError and validation.data is not undefined but there doesn't seem a way to do them in one statement.should I use
as to explicitly assert the type of validation.data? I don't want another if statement because it would just duplicate the logic inside first if