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; }); }
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 });
+ 3 other calls in file
GitHub: liangklfangl/wcf
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`
GitHub: liangklfangl/wcf
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`
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)
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,
+ 9 other calls in file
GitHub: raine/flyd-keyboard
![raine profile picture](/raine.png?size=40)
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;
GitHub: leslie555/bsp
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,
GitHub: jolson88/damu
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) {
+ 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);
+ 2 other calls in file
GitHub: brrf/practice-projects
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} */
+ 5 other calls in file
28 29 30 31 32 33 34 35 36 37
displayFilter: "" }, general || {} ); const shortTextCfg = merge( { length: 10 }, shortText || {}
+ 23 other calls in file
GitHub: areca/misc
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);
+ 37 other calls in file
GitHub: dqmmpb/define-demos
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, {
+ 9 other calls in file
GitHub: rolfst/hapi_app
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({
GitHub: evanlh/code2pdf
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 }); }) })); }
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;
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)
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()],
GitHub: asan1010/apk
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); };
+ 330 other calls in file
ramda.clone is the most popular function in ramda (30311 examples)