Takes a left and right collection and recuresively combines them prefering right: merge for Object and concat for Array
npm install @unction/mergedeepright![Tests][BADGE_TRAVIS]
![Stability][BADGE_STABILITY]
![Dependencies][BADGE_DEPENDENCY]
> Array | Set | Record
Recursively merges two enumerables. Merges objects with merge and arras with concat. Prefers right. THAT IS ALL.
`` javascript
const left = {
alpha: "1"
}
const right = {
beta: "2"
}
mergeDeepRight(left)(right)
{
alpha: "1",
beta: "2"
}
`
` javascript
const left = {
alpha: {
alpha1: "1"
}
}
const right = {
beta: {
beta1: "1"
}
}
mergeDeepRight(left)(right)
{
alpha: {
alpha1: "1"
},
beta: {
beta1: "1"
}
}
`
` javascript
const left = {
alpha: [
"1"
]
}
const right = {
alpha: [
"1"
]
}
mergeDeepRight(left)(right)
{
alpha: [
"1",
"1"
]
}
``
[BADGE_TRAVIS]: https://img.shields.io/travis/unctionjs/mergeDeepRight.svg?maxAge=2592000&style=flat-square
[BADGE_STABILITY]: https://img.shields.io/badge/stability-strong-green.svg?maxAge=2592000&style=flat-square
[BADGE_DEPENDENCY]: https://img.shields.io/david/unctionjs/mergeDeepRight.svg?maxAge=2592000&style=flat-square