Skip to content
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
6 changes: 4 additions & 2 deletions src/customMerge.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import _ from 'lodash';

export default function customMerge(obj1, obj2) {
const objToReturn = {};

Expand All @@ -13,8 +15,8 @@ export default function customMerge(obj1, obj2) {
for (property2 in obj2) {
if (property1 === property2) {
if (
typeof obj1[property1] !== "object" ||
typeof obj2[property1] !== "object" ||
!_.isPlainObject(obj1[property1]) ||
!_.isPlainObject(obj2[property1]) ||
!obj2[property1] ||
!obj1[property1]
) {
Expand Down