|
|
|
|
|
by ragnese
1613 days ago
|
|
I disagree. Enums are fine if they're string-only. It's only the numeric enums that cause the issues everyone complains about enums for. If there were a lint for making sure all enums are string-only, it would be the best solution, IMO. AFAIK, your solution is (slightly) worse than an enum in several ways and better in none: export enum Role {
CUSTOMER = 'customer',
ADMIN = 'admin',
SYSTEM = 'system',
STAFF = 'staff',
}
I think that implements everything yours does, but is easier to grok and fewer lines/declarations. |
|