Created
September 25, 2017 21:41
-
-
Save acorcutt/693801157be80b04f29d4c2b39178f2d to your computer and use it in GitHub Desktop.
Nested transform with ramda
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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