Hacker News new | ask | show | jobs
by conaclos 1613 days ago
`as const` is needed for ensuring that TypeScript uses literal types for the enum members. Otherwise you ends with `TUserRole = string`.