Skip to content

The option ignoreDecorators does not ignore @Transform  #1471

Open
@cjsewell

Description

@cjsewell

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: needs triageIssues which needs to be reproduced to be verified report.type: fixIssues describing a broken feature.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions