funtypes icon indicating copy to clipboard operation
funtypes copied to clipboard

Better handling of unions of literals/enums

Open ForbesLindesay opened this issue 4 years ago • 1 comments

It would be good to have a Runtype for Enum that could take an existing TypeScript enum and return a type for validating it.

It would also be possible to optimise unions of literals by generating a Set<string | number> up front to allow O(log(n)) lookup instead of linearly traversing the list. It might also be worth adding some form of caching to show.

ForbesLindesay avatar Sep 11 '20 04:09 ForbesLindesay