How to use the mergeWithKey function from ramda
Find comprehensive JavaScript ramda.mergeWithKey code examples handpicked from public code repositorys.
GitHub: liangklfangl/wcf
15 16 17 18 19 20 21 22 23 24 25
* @param {[type]} defaultWebpackConfig [description] * @return {[type]} [description] */ function dedupeItem(defaultWebpackConfig,customConfig){ //k represent `key` while `l` is value of first object and `r` of second defaultWebpackConfig = R.mergeWithKey(concatValues, defaultWebpackConfig,customConfig); return defaultWebpackConfig; } module.exports = {
8
15
0
GitHub: liangklfangl/wcf
17 18 19 20 21 22 23 24 25 26 27
* @param {[type]} defaultWebpackConfig [description] * @return {[type]} [description] */ function dedupeItem(defaultWebpackConfig, customConfig) { //k represent `key` while `l` is value of first object and `r` of second defaultWebpackConfig = R.mergeWithKey(concatValues, defaultWebpackConfig, customConfig); return defaultWebpackConfig; } module.exports = {
8
15
0
254 255 256 257 258 259 260 261 262 263
try { return JSON.parse(_fsExtra.default.readFileSync(filepath).toString()); } catch (e) {} }).filter(Boolean).reduce(function (catalog, messages) { return R.mergeWithKey(mergeOriginsAndExtractedComments, catalog, messages); }, {}); }(tmpDir)); case 25:
1
0
0
184 185 186 187 188 189 190 191
return JSON.parse(_fs.default.readFileSync(filepath).toString()); } catch (e) { return {}; } }).filter(Boolean).reduce(function (catalog, messages) { return R.mergeWithKey(mergeMessage, catalog, messages); }, {}); }
1
0
0
3024 3025 3026 3027 3028 3029 3030 3031 3032 3033
* @return {Object} * @see R.merge, R.mergeWith * @example * * let concatValues = (k, l, r) => k == 'values' ? R.concat(l, r) : r * R.mergeWithKey(concatValues, * { a: true, thing: 'foo', values: [10, 20] }, * { b: true, thing: 'bar', values: [15, 35] }); * //=> { a: true, b: true, thing: 'bar', values: [10, 20, 15, 35] } */
0
0
0
+ 17 other calls in file
GitHub: Kolossion/sw-bountygen
9 10 11 12 13 14 15 16 17
const agent = Tables.roll(rng, Tables.listingAgent) newBounty = R.mergeWithKey(concatValues, newBounty, agent) const target = Tables.roll(rng, Tables.bountyTarget[newBounty.category]) newBounty = R.mergeWithKey(concatValues, newBounty, target) const reason = Tables.roll(rng, Tables.bountyReason[newBounty.category]) newBounty = R.mergeWithKey(concatValues, newBounty, reason)
0
0
0
+ 13 other calls in file
19 20 21 22 23 24 25 26 27 28
remove_1.remove, retryAll_1.retryAll, garbageCollector_1.garbageCollector ] }; const config = ramda_1.mergeWithKey((k, l, r) => k === 'extensions' ? [...l, ...r] : r, defaultConfig, initConfig); const hotExtensions = config.extensions.map(e => e(config)); const [protocols, visitors, middlewares] = hotExtensions.reduce((acc, ext) => { if (ReducerProtocol_1.isReducerProtocol(ext)) { acc[0].push(ext);
0
0
0
9995 9996 9997 9998 9999 10000 10001 10002 10003 10004 10005 10006
* let concatValues = (k, l, r) => k == 'values' ? R.concat(l, r) : r * R.mergeWithKey(concatValues, * { a: true, thing: 'foo', values: [10, 20] }, * { b: true, thing: 'bar', values: [15, 35] }); * //=> { a: true, b: true, thing: 'bar', values: [10, 20, 15, 35] } * @symb R.mergeWithKey(f, { x: 1, y: 2 }, { y: 5, z: 3 }) = { x: 1, y: f('y', 2, 5), z: 3 } */ var mergeWithKey =
0
0
2
+ 7 other calls in file
ramda.clone is the most popular function in ramda (30311 examples)