File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -669,11 +669,11 @@ enum Color {
669669 BRAND = ' #9C0E7D' ,
670670}
671671
672- // ✅ Use const assertion
672+ // ✅ Use const assertions
673673const USER_ROLES = [' guest' , ' moderator' , ' administrator' ] as const ;
674674type UserRole = (typeof USER_ROLES )[number ]; // Type "guest" | "moderator" | "administrator"
675675
676- // Use satisfies if UserRole type is already defined - e.g. database schema model
676+ // Use ' satisfies' if the UserRole type is already defined, e.g., in a database schema model
677677type UserRoleDB = ReadonlyArray <' guest' | ' moderator' | ' administrator' >;
678678const AVAILABLE_ROLES = [' guest' , ' moderator' ] as const satisfies UserRoleDB ;
679679
@@ -682,6 +682,7 @@ const COLOR = {
682682 secondary: ' #113A5C' ,
683683 brand: ' #9C0E7D' ,
684684} as const ;
685+
685686type Color = typeof COLOR ;
686687type ColorKey = keyof Color ; // Type "primary" | "secondary" | "brand"
687688type ColorValue = Color [ColorKey ]; // Type "#B33930" | "#113A5C" | "#9C0E7D"
You can’t perform that action at this time.
0 commit comments