Last active
September 1, 2015 21:06
-
-
Save gre/52c352731ad29d9024b9 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 ENUM = ` | |
BAR | |
FOO | |
WHATEVER | |
`; | |
const enumMap = {}; | |
ENUM.split("\n").forEach(name => enumMap[name] = name); | |
module.exports = enumMap; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Usage example