How to use the objOf function from ramda

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

3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
* @return {Object}
* @see R.pair
* @example
*
*      var matchPhrases = R.compose(
*        R.objOf('must'),
*        R.map(R.objOf('match_phrase'))
*      );
*      matchPhrases(['foo', 'bar', 'baz']); //=> {must: [{match_phrase: 'foo'}, {match_phrase: 'bar'}, {match_phrase: 'baz'}]}
*/
fork icon0
star icon0
watch icon0

+ 17 other calls in file

25
26
27
28
29
30
31
32
33
  });

const parseAndSaveFile = R.compose(
  trySavingFile,
  addType,
  R.objOf('path'),
  R.partial(path.resolve, [__dirname]),
  R.concat('../')
);
fork icon0
star icon0
watch icon0

13
14
15
16
17
18
19
20
21
22
    value = val;
    update.call(this, val, stopHere);
};

if (this.notLeaf && hasNameKey(value)) {
    Object.assign(value, R.objOf(tagkey, value[namekey]));
    delete value[namekey];
}

filters.
fork icon0
star icon0
watch icon0

27
28
29
30
31
32
33
34
35
beforeAll(done => {
  converter.fromFile(path.resolve(__dirname, '../../../../run/env/test/seedData/coreDb/tenantAccessPermissions.csv'), (err, data) => {

    FAKE_TENANT_ACCESS_PERMISSION_DATA_WITH_KNOWN_TEST_TENANT_ACCESS_RESOURCE_ID = R.compose(
      R.mergeDeepRight(FAKE_TENANT_ACCESS_PERMISSION_DATA),
      R.objOf('tenantAccessResourceId'),
      R.prop('tenant_access_resource_id'),
      R.head
    )(data);
fork icon0
star icon0
watch icon0

32
33
34
35
36
37
38
39
40
beforeAll(done => {
  converter.fromFile(path.resolve(__dirname, '../../../../run/env/test/seedData/coreDb/agents.csv'), (err, data) => {

    FAKE_AGENT_DATA_WITH_KNOWN_TEST_AGENT_KEY = R.compose(
      R.mergeDeepRight(FAKE_AGENT_DATA),
      R.objOf('key'),
      R.prop('key'),
      R.head
    )(data);
fork icon0
star icon0
watch icon0

30
31
32
33
34
35
36
37
38
39
converter.fromFile(path.resolve(__dirname, '../../../../run/env/test/seedData/coreDb/tenants.csv'), (err, data) => {

  KNOWN_TEST_TENANT_DATA                  = R.compose(R.head, commonMocks.transformDbColsToJsProps)(data);
  KNOWN_TEST_EXISTING_DOMAIN              = R.compose(R.prop('domain'), R.last, commonMocks.transformDbColsToJsProps)(data);
  KNOWN_TEST_TENANT_ID                    = R.prop('id', KNOWN_TEST_TENANT_DATA);
  FAKE_TENANT_UPDATE_DATA_EXISTING_DOMAIN = R.objOf('domain', KNOWN_TEST_EXISTING_DOMAIN);

  updatedTenantData = R.omit(privateFields, R.mergeDeepRight(KNOWN_TEST_TENANT_DATA, FAKE_TENANT_UPDATE_DATA));

  done();
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)