Commit 38b99093 authored by Pedro Eduardo Trujillo's avatar Pedro Eduardo Trujillo
Browse files

Corrige mezcla profunda de arrays

Tras definir la opción isMergeableObject para deepmerge, se dejaron
fuera las mezclas configurables de arrays. Se amplía para incorporarlas
de nuevo sin romper el filtrado actual de objetos.
parent 4c81f207
Loading
Loading
Loading
Loading
+15 −1
Original line number Diff line number Diff line
@@ -1220,8 +1220,22 @@ define([

		_isMergeableObject: function(value) {

			if (!value) {
				return false;
			}

			const isArray = Array.isArray(value);
			if (isArray) {
				return true;
			}

			// Inspirado por https://github.com/jonschlinkert/is-plain-object
			return !!value?.constructor?.prototype?.hasOwnProperty('isPrototypeOf');
			const isPlainObject = value.constructor?.prototype?.hasOwnProperty('isPrototypeOf');
			if (isPlainObject) {
				return true;
			}

			return false;
		},

		_overwritingArrayMerge: function(destinationArray, sourceArray, options) {