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