TypeScript package for type guarding & casting

This page summarizes the projects mentioned and recommended in the original post on /r/typescript

Our great sponsors
  • SurveyJS - Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • to-typed

  • I've published a small package and I'd like to know what you all think about it. I've published to GitHub and also uploaded it to npm.

  • zod

    TypeScript-first schema validation with static type inference

  • Is this not good enough? https://github.com/colinhacks/zod

  • SurveyJS

    Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.

    SurveyJS logo
  • TypeScript

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

  • I just tried this and I really like how guards can operate on the input type, so you can do stuff like, if an input is A | B the output is B. This is something I wanted to do, but it's not possible if guards are wrapped in a class. I even opened an issue for this very reason.

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