Series

The TypeScript type system

Control flow analysis, narrowing, conditional types, and the places where the checker stops following an argument that a reader would have accepted.

Parts
2
Latest
  1. №01
    Language internals

    Type-Level Narrowing: How TypeScript Decides What You Meant

    Control flow analysis is a graph walk over your code. Knowing what widens a type again explains most of the errors that look wrong.

  2. №02
    Language internals

    Your Conditional Type Answered Twice. Both Answers Are Right.

    A naked type parameter splits its union before the conditional runs, so IsArray<string[] | number> comes back as 'no' | 'yes'. Read out of TypeScript 7.0.2.

Arrow keys to move, Enter to open.