Skip to content

Instantly share code, notes, and snippets.

@acorcutt
Created September 25, 2017 21:41
Show Gist options
  • Save acorcutt/693801157be80b04f29d4c2b39178f2d to your computer and use it in GitHub Desktop.
Save acorcutt/693801157be80b04f29d4c2b39178f2d to your computer and use it in GitHub Desktop.
Nested transform with ramda
let data = {
title: "Hello ",
address: {
house: "123",
street: "ok"
},
list: [{a:1,b:2}]
}
let transformations = {
title: R.pipe(R.trim,R.concat(R.__,'ok')),
address: {
house: parseFloat
},
list: R.map(R.evolve({a:R.add(1)}))
}
R.evolve(transformations,data)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment