1.0.9 • Published 4 years ago

@payk/class-validator-extras v1.0.9

Weekly downloads
9
License
ISC
Repository
github
Last release
4 years ago

Class Validator Extras

Install

npm install @payk/class-validator-extras

Usage

ValidateWithCondition

The decorator needs to define a function that receives two values, an object of the current class and the value of the current property. It needs to return a boolean. You can also pass the options object and override the message for your usage.

class MyClass {

    startDate: Date;

    @ValidateWithCondition((obj: MyClass, val: Date) => val > obj.startDate, { message: 'ExpirationDate must be after the StartDate' })
    expirationDate: Date;
}
1.0.9

4 years ago

1.0.8

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago