Skip to content
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

Fixes #1342 - plainToInstance loses values for the Map type if key matches a prototype value of Map #1343

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/TransformOperationExecutor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ export class TransformOperationExecutor {
// throw new Error(`Cannot determine type for ${(targetType as any).name }.${propertyName}, did you forget to specify a @Type?`);

// if newValue is a source object that has method that match newKeyName then skip it
if (newValue.constructor.prototype) {
if (newValue.constructor.prototype && !(newValue instanceof Map)) {
const descriptor = Object.getOwnPropertyDescriptor(newValue.constructor.prototype, newValueKey);
if (
(this.transformationType === TransformationType.PLAIN_TO_CLASS ||
Expand Down