You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
NestJS_Basic/ts_playground/11-as-const.ts

8 lines
190 B

const ROLES = ["admin", "user", "guest"] as const;
type Role = typeof ROLES[number];
function checkRole(role: Role) {
console.log(`${role} 권한 확인`);
}
checkRole("admin");