getting typescript to allow iterator helpers
05:02 31 Aug 2025

I'm compiling some typescript code using typescript 5.8.3. At one point in my code, I'm using an iterator helper on the values of a map, as in myMap.values().map(...). This seems to be causing a failure to compile, with the error "Property 'map' does not exist on type 'MapIterator...".

Reading the release notes for Typescript 5.6 makes me think that versions of typescript greater than 5.6 should know that the iterators returned by Map.proptype methods such as values() have iterator helper methods like map().

Am I misunderstanding those release notes? Or is there something I need to do in my tsconfig or in my typescript code to get typescript to treat the iterators returned by Map.prototype.values() and similar as iterators that have the iterator helper methods?

typescript