Only works with TypeScript enums.
Use this to get keys, and values of your enums during run-time.
npm install --save enum-util
import * as enumUtil from "enum-util";
enum Bar {
B = "b",
D = "d",
F = "f"
}
enumUtil.getKeys(Bar); //["B", "D", "F"]
enumUtil.getValues(Bar); //["b", "d", "f"]
enumUtil.extractValues(Bar, ["B", "b", "D", "d", "F", "f"]); //["b", "d", "f"]
Do what you want with this as long as you do no evil.