DEV Community

Discussion on: What is the most challenging thing in Typescript?

Collapse
 
glebirovich profile image
Gleb Irovich

I personally find it very challenging to manage similar interfaces, while using proper naming and accounting for type safety. A good example can be having a GetDto which contains id (and some other fields) vs PostDto which has less field, but in the end describes the same object. What’s your take on that? Any suggestions? Would you use omit with only one interface, optional fields or maintain two separate interfaces ?