-
-
Notifications
You must be signed in to change notification settings - Fork 9
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
Add shortcuts to Request #6
Conversation
index.js
Outdated
methodNames.forEach(methodName => { | ||
fastify.decorateRequest(methodName, function () { | ||
const acceptsObject = this.accepts() | ||
return acceptsObject[methodName].apply(acceptsObject, arguments) |
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.
leaky arguments is horribly slow in every Node versions released so far. Given that all methods gets very few paramenters, I would actually call the fuction with the parameters directly.
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.
Done
Changes Unknown when pulling 9291352 on feature/shortcuts into ** on master**. |
3 similar comments
Changes Unknown when pulling 9291352 on feature/shortcuts into ** on master**. |
Changes Unknown when pulling 9291352 on feature/shortcuts into ** on master**. |
Changes Unknown when pulling 9291352 on feature/shortcuts into ** on master**. |
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.
LGTM
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.
LGTM
See #1