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

9.13.0 • Public • Published

@unction/mergeWithKey

Tests Stability Dependencies

MapperFunctionType<L, MapperFunctionType<R, MapperFunctionType<K, V>>> => KeyedEnumerableType<R, K> => KeyedEnumerableType<L, K> => ListType | Record<string | number | symbol, V> | Map<K, V> | string

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

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

mergeWithKey((left) => (right) => (key) => key+leftValue+rightValue)(left)(right)

Which returns:

{
  beta: "beta12"
}

Readme

Keywords

Package Sidebar

Install

npm i @unction/mergewithkey

Weekly Downloads

6

Version

9.13.0

License

SEE LICENSE IN LICENSE

Unpacked Size

21.7 kB

Total Files

7

Last publish

Collaborators

  • krainboltgreene