Our great sponsors
-
SafeScript
This package intent is to make "safe" JavaScript runtime by checking types at runtime and disallowing most of implicit coercion
-
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.
There is also https://github.com/fabiandev/ts-runtime for Typescript that looks more polished. Too bad both these projects were abandoned, it would be such a cleaner alternative to libraries like io-ts.
Use unknown for data originating from an external source and use a library like zod to parse it. That has the added benefit that you immediately get an error in case the data is invalid vs. some time later when you're trying to do an operation on invalid data.