File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -3690,8 +3690,8 @@ Document.prototype.$toObject = function(options, json) {
36903690 const schemaOptions = this . $__schema && this . $__schema . options || { } ;
36913691 // merge base default options with Schema's set default options if available.
36923692 // `clone` is necessary here because `utils.options` directly modifies the second input.
3693- defaultOptions = { ...defaultOptions , ...clone ( baseOptions ) } ;
3694- defaultOptions = { ...defaultOptions , ...clone ( schemaOptions [ path ] || { } ) } ;
3693+ defaultOptions = { ...defaultOptions , ...baseOptions } ;
3694+ defaultOptions = { ...defaultOptions , ...schemaOptions [ path ] } ;
36953695
36963696 // If options do not exist or is not an object, set it to empty object
36973697 options = utils . isPOJO ( options ) ? { ...options } : { } ;
Original file line number Diff line number Diff line change @@ -578,7 +578,7 @@ Schema.prototype.defaultOptions = function(options) {
578578 _id : true ,
579579 id : id ,
580580 typeKey : 'type' ,
581- ...clone ( options )
581+ ...options
582582 } ;
583583
584584 if ( options . versionKey && typeof options . versionKey !== 'string' ) {
You can’t perform that action at this time.
0 commit comments