Hacker News new | ask | show | jobs
by miningape 436 days ago
This is the problem with typescript enums, they're close enough to "normal" enums in other "real" languages that there aren't any hard edges at first glance. Luring you in with a false sense of comfort and familiarity.

Then abstraction starts leaking everywhere because it's trying to bridge between typescript and javascript and you start wishing you had either made an object (pure JS) or a literal union (pure TS).