Automatically generating typeguard functions

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
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • ts-auto-guard

    Generate type guard functions from TypeScript interfaces

  • One thing I did realise after looking at your code was that I could try changing the attributes property to a Record and see if https://github.com/rhys-vdw/ts-auto-guard handled that well, which it did!

  • io-ts

    Runtime type system for IO decoding/encoding

  • I've also looked at https://github.com/gcanti/io-ts and https://github.com/pelotom/runtypes but both have a manual step converting the types into a runtime representiation by hand which I'd like to avoid.

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

    Runtime validation for static types

  • I've also looked at https://github.com/gcanti/io-ts and https://github.com/pelotom/runtypes but both have a manual step converting the types into a runtime representiation by hand which I'd like to avoid.

  • io-ts-transformer

    TypeScript transformer which converts TypeScript types to io-ts entities

  • You can use the plugin https://github.com/awerlogus/io-ts-transformer with https://github.com/cevek/ttypescript to get compile time generation of io-ts codecs as well.

  • ttypescript

    Over TypeScript tool to use custom transformers in the tsconfig.json

  • You can use the plugin https://github.com/awerlogus/io-ts-transformer with https://github.com/cevek/ttypescript to get compile time generation of io-ts codecs as well.

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
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