# 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 utilit... - **Author**: Luca Del Puppo (@puppo92) — AI Native Engineer at Nearform - **Published**: Feb 6, 2021 - **Canonical URL**: https://delpuppo.net/blog/typescript-read-only-object-to-an-enum-type/ - **Category**: typescript - **Tags**: typescript, webdev - **Dev.to Mirror**: https://dev.to/puppo/typescript-read-only-object-to-an-enum-type-359m - **Blog Index LLMs.txt**: https://delpuppo.net/blog/llms.txt --- 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](https://dev-to-uploads.s3.amazonaws.com/i/c0nggq86mb7g1lcj0drh.png) Some examples of use. ![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/34c66ua75zz1vdd4ghlc.png) [Gits URL](https://gist.github.com/Puppo/27f40b59bd3f497e3d1108b07a47678e/revisions)