
ALT TypeScript code in an editor. Recursive types reverse a card number's digits, double every second one and add them up, and the number passes if the total ends in 0. A card() function uses the result: three valid card numbers compile, and the same numbers with one digit changed show red squiggles and the error "Argument of type ... is not assignable to parameter of type 'never'".

ALT TypeScript code defining a NonEmptyString type that only accepts strings with at least one character, without using branded types or `any`. The example assigns a normal string successfully, then shows an empty string assignment marked as a type error. Below, a Zod schema builds the same rule at runtime with z.string().refine(...), checking that the string length is greater than zero and returning the message string must contain at least one character.













