-
Notifications
You must be signed in to change notification settings - Fork 3
Closed
Description
I have an Enum and I'm trying to map the values to something else:
const UrlCategory = Enum(
'pro', // .com, .co.xyz, .biz
'geek', // .net, .io
'perso', // .me, .name
'other',
'special', // not internet, ex. chrome settings, ftp...
)
type UrlCategory = Enum<typeof UrlCategory>
const UrlCategoryColorMapping = {
UrlCategory.pro: 'blue',
UrlCategory.geek: 'yellow',
UrlCategory.perso: 'pink',
UrlCategory.other: 'green',
UrlCategory.special: 'black',
}
This is refused by the compiler on the ground of syntax error + error TS1117: An object literal cannot have multiple properties with the same name in strict mode.
Do you have any suggestion ?
Metadata
Metadata
Assignees
Labels
No labels