Open
Description
Description
The option ignoreDecorators
does not ignore @Transform
Minimal code-snippet showcasing the problem
class MyClass {
@Transform(({ value }) => `${value} transformed`, {
toClassOnly: true,
})
prop: '';
}
const plain = { prop: 'prop' };
const result = plainToClass(MyClass, plain);
console.log(result.prop); // expected output: "prop transformed"
const resultNoDecorators = plainToClass(MyClass, plain, { ignoreDecorators: true });
console.log(resultNoDecorators.prop); // expected output: "prop"
Expected behavior
I expect the resultNoDecorators object to have the prop property with the original value, without any transformations applied.
Actual behavior
The resultNoDecorators object still has the prop property transformed, even though the ignoreDecorators option is used.nested. Prop