These are chat archives for ramda/ramda

22nd
May 2018
Stephen Niemans
@stephenniemans
May 22 2018 13:53
Hey guys, could anyone suggest a more elegant way to do the following with Ramda:
      // --- Input
      // const foo = {
      //   meta_key: 'bar',
      //   meta_value: 'baz'
      // }

      const getKeyValuePairs = (o) => {
        return {
          [o.meta_key]: o.meta_value
        }
      }

      // --- Output
      // { bar: 'baz' }
Rocky Madden
@rockymadden
May 22 2018 17:57
R.converge(R.objOf, [R.prop('meta_key'), R.prop('meta_value')])
Ben Briggs
@ben-eb
May 22 2018 20:52
@ryanolsonx Try R.evolve :)
const parseArgument = R.compose(R.evolve({
  name: parseArgumentName,
  type: parseArgumentType
}), cleanArgument);
Stephen Niemans
@stephenniemans
May 22 2018 21:13
@rockymadden thanks my dude! Exactly what I was trying to think of