tessl install tessl/npm-io-ts@2.2.0TypeScript runtime type system for IO decoding/encoding
Agent Success
Agent success rate when using this tile
72%
Improvement
Agent success rate improvement when using this tile compared to baseline
1.14x
Baseline
Agent success rate without this tile
63%
Build a TypeScript module that validates email addresses with detailed, user-friendly error messages. The validator should check multiple constraints and provide specific feedback about what's wrong with invalid emails.
Implement a function that validates email addresses according to these rules:
@ symbol@): Must be at least 1 character and no more than 64 characters@): Must be at least 3 characters and contain at least one ..), hyphens (-), and underscores (_) in the local part. must be at least 2 charactersWhen validation fails, provide clear, specific error messages that explain exactly what rule was violated:
Implement a validation function that:
@generates
/**
* Validates an email address string.
*
* @param input - The email string to validate
* @returns A result containing either the valid email or a list of error messages
*/
export function validateEmail(input: string): ValidationResult;
/**
* Result type for email validation
*/
export type ValidationResult =
| { success: true; value: string }
| { success: false; errors: string[] };Provides runtime type validation with custom error messages.
Provides functional data types like Either for handling validation results.