source: node_modules/ramda/es/mergeWith.js

main
Last change on this file was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago

Initial commit

  • Property mode set to 100644
File size: 1.0 KB
Line 
1import _curry3 from "./internal/_curry3.js";
2import mergeWithKey from "./mergeWithKey.js";
3/**
4 * Creates a new object with the own properties of the two provided objects. If
5 * a key exists in both objects, the provided function is applied to the values
6 * associated with the key in each object, with the result being used as the
7 * value associated with the key in the returned object.
8 *
9 * @func
10 * @memberOf R
11 * @since v0.19.0
12 * @category Object
13 * @sig ((a, a) -> a) -> {a} -> {a} -> {a}
14 * @param {Function} fn
15 * @param {Object} l
16 * @param {Object} r
17 * @return {Object}
18 * @see R.mergeDeepWith, R.merge, R.mergeWithKey
19 * @example
20 *
21 * R.mergeWith(R.concat,
22 * { a: true, values: [10, 20] },
23 * { b: true, values: [15, 35] });
24 * //=> { a: true, b: true, values: [10, 20, 15, 35] }
25 */
26
27var mergeWith =
28/*#__PURE__*/
29_curry3(function mergeWith(fn, l, r) {
30 return mergeWithKey(function (_, _l, _r) {
31 return fn(_l, _r);
32 }, l, r);
33});
34
35export default mergeWith;
Note: See TracBrowser for help on using the repository browser.