#DTO. Decorator's conditions

4 messages · Page 1 of 1 (latest)

inland jay
#

Is it possible to execute decorators by condition?
Somthing like this:

@Or(IsString(), IsHexColor())
readonly color: string;
empty osprey
#

There's ValidateIf. But it's not for either or validations like it seems you want

tranquil verge
#

For instance, you may have @IsColor() decorator