typestack / class-transformer

Decorator-based transformation, serialization, and deserialization between objects and classes.
MIT License
6.81k stars 500 forks source link

`Transform` decorator applies transformation multiple times on every `plainToInstance` call #1720

Closed ghost closed 2 months ago

ghost commented 3 months ago

I have applied a transformation to my field that transforms it by multiplying with a certain number like this:

@Transform(({ value }) => value * secondsInHour)

Whenever a plainToInstance is called, it applies this transformation multiple times. I need to apply plainToInstance multiple times in a single flow for some reason but I don't want to apply this transformation more than once.

Could any please suggest some approaches or strategies to avoid multiple transformations?

diffy0712 commented 2 months ago

The issue does not contain a simple reproduction case.

Closing as invalid.

github-actions[bot] commented 1 month ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.