Describe the bug
When applying the plainToClass function to a class defined with class-validator, it returns the class with no attributes
Input code
Here is a repo with a test reproducing the error
const usersOptionsInput = plainToClass(GetUsersOptionsInput, {
query: "Query",
pagination: { skip: 0, limit: 20 },
});
expect(usersOptionsInput.query).toEqual("Query"); // error
Config
You can also find the config at the repo reproducing the error
{
"jsc": {
"parser": {
"syntax": "typescript",
"tsx": false,
"decorators": true
},
"transform": {
"legacyDecorator": true,
"decoratorMetadata": true
},
"target": "es2018"
},
"module": {
"type": "commonjs",
"noInterop": true
}
}
Expected behavior
I would expect the instance of the class to have all the defined attributes.
Version
The version of @swc/core: 1.2.80
Additional context
Just one more time, I created this repo in order to reproduce the error
This error is related to #1362
Describe the bug
When applying the
plainToClassfunction to a class defined withclass-validator, it returns the class with no attributesInput code
Here is a repo with a test reproducing the error
Config
You can also find the config at the repo reproducing the error
{ "jsc": { "parser": { "syntax": "typescript", "tsx": false, "decorators": true }, "transform": { "legacyDecorator": true, "decoratorMetadata": true }, "target": "es2018" }, "module": { "type": "commonjs", "noInterop": true } }Expected behavior
I would expect the instance of the class to have all the defined attributes.
Version
The version of @swc/core: 1.2.80
Additional context
Just one more time, I created this repo in order to reproduce the error
This error is related to #1362