Use a Set
on primitive type unions to verify if they are valid
#1054
Labels
Projects
Set
on primitive type unions to verify if they are valid
#1054
Feature Request
Imagine a type for example a type called
Alpha3Code
which contains an union of strings of all valid ISO 3166-1 alpha-3.The validation currently would just generate a comparison check for each primitive by doing a lot of logical ORs like this:
But
typia
could generate aSet
based on all the types and simply doset.has(input.country)
instead which would be much more optimized.The text was updated successfully, but these errors were encountered: