Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

styled : validation decorator add Javascript validation decorators #2448

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -796,6 +796,10 @@ isBoolean(value);

| Decorator | Description |
| ------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Javascript validation decorators** | |
| `@ValidateNested()` | If the object contains nested objects and you want the validator to also validate those nested objects, use this. Nested objects must be instances of a class. |
| `@ValidatePromise()` | If the object's property returns a Promise and that Promise's resolved value needs to be validated, use this decorator. It performs validation after the Promise is resolved. |
| `@ValidateIf((value) => boolean)` | Uses the provided condition function to ignore the validators on a property when the function returns false. The condition function takes the object being validated and must return a boolean. |
| **Common validation decorators** | |
| `@IsDefined(value: any)` | Checks if value is defined (!== undefined, !== null). This is the only decorator that ignores skipMissingProperties option. |
| `@IsOptional()` | Checks if given value is empty (=== null, === undefined) and if so, ignores all the validators on the property. |
Expand Down