Our great sponsors
-
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.
TypeScript itself feels like a language with some complexity. It's forced me mentally to think in terms of sets where I never really did that before while coding, unless I was using some data structure / operation that is defined in terms of sets. TS has recursion and is Turing complete. That was kind of mind blowing to me to discover.
To formalize it, you can write type tests (yes, types can be tested! A failing test is a compiler error. You can also test the negative case, using // @ts-expect-error ). If you want to see how types are tested, check out some open source projects like type-fest.
You can check ast-viewer Consider this example: typescript type Result = keyof HTMLDivElement Click in ast viewer on Result type, you will see something like that: Type keyof HTMLDivElement ... value:"align" value:"addEventListener" value:"removeEventListener" ... If you want to have more control over AST, you can check ts-ast-viewer repo
Hi, Checkout tsafe. It enables to test types definition. Checkout this GIF in particular. Let's say for example that we have an objectFromEntries function and we want to test it typewise, we can do: ```typescript import { objectEntries } from "../myObjectFromEntries"; import { assert } from "tsafe";
Real-life examples: 1, 2, 3
Real-life examples: 1, 2, 3