TypeScript runtime type system for IO decoding/encoding
72
Build a data transformation system that converts between internal and external representations while ensuring data integrity through round-trip validation. The system should handle configuration data that needs to be transformed for storage or transmission, then reliably reconstructed.
You need to implement a bidirectional transformation system with the following capabilities:
Create transformations for a user configuration object with these properties:
Implement the following test cases:
@generates
/**
* Internal representation of configuration
*/
export interface InternalConfig {
timestamp: Date;
isActive: boolean;
maxRetries: number;
timeout: number;
}
/**
* External representation of configuration
*/
export interface ExternalConfig {
timestamp: string;
status: "active" | "inactive";
maxRetries: number;
timeout: number;
}
/**
* Codec for bidirectional transformation between internal and external config
*/
export const ConfigCodec: any; // Type should support both encode and decode operationsProvides runtime type validation and bidirectional transformation capabilities.
Provides functional programming utilities including Either for error handling.
Install with Tessl CLI
npx tessl i tessl/npm-io-tsdocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10