slaytheweb
slaytheweb copied to clipboard
Enums
Throughout the codebase we have several enums. Issue is that they aren't technically enums so there could easily be typos and errors around.
Since this project has the dogma of no compilatio we can't (won't) use typescript, here's some inspiration:
- https://www.typescriptlang.org/docs/handbook/enums.html
- https://2ality.com/2020/02/enum-alternatives-typescript.html
- https://2ality.com/2020/01/enum-pattern.html
- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/freeze
- https://stackoverflow.com/questions/287903/how-can-i-guarantee-that-my-enums-definition-doesnt-change-in-javascript