Skip to content
This repository has been archived by the owner on Jan 3, 2024. It is now read-only.

Fix bug in mergeObject function. It failed to properly merge object w… #34

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/merger.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ function mergeObjects(source, target, opts) {
let item = source[property]

// Is this an object? Should we perform recursive merge?
if (opts.recurse && item instanceof Object) {
if (opts.recurse && item instanceof Object && !(item instanceof Function)) {
// If the item on the source is object, we must have such object on the target as well
// So we either reuse any such existing "receiving" object or we create a new one
const receiver = target[property] instanceof Object ? target[property]
Expand Down