CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-io-ts

TypeScript runtime type system for IO decoding/encoding

72

1.14x
Overview
Eval results
Files

rubric.jsonevals/scenario-2/

{
  "context": "This criteria evaluates the engineer's ability to use io-ts for runtime decoding and validation, specifically focusing on the decode() method, codec definition, and error handling with PathReporter.",
  "type": "weighted_checklist",
  "checklist": [
    {
      "name": "Codec definition",
      "description": "Uses t.type() to define a codec for the user configuration object with all required fields (username, age, email, isActive) using appropriate primitive codecs (t.string, t.number, t.boolean)",
      "max_score": 25
    },
    {
      "name": "decode() usage",
      "description": "Calls the decode() method on the codec to validate the input, correctly passing the unknown input value to the codec's decode method",
      "max_score": 25
    },
    {
      "name": "Either handling",
      "description": "Properly handles the Either<Errors, A> result from decode() by checking success/failure state using methods like isLeft(), isRight(), fold(), or pattern matching to distinguish between validation success and failure",
      "max_score": 25
    },
    {
      "name": "Error formatting",
      "description": "Uses PathReporter.report() from io-ts/PathReporter to convert validation errors into human-readable error messages for the errors array in the failure case",
      "max_score": 25
    }
  ]
}

Install with Tessl CLI

npx tessl i tessl/npm-io-ts

tile.json