MCPcopy Create free account
hub / github.com/TruthHun/BookStack / mergeData

Function mergeData

static/vuejs/vue.js:976–991  ·  view source on GitHub ↗

* Helper that recursively merges two data objects together.

(to, from)

Source from the content-addressed store, hash-verified

974 * Helper that recursively merges two data objects together.
975 */
976function mergeData (to, from) {
977 if (!from) { return to }
978 var key, toVal, fromVal;
979 var keys = Object.keys(from);
980 for (var i = 0; i < keys.length; i++) {
981 key = keys[i];
982 toVal = to[key];
983 fromVal = from[key];
984 if (!hasOwn(to, key)) {
985 set(to, key, fromVal);
986 } else if (isPlainObject(toVal) && isPlainObject(fromVal)) {
987 mergeData(toVal, fromVal);
988 }
989 }
990 return to
991}
992
993/**
994 * Data

Callers 1

vue.jsFile · 0.70

Calls 3

hasOwnFunction · 0.70
setFunction · 0.70
isPlainObjectFunction · 0.70

Tested by

no test coverage detected