proposal-enum
proposal-enum copied to clipboard
Compare to Flow runtime?
Flow has different methods helpful for enum usage: https://flow.org/en/docs/enums/using-enums/#toc-methods
- cast
- isValid
It will be wonderful to include some helpers with strict type safety in TS:
v = SomeEnum.cast(raw) // v type inference: SomeEnum | null
Yes, it's a useful feature but I'm worried about how ADT enums will work with those mehods.