Skip to content

Commit

Permalink
refactor: remove mergeArray option
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinchappell committed Mar 8, 2020
1 parent f098399 commit d2a60b5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/js/common/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,11 @@ export const uuid = elem => {
export const merge = (obj1, obj2, opts = Object.create(null)) => {
const customizer = (objValue, srcValue) => {
if (Array.isArray(objValue)) {
return unique(opts.mergeArray ? objValue.concat(srcValue) : srcValue)
if (Array.isArray(srcValue)) {
return unique(opts.mergeArray ? objValue.concat(srcValue) : srcValue)
} else {
return srcValue
}
}
}
return mergeWith({}, obj1, obj2, customizer)
Expand Down
2 changes: 1 addition & 1 deletion src/js/components/controls/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ export class Controls {
}

applyOptions = (controlOptions = {}) => {
const { container, elements, groupOrder, ...options } = merge(defaultOptions, controlOptions, { mergeArray: true })
const { container, elements, groupOrder, ...options } = merge(defaultOptions, controlOptions)
this.container = container
this.groupOrder = unique(groupOrder.concat(['common', 'html', 'layout']))
this.elements = elements.concat(defaultElements)
Expand Down

0 comments on commit d2a60b5

Please sign in to comment.