Created
March 17, 2016 10:35
-
-
Save stormpat/78c619eb07269e7dadc1 to your computer and use it in GitHub Desktop.
Helper functions not deserving a library.
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
// Make it easier to transform an object. | |
const transform = (object, fn) => | |
Object.keys(object).reduce((resulting, key) => | |
Object.assign(resulting, { | |
[key]: fn(object[key]) | |
}), | |
{} | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment