@unction/mergedeepright
TypeScript icon, indicating that this package has built-in type declarations

10.15.0 • Public • Published

@unction/mergeDeepRight

Tests Stability Dependencies

Array | Set | Record<string | number | symbol, B> | Map<B, A> | string => Array | Set | Record<string | number | symbol, B> | Map<B, A> | string => Array | Set | Record<string | number | symbol, B> | Map<B, A> | string

Recursively merges two enumerables. Merges objects with merge and arras with concat. Prefers right. THAT IS ALL.

const left = {
  alpha: "1"
}
const right = {
  beta: "2"
}

mergeDeepRight(left)(right)
{
  alpha: "1",
  beta: "2"
}
const left = {
  alpha: {
    alpha1: "1"
  }
}
const right = {
  beta: {
    beta1: "1"
  }
}

mergeDeepRight(left)(right)
{
  alpha: {
    alpha1: "1"
  },
  beta: {
    beta1: "1"
  }
}
const left = {
  alpha: [
    "1"
  ]
}
const right = {
  alpha: [
    "1"
  ]
}

mergeDeepRight(left)(right)
{
  alpha: [
    "1",
    "1"
  ]
}

Readme

Keywords

Package Sidebar

Install

npm i @unction/mergedeepright

Weekly Downloads

1

Version

10.15.0

License

SEE LICENSE IN LICENSE

Unpacked Size

19.9 kB

Total Files

7

Last publish

Collaborators

  • krainboltgreene