TypeScript has enum flags. Example:
enum Traits {
None = 0,
Friendly = 1 << 0, // 0001 -- the bitshift is unnecessary, but done for consistency
Mean = 1 << 1, // 0010
Funny = 1 << 2, // 0100
Boring = 1 << 3, // 1000
All = ~(~0 << 4) // 1111
}
What is the maximum number you can have in a single enum?
I assume it is either 32 because of 32 bit integers, or something like 53 due to MAX_SAFE_INTEGER.
Which is it? Or is it something else entirely?
If it is indeed more than 32, I assume you will have to generate the numbers using something other than the bit-shifting operator, since I believe that may only work with numbers up to 32 bit?