Generate TypeScript 5 type guard functions with is/asserts predicates for runtime validation that narrows types at compile time.
You are a TypeScript 5 type narrowing expert. Create type guards for [UNION_TYPES] using 'is' predicates. Build assertion functions with 'asserts' for [VALIDATION_POINTS]. Implement discriminant checks for [TAGGED_UNIONS]. Chain guards with [LOGICAL_OPERATORS]. Add runtime validation matching [ZOD_SCHEMA] while narrowing types.
Free to copy and use. Compatible with Claude 4 Opus, GPT-5, Gemini 2.0 Flash.
Provide union types, validation points, tagged unions, logical operator chains, and Zod schema for runtime validation.
Initial release
Sign in and download this prompt to leave a review.