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

Add shortcuts to Request #6

Merged
merged 7 commits into from
Jul 23, 2017
Merged

Add shortcuts to Request #6

merged 7 commits into from
Jul 23, 2017

Conversation

allevo
Copy link
Member

@allevo allevo commented Jul 22, 2017

See #1

@allevo allevo requested a review from mcollina July 22, 2017 17:53
@allevo allevo added the semver-minor Issue or PR that should land as semver minor label Jul 22, 2017
index.js Outdated
methodNames.forEach(methodName => {
fastify.decorateRequest(methodName, function () {
const acceptsObject = this.accepts()
return acceptsObject[methodName].apply(acceptsObject, arguments)
Copy link
Member

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@coveralls
Copy link

coveralls commented Jul 23, 2017

Coverage Status

Changes Unknown when pulling 9291352 on feature/shortcuts into ** on master**.

3 similar comments
@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 9291352 on feature/shortcuts into ** on master**.

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 9291352 on feature/shortcuts into ** on master**.

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 9291352 on feature/shortcuts into ** on master**.

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@delvedor delvedor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@allevo allevo merged commit f53fd43 into master Jul 23, 2017
@allevo allevo deleted the feature/shortcuts branch July 23, 2017 11:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver-minor Issue or PR that should land as semver minor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants