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 reddit.com/r/typescript

Our great sponsors
  • InfluxDB - Build time-series-based applications quickly and at scale.
  • Sonar - Write Clean JavaScript Code. Always.
  • Zigi - The context switching struggle is real
  • Scout APM - Truly a developer’s best friend
  • 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.

  • InfluxDB

    Build time-series-based applications quickly and at scale.. InfluxDB is the Time Series Data Platform where developers build real-time applications for analytics, IoT and cloud-native services in less time with less code.

  • 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