-
Notifications
You must be signed in to change notification settings - Fork 489
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
Transforming objects created by Object.create(null)
produce unexpected results.
#120
Comments
👍 here. Apparently the Express.js team decided that it's best for user-supplied objects to have a null prototype (see links below). Unfortunately, this means that expressjs/multer#187 The culprit is here. The simplest fix would be to add As for the potential for future debugging, my personal preference would be to throw an error from the else case of |
I stumbled across this issue because GraphQL does the same. |
Thanks for the heads up @bjyoungblood! This looks serious. Can you propose a PR with your minimal fix for this? |
This has been fixed in 0cd39ed and will be included in the next release. |
Just published |
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. |
When transforming a plain object created by
Object.create(null)
plainToClass
does not return a new instance of the given constructor. Instead, it returns the original object:When exectued:
"class-transformer": "^0.1.8"
The text was updated successfully, but these errors were encountered: