How to use the merge function from ramda

Find comprehensive JavaScript ramda.merge code examples handpicked from public code repositorys.

194
195
196
197
198
199
200
201
202
203
                const getCdcFilePath = tableName => `./tables/${tableName}_zscores.cdc.json`;
                const loadCdcFiles = R.pipe(getCdcFilePath, R.pipeP(fs.readFile, JSON.parse));
                return Promise.all(R.map(loadCdcFiles, cdcTableNames))
                    .then(R.map(reIndex))
                    .then(R.zipObj(cdcTableNames))
                    .then((cdcData) => R.merge(data, cdcData));
            }
            return data;
        });
}
fork icon2
star icon6
watch icon0

398
399
400
401
402
403
404
405
406
407
  role: OpenTok.otRoles.MODERATOR,
  data: buildOtData(roles.PRODUCER)
};
const backstageToken = await OpenTok.createToken(admin.otApiKey, admin.otSecret, event.sessionId, options);
const stageToken = await OpenTok.createToken(admin.otApiKey, admin.otSecret, event.stageSessionId, options);
return R.merge(event, {
  apiKey: admin.otApiKey,
  backstageToken,
  stageToken
});
fork icon12
star icon5
watch icon0

+ 3 other calls in file

5
6
7
8
9
10
11
12
13
14
 * @param  {[type]} first  [description]
 * @param  {[type]} second [description]
 * @return {[type]}        [description]
 */
function concatValues (key, first, second){
   return key!="module" && key!="plugins" ? R.merge(first,second) : first;
	// return key!="module" && key!="plugins" ? second : first;
}
/**
 * Unique webpack other configuration except for `module` and `plugins`
fork icon8
star icon15
watch icon0

7
8
9
10
11
12
13
14
15
16
 * @param  {[type]} first  [description]
 * @param  {[type]} second [description]
 * @return {[type]}        [description]
 */
function concatValues(key, first, second) {
  return key != "module" && key != "plugins" ? R.merge(first, second) : first;
  // return key!="module" && key!="plugins" ? second : first;
}
/**
 * Unique webpack other configuration except for `module` and `plugins`
fork icon8
star icon15
watch icon0

281
282
283
284
285
286
287
288
289
290
291
292
  LAST_PAGE_NAME: LAST_PAGE_NAME,
  HTTP: HTTP
};


function merge$1 (obj1, obj2) {
  return R.merge(obj1, obj2)
}


function mergeDeepRight$1 (obj1, obj2) {
  return R.mergeDeepRight(obj1, obj2)
fork icon2
star icon5
watch icon3

32
33
34
35
36
37
38
39
40
41
logger.debug(jiveContent);
return this.getContent(community, contentId)
    .then(function (successResponse) {
        var existingContent = successResponse.entity;
        logger.debug('getContent: Retrieved content successfully', existingContent);
        var mergedContent = R.merge(existingContent, jiveContent);
        logger.debug('updateContent: Merged Content', mergedContent);
        return jive.community.doRequest(community,
            {
                url: env.jive.url + "/api/core/v3/contents/" + contentId,
fork icon1
star icon3
watch icon3

+ 9 other calls in file

17
18
19
20
21
22
23
24
25
26
var __ = _require2.__;
var liftN = _require2.liftN;
var curry = _require2.curry;
var pipe = _require2.pipe;
var always = _require2.always;
var merge = _require2.merge;
var props = _require2.props;
var apply = _require2.apply;
var identity = _require2.identity;
var unapply = _require2.unapply;
fork icon1
star icon3
watch icon3

49
50
51
52
53
54
55
56
57
58
59
 *  ]
 */


