It would be nice if the area objects in each of the maps were to include explicit values of all the fields. For example, the type of a region in the Region map should be:
instead of just a string for each of the properties. This would improve intellisense and mean that some equality checks would not throw a type error due to unknown properties.
Proposed solution
Casting the array of area data to const (using as const after the definition of the array) and using a generic to construct the correct type.
Description
It would be nice if the area objects in each of the maps were to include explicit values of all the fields. For example, the type of a region in the
Region
map should be:instead of just a string for each of the properties. This would improve intellisense and mean that some equality checks would not throw a type error due to unknown properties.
Proposed solution
Casting the array of area data to
const
(usingas const
after the definition of the array) and using a generic to construct the correct type.