From cfbea473775b5fc751987b6d0c4a1da63b274af4 Mon Sep 17 00:00:00 2001 From: Minseok Jung <37059223+Minseok0917@users.noreply.github.com> Date: Thu, 28 Mar 2024 11:30:31 +0900 Subject: [PATCH] styled : validation decorator add Javascript validation decorators --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 886712dd76..0970cfe540 100644 --- a/README.md +++ b/README.md @@ -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. |