TypeScript runtime type system for IO decoding/encoding
72
{
"context": "This criteria evaluates how well the engineer uses io-ts union types to validate API responses that can be in one of three states (success, error, or loading). The focus is on proper usage of t.union() for discriminated unions and related io-ts APIs.",
"type": "weighted_checklist",
"checklist": [
{
"name": "Union type creation",
"description": "Uses t.union() to create a union type that represents the three possible response states (success, error, loading)",
"max_score": 30
},
{
"name": "Tagged union pattern",
"description": "Uses t.literal() to create literal types for the status discriminator field (e.g., t.literal('success'), t.literal('error'), t.literal('loading'))",
"max_score": 20
},
{
"name": "Object type definitions",
"description": "Uses t.type() to define the structure of each response variant (success with data, error with error info, loading)",
"max_score": 20
},
{
"name": "Validation execution",
"description": "Uses the decode() method to validate the input response and returns the Either result",
"max_score": 15
},
{
"name": "Nested object validation",
"description": "Properly validates nested objects (user data with id and name, error object with code and message) using t.type() or similar combinators",
"max_score": 10
},
{
"name": "Type inference",
"description": "Leverages TypeScript type inference from the codec (e.g., using TypeOf to extract the validated type)",
"max_score": 5
}
]
}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