Created
January 12, 2017 18:30
-
-
Save gabmontes/e6bf5dccce76843bb278b9e89ac9e19f to your computer and use it in GitHub Desktop.
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
const mapFields = (obj, map) => | |
Object.keys(map) | |
.map(key => ({ key, value: obj[map[key]] })) | |
.reduce((res, { key, value }) => Object.assign(res, { [key]: value }), {}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment