TypeScript: Control flow analysis for destructured discriminated unions

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

Our great sponsors
  • Appwrite - The Open Source Firebase alternative introduces iOS support
  • Scout APM - Less time debugging, more time building
  • SonarQube - Static code analysis for 29 languages.
  • TypeScript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

    The above is caught in Flow when exact types are enabled but not in TS.

    TS issue https://github.com/microsoft/TypeScript/issues/12936

    TS has a concept of "freshness" which catches some of these mistakes when you construct y right in the arguments of x, but it gets easily broken by accident and without a warning.

    2. Nominal types, so you can have for example "Id" type that is a number but not to be mixed with other numbers, you can't just call a function that expects an Id with literal 42. Classes are nominal too, which I think is a solid choise.

    3. Type variance & related safeguards

        function x(y: { foo: string | number}) {

  • type-fest

    A collection of essential TypeScript types

    I know you're entirely right, but sometimes I see things like this in Typescript and although I can walk through it with enough pause, it kinda makes my head implode when I glance at it:


  • Appwrite

    Appwrite - The Open Source Firebase alternative introduces iOS support . Appwrite is an open source backend server that helps you build native iOS applications much faster with realtime APIs for authentication, databases, files storage, cloud functions and much more!

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts