Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[REF] Property setting on express request #379

Closed
seaerchin opened this issue Mar 14, 2022 · 0 comments · Fixed by #413
Closed

[REF] Property setting on express request #379

seaerchin opened this issue Mar 14, 2022 · 0 comments · Fixed by #413

Comments

@seaerchin
Copy link
Contributor

Problem

Express request objects are not meant to have properties set on them (req.property = some_value), and the types reflect this (no way to adequately reflect that req has a property set).

Solution

We could adopt either

  1. declaration merging (like so)
  2. set properties on res.locals for all intents identical apart from naming w/ built in support from express.

The suggested solution is to use res.locals as different properties set using declaration merging will all be merged into 1 giant request type, which would be extremely confusing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant