MCPcopy Index your code
hub / github.com/keepfool/vue-tutorials / mergeData

Function mergeData

06.Router/basic/js/vue.js:1645–1657  ·  view source on GitHub ↗

* Helper that recursively merges two data objects together.

(to, from)

Source from the content-addressed store, hash-verified

1643 */
1644
1645 function mergeData(to, from) {
1646 var key, toVal, fromVal;
1647 for (key in from) {
1648 toVal = to[key];
1649 fromVal = from[key];
1650 if (!hasOwn(to, key)) {
1651 set(to, key, fromVal);
1652 } else if (isObject(toVal) && isObject(fromVal)) {
1653 mergeData(toVal, fromVal);
1654 }
1655 }
1656 return to;
1657 }
1658
1659 /**
1660 * Data

Callers 1

vue.jsFile · 0.70

Calls 3

hasOwnFunction · 0.70
setFunction · 0.70
isObjectFunction · 0.70

Tested by

no test coverage detected