-
Notifications
You must be signed in to change notification settings - Fork 23
Closed
Description
I've been undecided on how to represent constants in this project. In a pure JS project, I'd write code like this:
const ThresholdSide = {
ABOVE: 'above',
BELOW: 'below',
};
However, since TypeScript provides built-in enums, I've been tempted to use those (and probably have in certain places):
enum ThresholdSide {
ABOVE,
BELOW,
}
My concern is that TS enums desugar to numbers like 0
and 1
, which are meaningless when you log them and non-obvious to JavaScript users.
In the interests of author ergonomics, I need to audit all the uses of enum
and convert them to Dict<string>
where appropriate.