mirror of
https://github.com/typeorm/typeorm.git
synced 2025-12-08 21:26:23 +00:00
fix: use object create if entity skip constructor is set (#9831)
This commit is contained in:
parent
bc306fb5a2
commit
a8689795da
@ -199,10 +199,10 @@ export class EmbeddedMetadata {
|
||||
return {}
|
||||
}
|
||||
|
||||
if (!options?.fromDeserializer || this.isAlwaysUsingConstructor) {
|
||||
return new (this.type as any)()
|
||||
} else {
|
||||
if (options?.fromDeserializer || !this.isAlwaysUsingConstructor) {
|
||||
return Object.create(this.type.prototype)
|
||||
} else {
|
||||
return new (this.type as any)()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user