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

Function mergeData

static/vuejs/vue.runtime.common.js:968–983  ·  view source on GitHub ↗

* Helper that recursively merges two data objects together.

(to, from)

Source from the content-addressed store, hash-verified

966 * Helper that recursively merges two data objects together.
967 */
968function mergeData (to, from) {
969 if (!from) { return to }
970 var key, toVal, fromVal;
971 var keys = Object.keys(from);
972 for (var i = 0; i < keys.length; i++) {
973 key = keys[i];
974 toVal = to[key];
975 fromVal = from[key];
976 if (!hasOwn(to, key)) {
977 set(to, key, fromVal);
978 } else if (isPlainObject(toVal) && isPlainObject(fromVal)) {
979 mergeData(toVal, fromVal);
980 }
981 }
982 return to
983}
984
985/**
986 * Data

Callers 1

Calls 3

hasOwnFunction · 0.70
setFunction · 0.70
isPlainObjectFunction · 0.70

Tested by

no test coverage detected