TypeScript 4.6 adds control flow analysis, ES2022 support
TypeScript 4.6, the new iteration of Microsoft’s strongly typed superset of JavaScript, is now available as a production release, with capabilities ranging from control flow analysis to improved recursion depth checks.The production release, published February 28, followed a release candidate published February 11 and a beta release offered on January 21.With control flow analysis for destructured discriminated unions, TypeScript now can narrow types based on a discriminant party. When destructuring individual properties into a const declaration, or when destructuring a parameter into variables that are never assigned to, TypeScript will check if the destructured type is a discriminated union. If so, TypeScript can narrow types of variables depending on checks of other variables.To read this article in full, please click here
TypeScript 4.6, the new iteration of Microsoft’s strongly typed superset of JavaScript, is now available as a production release, with capabilities ranging from control flow analysis to improved recursion depth checks.
The production release, published February 28, followed a release candidate published February 11 and a beta release offered on January 21.
With control flow analysis for destructured discriminated unions, TypeScript now can narrow types based on a discriminant party. When destructuring individual properties into a const
declaration, or when destructuring a parameter into variables that are never assigned to, TypeScript will check if the destructured type is a discriminated union. If so, TypeScript can narrow types of variables depending on checks of other variables.