#enum used as key to map should not have possible undefined
3 messages · Page 1 of 1 (latest)
Map doesn't guarantee exhaustiveness. new Map<CountryVariants, string> just means that the map has CountryVariants keys and string values
it's a mapping between values but it isn't an exhaustive mapping over the enum
you may want to use a record rather than a map; a record with a union literal key specifies exhaustive mapping