TypeScript 5.4 has been released, with the addition of a NoInfer utility type alongside preserved narrowing in closures following last assignments.
TypeScript is a superset of JavaScript that adds optional static types which can be checked by the TypeScript compiler to catch common errors in your programs. TypeScript can use this information to help you avoid about mistakes like typos, missing arguments, or forgetting to check for null and undefined.
The new NoInfer utility type solves a potential problem when calling generic functions. TypeScript tries to infer type arguments from whatever you pass in, but it's not always clear what the type would be best as the choice to infer. The new NoInfer<T> utility type can be used to signal to TypeScript not to try and match against the inner types to find candidates for type inference.
The addition of preserved narrowing in closures following last assignments means that when TypeScript has worked out a more specific type for a variable based on checks that you perform (type narrowing), that type is preserved in function closures.
The next improvement is the addition of declarations for JavaScript's new Object.groupBy and Map.groupBy static methods. Object.groupBy takes an iterable. It also takes a function that groups all the elements by making a key for each distinct group. Object.groupBy uses that key to make an object where every key maps to an array with the original element in it. Map.groupBy is similar, but produces a Map instead of a plain object.
Other improvements in this version include TypeScript checking the import attributes and assertions against the ImportAttribute type; and better handling of functions that are called with too many arguments.
TypeScript 5.4 is available now.
- Ian Elliot is the author of Just JavaScript: An Idiomatic Approach ; JavaScript Async ; Just jQuery: The Core UI ;Just jQuery: Events, Async & AJAX and JavaScript Bitmap Graphics with Canvas. All these titles are part of theI Programmer Librarypublished by I/O Press .
More Information
Related Articles
TypeScript 5 - Smaller, Simpler, Faster
TypeScript 4.7 Adds Node.js ECMAScript Module Support
TypeScript 4.6 Improves Constructors
TypeScript 4.4 Improves Control Flow Analysis
TypeScript 4.3 Adds Separate Property Write Types
TypeScript 4.2 Release Candidate Available
New TypeScript Website Launched
TypeScript 4.1 Adds Temporal Literal Types
To be informed about new articles on I Programmer, sign up for our weekly newsletter, subscribe to the RSS feed and follow us on Twitter, Facebook or Linkedin.
Mico - A Personality For Copilot
24/10/2025
Microsoft has designed an animated face for Copilot, its ubiquitous AI Assistant. Is Mico, whose name rhymes with "pico", going be a worthy successor to Clippy, the highly annoying paperclip that trie [ ... ]
Linkerd Adds MCP Support
06/11/2025
Buoyant, the creators of the Linkerd open source and service mesh for the enterprise, have announced the addition of support for Model Context Protocol (MCP) in Linkerd to extend its core service mesh [ ... ]
- What Does JetBrains Survey Tell Us About AI
- Jules Coding Agent Upgraded
- The Pico Gets Zephyr And Rust Support
- Scouting America Launches AI And Cybersecurity Badges
- Join The Protest Against The Closing Of Android
- George Boole, Boolean Logic and Computing
- Exploring The Microsoft Agent Framework
- Missing The Point Of LLMs
- .NET 10, C# 14 and F# 10 Released Alongside Visual Studio 2026
- Julia 1.12 Adds Trim Feature
- C# Could Overtake Java in TIOBE Index
- DH2i Launches DxEnterprise For SQL Server 2025
- XAML.io 0.5 Adds Multi-File Project Editing
Comments
or email your comment to: comments@i-programmer.info