updateDeep
Makes the values of an object match the values of an other object including all children values.
.updateDeep(target, source)
Updates the values (and properties if map-like) of target
to match the values of source
.
For map-like objects, every enumerable property on target
is copied:
var target = {name: {first: "Justin"}, age: 34};
var source = {name: {last: "Meyer"}};
var restult = canReflect.assignDeep(target, source);
target //-> {name: {last: "Meyer"}}
An object can control the behavior of assignDeep
using the can.updateDeep symbol.
For list-like objects, a diff and patch strategy is used. This attempts to limit the number of changes.
Parameters
- target
{Object}
:The value that will be updated with
source
's values. - source
{Object}
:A source of values to copy to
target
.
Returns
{Object}
:
The target.