DEV Community

loading...

req.query (or req.params / req.body) to TypeScript enum

patarapolw profile image Pacharapol Withayasakpunt ・1 min read

I don't get how this is possible. I have always been using 'A' | 'B' | 'C', but this is not enum.

However, I want to map to an ORM that supports enum.

Otherwise, why would you bother using an enum?

Thanks.

Discussion (0)

pic
Editor guide