Is it feasible to create a Record
that maps selected keys from one object to another? I am attempting to map Google's libphonenumberCountryCode
options to my custom formatting objects. Currently, I have:
const countryOptions: Record<CountryCode, CountryFormat> = {
'US': {
//... my CountryFormat object
},
//...
}
The issue is that I must define all keys in CountryCode (around 240) even though I only use a fraction of them. Is there a way to modify this record type to target specific keys within CountryCode?