A fundamental part of TypeScript's design is that TypeScript types are erased at runtime. There's no way to access them. But inevitably, you'll want to do just that. This comes up most often when you want to validate that user input matches a TypeScript type. Faced with this problem, TypeScript developers often reach for Zod, a schema validation tool. But Zod has some downsides, and it's not the only solution to this conundrum. This sample item explores this problem and three possible solutio...| effectivetypescript.com
What can Zig learn from TypeScript, and what can TypeScript learn from Zig?| effectivetypescript.com
It's tempting to use "", 0 or -1 as special values: an empty string might represent text that hasn't loaded yet, or -1 could stand in for a missing number. In TypeScript, this is almost always a bad idea. Special values need to be handled specially, and giving them a distinct type, such as null, allows TypeScript to enforce that you do so.| effectivetypescript.com