-
-
Notifications
You must be signed in to change notification settings - Fork 21k
Support multiple functions in app.param #2649
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
Conversation
test/app.param.js
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't use req.params as a bag-o-things.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[key].concat(fns)
will inadvertinately allow for the arguments to be arrays, because it'll flatten in certain cases, i.e.:
$ node -pe '[2].concat([1,2])'
[ 2, 1, 2 ]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that is how apply
works. I mean we need an array for apply
to work
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm talking about concat
; you need to use something else that won't flatten the fns
array.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, nvm, I didn't look all the way, sorry!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No problem. (Not related) Is my new test case alright?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Not related) Is my new test case alright?
Yep
c501a05
to
78caf4d
Compare
78caf4d
to
6b01ff8
Compare
5f268a4
to
9848645
Compare
add Gitter link to Readme.md
6b01ff8
to
840ed23
Compare
@dougwilson Is this one still valid? |
From what I can tell, |
So app.param is not being removed in 5.0. In fact, it is being updated to include Promise support. |
Ahh thank you @dougwilson, I see now that this commit was reverted by this later commit. |
eb10dba
to
340be0f
Compare
#2603
A simple change but it might be useful in some cases where we can write shorter code to reuse middleware in
app.param