Preserve Literals
Preserve Literals
π¨βπΌ We store role permissions in a configuration object. Without
as const,
TypeScript widens the booleans to boolean, which loses useful information.π¨ Open
and:
- Add
as constto therolesobject - Create a
Roletype usingkeyof typeof roles - Fix the
adminCanDeleteassignment - Implement
canDeleteUsersusing therolesdata
π°
as const preserves true and false as literal types, not just boolean.