|
|
|
|
|
by glitchdout
2822 days ago
|
|
It's not that simple because you can reverse lookup a TS enum. So: enum Color { Red = 1, Green = 2 }
would be the same as: var Color = {
Red: 1,
1: 'Red',
Green: 2,
2: 'Green'
}
See for yourself:
https://www.typescriptlang.org/play/#src=enum%20Color%7B%0D%...But I agree with you, it would be quite easy for an automated tool to replace a TS enum with pure JS. |
|