Dev

TypeScript 5.8 reaches general availability



Microsoft’s TypeScript 5.8, the latest version of the company’s strongly typed superset of JavaScript, has reached general availability (GA). However, one new feature introduced at the beta stage, a limited form of checking against conditional types in return statements, was dropped from the GA release.

General availability was announced February 28. Since the beta release, which arrived January 29, TypeScript’s builders pulled back some work on how functions with conditional return types are checked. The plan now is to iterate on the feature and release it in TypeScript 5.9.

TypeScript 5.8 does add more granular checks for branches within return expressions. With these granular checks, the type system special-cases conditional expressions directly inside return statements. Each branch of the conditional is checked against the declared return type of the containing function, if one happens to exist.



READ SOURCE

This website uses cookies. By continuing to use this site, you accept our use of cookies.