MCPcopy Create free account
hub / github.com/keepfool/vue-tutorials / _merge

Function _merge

06.Router/basic/js/vue-resource.js:393–407  ·  view source on GitHub ↗
(target, source, deep)

Source from the content-addressed store, hash-verified

391 }
392
393 function _merge(target, source, deep) {
394 for (var key in source) {
395 if (deep && (isPlainObject(source[key]) || isArray(source[key]))) {
396 if (isPlainObject(source[key]) && !isPlainObject(target[key])) {
397 target[key] = {};
398 }
399 if (isArray(source[key]) && !isArray(target[key])) {
400 target[key] = [];
401 }
402 _merge(target[key], source[key], deep);
403 } else if (source[key] !== undefined) {
404 target[key] = source[key];
405 }
406 }
407 }
408
409 function root (options, next) {
410

Callers 2

mergeFunction · 0.70
_assignFunction · 0.70

Calls 2

isArrayFunction · 0.85
isPlainObjectFunction · 0.70

Tested by

no test coverage detected