Changes
This commit is contained in:
2
node_modules/mongoose/lib/schema/array.js
generated
vendored
2
node_modules/mongoose/lib/schema/array.js
generated
vendored
@@ -280,7 +280,7 @@ SchemaArray.prototype._applySetters = function(value, scope, init, priorVal) {
|
||||
// No need to wrap empty arrays
|
||||
if (value != null && value.length > 0) {
|
||||
const valueDepth = arrayDepth(value);
|
||||
if (valueDepth.min === valueDepth.max && valueDepth.max < depth) {
|
||||
if (valueDepth.min === valueDepth.max && valueDepth.max < depth && valueDepth.containsNonArrayItem) {
|
||||
for (let i = valueDepth.max; i < depth; ++i) {
|
||||
value = [value];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user