When using integers as values in a Typescript enum it seems they all turn in to keys. Here's an example:
enum Precision {
ONE = 1,
TWO = 2
}
const keys = Object.keys(Precision)
console.log(keys) //["1", "2", "ONE", "TWO"]
Also if we try to get the values like this:
let v:number[] = Object.keys(Precision).map(key => Precision[key])
console.log(v) //["ONE", "TWO", 1, 2]
Is this a bug? Is it possible to use integer values and get the expected semantics? When using string values the above examples turn out OK. Here's a complete demo: