Narrow types safely with custom type guard functions
Type-safe runtime validation with Zod for TypeScript