Skip to content

Commit

Permalink
Simplify "was clone specified" logic
Browse files Browse the repository at this point in the history
  • Loading branch information
TehShrike committed Oct 4, 2017
1 parent 48dc381 commit 4fdce6a
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ function emptyTarget(val) {
}

function cloneUnlessOtherwiseSpecified(value, optionsArgument) {
var cloneOptionWasSpecified = optionsArgument && typeof optionsArgument.clone === 'boolean'
var clone = !cloneOptionWasSpecified || optionsArgument.clone === true
var clone = !optionsArgument || optionsArgument.clone !== false

return (clone && isMergeableObject(value))
? deepmerge(emptyTarget(value), value, optionsArgument)
Expand Down

0 comments on commit 4fdce6a

Please sign in to comment.