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

docs: Update documentation to reflect correct names for the Additional decorators. #1803

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
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -787,9 +787,9 @@ The `@Transform` decorator is given more arguments to let you configure how you

| Signature | Example | Description |
| ------------------------ | ---------------------------------------------------- | ------------------------------------------------------------------------------------- |
| `@TransformClassToPlain` | `@TransformClassToPlain({ groups: ["user"] })` | Transform the method return with instanceToPlain and expose the properties on the class. |
| `@TransformClassToClass` | `@TransformClassToClass({ groups: ["user"] })` | Transform the method return with instanceToInstance and expose the properties on the class. |
| `@TransformPlainToClass` | `@TransformPlainToClass(User, { groups: ["user"] })` | Transform the method return with plainToInstance and expose the properties on the class. |
| `@TransformInstanceToPlain` | `@TransformInstanceToPlain({ groups: ["user"] })` | Transform the method return with instanceToPlain and expose the properties on the class. |
| `@TransformInstanceToInstancen` | `@TransformInstanceToInstancen({ groups: ["user"] })` | Transform the method return with instanceToInstance and expose the properties on the class. |
| `@TransformPlainToInstance` | `@TransformPlainToInstance(User, { groups: ["user"] })` | Transform the method return with plainToInstance and expose the properties on the class. |

The above decorators accept one optional argument:
ClassTransformOptions - The transform options like groups, version, name
Expand All @@ -814,7 +814,7 @@ class User {
}

class UserController {
@TransformClassToPlain({ groups: ['user.email'] })
@TransformInstanceToPlain({ groups: ['user.email'] })
getUser() {
const user = new User();
user.firstName = 'Snir';
Expand Down