Add string initializers to an enum
Change Typescript enum so that it has string initializers.
Start file
const enum TestkitType { vanilla, unidriver, protractor, puppeteer, unknown, }
End file
const enum TestkitType { vanilla = 'VANILLA', unidriver = 'UNIDRIVER', protractor = 'PROTRACTOR', puppeteer = 'PUPPETEER', unknown = 'UNKNOWN', }
View Diff
2,6c2,6 < vanilla, < unidriver, < protractor, < puppeteer, < unknown, --- > vanilla = 'VANILLA', > unidriver = 'UNIDRIVER', > protractor = 'PROTRACTOR', > puppeteer = 'PUPPETEER', > unknown = 'UNKNOWN',
Solutions by @dstein64:
Unlock 3 remaining solutions by signing in and submitting your own entry