/typescript-demo

A demonstration of TypeScript’s problems, inconsistencies and cool features.

TypeScript Demo

Source code for a demo on TypeScript: Surviving the TypeScript Ecosystem: Writing Type-Safe(ish) JavaScript Code

Branches

Each branch on this repo corresponds to a section from the article.

  • Implicit casting to any
  • Implicit casting of this
  • Strict function types
  • Structural typing
  • Definitely Typed
  • Declaration merging
  • Strict null checks
  • Function overloads
  • keyof operator
  • Type guards
  • Discriminated unions
  • Branding and type-tagging