Skip to content

Instantly share code, notes, and snippets.

@gre
Last active September 1, 2015 21:06

Revisions

  1. gre revised this gist Aug 12, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion constants.js
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,7 @@

    const ENUM = `
    FOO
    BAR
    FOO
    WHATEVER
    `;

  2. gre created this gist Aug 12, 2015.
    10 changes: 10 additions & 0 deletions constants.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,10 @@

    const ENUM = `
    FOO
    BAR
    WHATEVER
    `;

    const enumMap = {};
    ENUM.split("\n").forEach(name => enumMap[name] = name);
    module.exports = enumMap;