function merges(arr1 = []) {
  // console.log(`菜单:  ${JSON.stringify(arr1.label) }  url:${JSON.stringify(arr1.handler) }`);
  return R.merge(arr1, {
    key: arr1.value,
    menuId: arr1.value,
    menuName: arr1.label,
    url: arr1.handler,
fork icon1
star icon0
watch icon0

2
3
4
5
6
7
8
9
10
11
12
13
const _isObject = require("./internal/_isObject");
const _isPromise = require("./internal/_isPromise");


function mergeIntoContext(ctx, ret) {
    return _isObject(ret)
        ? R.merge(R.mergeDeepRight(ctx, ret), { __: ret })
        : R.merge(ctx, { __: ret });
}


function run(ctx, fn) {
fork icon0
star icon1
watch icon0

+ 3 other calls in file

47
48
49
50
51
52
53
54
55
56
57
	const internetSpeedPercentile = percentile(
		groupedByProp.internetSpeed,
		internetSpeed
	);
	const score = 100 * (1.0 - costPercentile) + 20 * internetSpeedPercentile;
	return R.merge(city, { score });
};


// const scoredCities = R.map(calcScore, updatedCities);

fork icon0
star icon1
watch icon0

+ 2 other calls in file

7309
7310
7311
7312
7313
7314
7315
7316
7317
* @example
*
*      R.merge({ 'name': 'fred', 'age': 10 }, { 'age': 40 });
*      //=> { 'name': 'fred', 'age': 40 }
*
*      const withDefaults = R.merge({x: 0, y: 0});
*      withDefaults({y: 2}); //=> {x: 0, y: 2}
* @symb R.merge(a, b) = {...a, ...b}
*/
fork icon0
star icon0
watch icon0

+ 5 other calls in file

28
29
30
31
32
33
34
35
36
37
    displayFilter: ""
  },
  general || {}
);

const shortTextCfg = merge(
  {
    length: 10
  },
  shortText || {}
fork icon0
star icon0
watch icon0

+ 23 other calls in file

2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
 * @example
 *
 *      R.merge({ 'name': 'fred', 'age': 10 }, { 'age': 40 });
 *      //=> { 'name': 'fred', 'age': 40 }
 *
 *      var resetToDefault = R.merge(R.__, {x: 0});
 *      resetToDefault({x: 5, y: 2}); //=> {x: 0, y: 2}
 */
var merge = _curry2(function merge(l, r) {
    return _assign({}, l, r);
fork icon0
star icon0
watch icon1

+ 37 other calls in file

678
679
680
681
682
683
684
685
686
687
688
689
690
691
log(R.forEachObjIndexed(printKeyConcatValue)(values));


log(R.merge({name: 'fred', age: 10})({age: 40}));
log(R.merge(['1', '2'])(['10']));


var resetToDefault = R.merge(R.__, {x: 0});
log(resetToDefault({x: 5, y: 2}));




log(R.mergeWith(R.concat, {
fork icon0
star icon0
watch icon0

+ 9 other calls in file

23
24
25
26
27
28
29
30
31
32
  en: notification.text,
},
android_group: 'flex_appeal_message',
ios_badgeType: 'Increase',
ios_badgeCount: 1,
data: R.merge(notification.data, {
  organisation_id: organisationId,
  network_id: networkId,
}),
filters: R.intersperse({
fork icon0
star icon0
watch icon0

31
32
33
34
35
36
37
38
39

  // put \n's in their own nodes by themselves
  this.textNodes = R.flatten(this.textNodes.map(n => {
    let splitText = this._newlineSplitter(n.text);
    return splitText.map(t => {
      return R.merge(n, { text: t });
    })
  }));
}
fork icon0
star icon0
watch icon0

34
35
36
37
38
39
40
41
42
43
44
45
46


    return css.stringify(ast, { compress: true });
}


module.exports = function configrePrefixStyleClassId (opts) {
    var options = R.merge(DEFAULTS, opts || {});
    var cache   = options.cache = {};


    var tagKey         = options.tagKey;
    var styleTagKey    = options.styleTagKey;
fork icon0
star icon0
watch icon0

2
3
4
5
6
7
8
9
10
11
var objectToElement = R.unary(fromObject);
var mapChildren     = R.pipe(
    function (children) {
        return children.
            map(function (child, idx) {
                child.props = R.merge(child.props || {}, { key: idx });
                return child;
            });
    },
    R.map(objectToElement)
fork icon0
star icon0
watch icon0

21
22
23
24
25
26
27
28
29
30
31
32
}


const seleniumSettings = require('./selenium-config');
const servicesToStart = process.env.DOCKER ? [] : ['selenium-standalone'];


exports.config = merge(wdioMaster.config, {
    specs: ['./e2e/specs/accessibility/*.spec.js'],
    exclude: [
    ],
    capabilities: [selectedBrowser()],
fork icon0
star icon0
watch icon0

18
19
20
21
22
23
24
25
26
27
28
const getCollection = (app) => app.free ? gplay.collection.TOP_FREE : gplay.collection.TOP_PAID;
const getGenre = (app) => app.genreId;


function buildStore (defaults) {
  const wrapped = (method) => (opts) => {
    const mergedOpts = R.merge(defaults, opts);
    debug('Calling google-store-scraper', method, JSON.stringify(mergedOpts));
    return gplay[method](mergedOpts);
  };

fork icon0
star icon0
watch icon1

+ 330 other calls in file

Other functions in ramda

Sorted by popularity

function icon

ramda.clone is the most popular function in ramda (30311 examples)