DEV Community

Discussion on: Extend Express's Request Object with Typescript Declaration Merging.

Collapse
 
alphakennybudy profile image
Adil • Edited

Thank you, it helped. But as far as I understood, it adds currentUser field to all Requests? What if I want it to be present only in the current file and not declared in the other files where I use Request?

Collapse
 
lucamartins profile image
Luca S. Martins

You could declare currentUser as optional and use it when needed