我有这种类型:
export type BranchOperatorRole = 'none' | 'seller' | 'operator' | 'administrator';
我可以使用哪个类验证器装饰器来验证属性是否具有这些值之一?
import { IsEmail, IsString, Contains } from "class-validator";
export type BranchOperatorRole = 'none' | 'seller' | 'operator' | 'administrator';
export class AddBranchOperatorRequest extends User {
@IsEmail()
email: string;
@Contains(BranchOperatorRole )
role: BranchOperatorRole;
}