How to use the mergeLeft function from ramda

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

265
266
267
268
269
270
271
272
273
274
  firstName: 'Johnny',
  lastName: 'Doe',
  city: 'Toronto'
};

const { uuid, label, ...data } = mergeLeft(body, originalData);

const updatedAt = new Date();

const userAgent = headers['user-agent'];
fork icon49
star icon43
watch icon0

27
28
29
30
31
32
33
34
35
this.answers = await this.prompt(projectNameQ)
const { projectName } = this.answers
this.destinationRoot(path.join(this.contextRoot, `/${projectName}`))

if (this.fs.exists(path.join(this.destinationPath(), `/${YO_RC_FILE}`)))
  this.answers = mergeLeft(this.answers, await this.prompt(usePrevConfigsQ))

this.config.set('__TIMESTAMP__', new Date().toLocaleString())
this.config.set('__VERSION__', await getCurrentVersion())
fork icon8
star icon32
watch icon0

+ 2 other calls in file

26
27
28
29
30
31
32
33
34
35
if (!R.isNil(taggedPkg)) {
    let newPkg = R.mergeDeepRight(taggedPkg, package)
    if (taggedPkg.tags[0] == "exclude" && package.version != taggedPkg.version) {
        console.log("Re-evaluate: " + newPkg.name)
        // Updated excluded packages should come up as new – for re-evaluation
        return R.mergeLeft({ tags: ["uncat/new"] }, newPkg)
    }
    else
        return newPkg
}
fork icon1
star icon0
watch icon0

+ 7 other calls in file

9866
9867
9868
9869
9870
9871
9872
9873
9874
9875
* @param {Object} r
* @return {Object}
* @see R.mergeRight, R.mergeDeepLeft, R.mergeWith, R.mergeWithKey
* @example
*
*      R.mergeLeft({ 'age': 40 }, { 'name': 'fred', 'age': 10 });
*      //=> { 'name': 'fred', 'age': 40 }
*
*      const resetToDefault = R.mergeLeft({x: 0});
*      resetToDefault({x: 5, y: 2}); //=> {x: 0, y: 2}
fork icon0
star icon0
watch icon2

+ 11 other calls in file

72
73
74
75
76
77
78
79
80
81
}
items = R.adjust(
  index,
  R.compose(
    R.assoc('updatedAt', new Date().toISOString()),
    R.mergeLeft(updates)
  ),
  items
);
return items;
fork icon0
star icon0
watch icon0

Other functions in ramda

Sorted by popularity

function icon

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