make getSupportedTypes to copy the structure
antoniomuso opened this issue · comments
We can refactor the getSupportedTypes
method; initially, I make it return the structure without manipulating it for performance reasons. But now, I think it is better to copy the data structure even if there are performance degradations. Because if you modify the returned output, you can break the code.
WDYT! @simonecorsi @dnlup
If you want to avoid external users to modify it you could also freeze it, Types
enum compiles to an object literal
Yes, if the object is not nested freeze
would work in this case 😉
👍