Module decorators/IfValid
Functions
IfValid
- IfValid(target: string, validationOptions?: ValidationOptions): (object: any, propertyName: string) => void
Parameters
Returns (object: any, propertyName: string) => void
- (object: any, propertyName: string): void
Parameters
object: any
propertyName: string
Returns void
The IfValid decorator checks whether the
target
argument is a valid property before proceeding with the validation of the property decorated.Example
The property
checkMe
is not valid and so the@IsDefined
annotation will not be invoked for thep1
property: