Validation libraries solved parsing. They didn't solve the control flow that comes after.

You've got Zod (or Valibot, or ArkType). Your input is parsed and typed. Great. Now what?



async function createAccount(input: unknown) {
try {
const parsed = accountSchema.parse(input);

const existing = await db.findUser(parsed.email);
if...