Skip to content

Commit

Permalink
styled : validation decorator add Javascript validation decorators
Browse files Browse the repository at this point in the history
  • Loading branch information
Minseok0917 committed Mar 28, 2024
1 parent 0853341 commit cfbea47
Showing 1 changed file with 4 additions and 0 deletions.
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

0 comments on commit cfbea47

Please sign in to comment.