Various techniques for how to narrow the type of a value to a more specific one: from control flow analysis and built-in type guards to user-defined type guards and downcast functions. 🔗 blog.thoughtspile.tech/2023/01/31/typ… ✍️ by @thoughtspile 🏷 #TypeScript #JavaScript
1
1
25
3K
4
@TypeScriptDaily Thanks for sharing! BTW, I just published banditypes — a library wrapping all these techniques into an easy-to-use 400-byte package: github.com/thoughtspile/b…