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 type-safe data transformation pipeline that validates and processes user registration data through multiple sequential validation and transformation steps.
Implement a user registration data processor that:
The pipeline should handle validation errors at each step and propagate them appropriately. All transformations should be type-safe and composable.
The input will be an unknown object that should be validated against this structure:
username: string (non-empty)email: string (valid email format)age: number (integer)The successful output should have:
username: string (unchanged)email: string (normalized to lowercase)age: number (unchanged)registeredAt: Date object (timestamp when processed){ username: "JohnDoe", email: "JOHN@EXAMPLE.COM", age: 25 } returns a successful result with email normalized to lowercase and registeredAt field added @test{ username: "", email: "invalid", age: 15 } returns validation errors indicating empty username, invalid email format, and age requirement violation @test{ username: "Jane" } returns validation errors for missing email and age fields @test@generates
import { Either } from 'fp-ts/Either';
export interface RegistrationInput {
username: string;
email: string;
age: number;
}
export interface ProcessedRegistration {
username: string;
email: string;
age: number;
registeredAt: Date;
}
export type ValidationError = string[];
export function processRegistration(
input: unknown
): Either<ValidationError, ProcessedRegistration>;Provides runtime type validation and monadic composition capabilities for building the validation pipeline.
Provides the Either monad and functional composition utilities.