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.
Unfortunately I can't at the moment. It's unpublished and hosted on my private server and barely touched over the last few years. When ts-pattern was published I stopped working on it (except for when TS improved the recursion limit, I played with it again). I can copy the type states into a playground when I get to a computer I can access it from. However this playground has a basic implementation of what /u/josephjnk described. The tradeoff between this and what I've described is that, here, the end user needs to use typeguards for every predicate vs. you having to make complex types to support every weird corner case of inference the compiler throws at you.