Skip to content

Commit

Permalink
Merge pull request jdorn#808 from odurbalau/fix/786_describedBy_hang_…
Browse files Browse the repository at this point in the history
…null_value

Fixed the console error when using describedBy
  • Loading branch information
schmunk42 authored Aug 12, 2020
2 parents 68d170e + e995021 commit 4126c66
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions src/utilities.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,18 @@ export function deepCopy (target) {

export function extend (destination, ...args) {
args.forEach(source => {
Object.keys(source).forEach(property => {
if (source[property] && isPlainObject(source[property])) {
if (!hasOwnProperty(destination, property)) destination[property] = {}
extend(destination[property], source[property])
} else if (Array.isArray(source[property])) {
destination[property] = deepCopy(source[property])
} else {
destination[property] = source[property]
}
})
if (source) {
Object.keys(source).forEach(property => {
if (source[property] && isPlainObject(source[property])) {
if (!hasOwnProperty(destination, property)) destination[property] = {}
extend(destination[property], source[property])
} else if (Array.isArray(source[property])) {
destination[property] = deepCopy(source[property])
} else {
destination[property] = source[property]
}
})
}
})

return destination
Expand Down

0 comments on commit 4126c66

Please sign in to comment.