Treat null/undefined and “absence vs presence” as first-class concerns.

Example:

import { z } from "zod";

const boolSchema = z.string().boolean();

// absent (undefined) -> fallback
const withDefault = boolSchema.default(false);

// wrong value (including "other" / null if you pass it in) -> fallback
const withCatch = boolSchema.catch(false);

// non-empty string required by UI
const requiredText = z.string().min(1, "Required");

Apply these consistently so validation behavior matches what your types and UI expectations actually mean.