Rename merge to deepMerge so it's more clear what it's doing

This commit is contained in:
Robin Ward
2020-09-02 12:04:14 -04:00
parent f365d4639a
commit 3a46e44ed8
15 changed files with 36 additions and 34 deletions

View File

@ -1,9 +1,9 @@
// a fairly simple deep merge based on: https://gist.github.com/ahtcx/0cd94e62691f539160b32ecda18af3d6
function isObject(obj) {
return obj && typeof obj === "object";
}
export function merge(...objects) {
// a fairly simple deep merge based on: https://gist.github.com/ahtcx/0cd94e62691f539160b32ecda18af3d6
export function deepMerge(...objects) {
function deepMergeInner(target, source) {
Object.keys(source).forEach(key => {
const targetValue = target[key];