Skip to content

Commit

Permalink
Little precaution code.
Browse files Browse the repository at this point in the history
  • Loading branch information
koresar committed Jun 9, 2015
1 parent 95efa87 commit 1e883ab
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion mixer.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,11 @@ function mergeUniqueSourceToTarget(srcVal, targetVal) {
if (isObject(srcVal) && isObject(targetVal)) {
// inception, deep merge objects
return mergeUnique(targetVal, srcVal);
} else {
} else if (isUndefined(targetVal)) {
// make sure arrays, regexp, date, objects are cloned
return deepClone(srcVal);
} else {
return targetVal;
}
}

Expand Down

0 comments on commit 1e883ab

Please sign in to comment.