DEV Community

Luca Del Puppo
Luca Del Puppo

Posted on

Typescript read-only object to an Enum type

Sometimes I need to convert a read-only object to an enum type; so I created a simple function utility that helps me to convert this object to an "enum" type.
This is the code to build the type.
Alt Text
Some examples of use.
Alt Text

Gits URL

Top comments (0)