What should we do if we have a variable whose value we dont know what it will be ?

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
  • type-fest

    A collection of essential TypeScript types

  • You could the appropriate JSON type provided by Type Fest (or similar libraries, or roll your own).

  • io-ts

    Runtime type system for IO decoding/encoding

  • The thing you're looking for is a library like zod or io-ts, which allow you to build arbitrarily complex type guards, without having to separately declare a matching type or interface. TypeScript infers the type from the type checker.

  • 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
  • zod

    TypeScript-first schema validation with static type inference

  • The thing you're looking for is a library like zod or io-ts, which allow you to build arbitrarily complex type guards, without having to separately declare a matching type or interface. TypeScript infers the type from the type checker.

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