This is specially useful when using enumStyle is alias.
In this case it is not possible to iterate over all enum items, as they only exist at compilation time.
However, in some particular cases this is useful.
So, the idea is to add a new boolean option enumArray (default false) to generate a ts file next to the enum file, suffixed with -array.ts, which exports a const with all enum items in an array.
This file isn't even included in the model index (models.ts).
This way the overhead on generated code is minimal, and will only include arrays of actually used enums.
This is specially useful when using
enumStyle
isalias
. In this case it is not possible to iterate over all enum items, as they only exist at compilation time. However, in some particular cases this is useful. So, the idea is to add a new boolean optionenumArray
(default false) to generate a ts file next to the enum file, suffixed with-array.ts
, which exports a const with all enum items in an array. This file isn't even included in the model index (models.ts
). This way the overhead on generated code is minimal, and will only include arrays of actually used enums.