readonly
mapped type modifiers for Map
/ ReadonlyMap
#30633
Labels
readonly
mapped type modifiers for Map
/ ReadonlyMap
#30633
Search Terms
ReadonlyMap
ReadWrite
Writable
Suggestion
3.4.0-rc introduced the ability to use readonly mapped type modifiers with arrays.
(https://devblogs.microsoft.com/typescript/announcing-typescript-3-4-rc/)
It would be useful if the same syntax worked on
Use Cases
This is useful in any library dealing with immutable versions of types. It would allow mapped types to easily convert between Map and ReadonlyMap.
Examples
Similar examples using
Array
instead ofMap
didn't work before 3.4 and did work afterwards.Checklist
My suggestion meets these guidelines:
The text was updated successfully, but these errors were encountered: