Last active
December 18, 2017 11:10
-
-
Save nicohvi/a27f1d5b1856ad2a56e366ffc07a3cf8 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
const dict = { 'Roger': { value: 'verdi', validationFn: f1 }, 'Ted': { value: 'verdi', validationFn: f2 } }; | |
R.keys(dict) | |
.map(key => { | |
const old = dict[key]; | |
return { key: { value: R.prop('value', old), isValid: R.prop('validationFn', old).apply(null, old) } }; | |
}) | |
.reduce((acc, item) => acc[R.prop('key', item] = item, {}) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment