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

13.14.0 • Public • Published

@unction/mergeWith

Tests Stability Dependencies

MapperFunctionType<A, MapperFunctionType<A, A>> => 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

Merges two enumerables and uses a provided function to handle conflicts. The function is given the the left value and the right value.

const left = {
  alpha: "0",
  beta: "1",
  zeta: "3"
}
const right = {
  alpha: "0",
  beta: "2",
  zeta: "3"
}

mergeWith((l) => (r) => l+r)(left)(right)

Which returns:

{
  alpha: "0",
  beta: "12",
  zeta: "3"
}

Readme

Keywords

Package Sidebar

Install

npm i @unction/mergewith

Weekly Downloads

0

Version

13.14.0

License

SEE LICENSE IN LICENSE

Unpacked Size

19.2 kB

Total Files

7

Last publish

Collaborators

  • krainboltgreene