Skip to content

Commit

Permalink
Remove unsed lines
Browse files Browse the repository at this point in the history
  • Loading branch information
allevo committed Jul 23, 2017
1 parent d7442e3 commit 9291352
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
9 changes: 2 additions & 7 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,10 @@ function fastifyAcceptHeader (fastify, options, done) {
fastify.decorateRequest('accepts', acceptsMethod)

methodNames.forEach(methodName => {
fastify.decorateRequest(methodName, function (a, b, c, d) {
fastify.decorateRequest(methodName, function (arr) {
const acceptsObject = this.accepts()
if (arguments.length === 0) return acceptsObject[methodName]()
if (arguments.length === 1) return acceptsObject[methodName](a)
if (arguments.length === 2) return acceptsObject[methodName](a, b)
if (arguments.length === 3) return acceptsObject[methodName](a, b, c)
if (arguments.length === 4) return acceptsObject[methodName](a, b, c, d)

return acceptsObject[methodName].apply(acceptsObject, arguments)
return acceptsObject[methodName](arr)
})
})

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"unit": "tap test.js",
"test": "npm run lint && npm run unit",
"coverage": "tap test.js --cov --coverage-report=text-lcov --coverage-report=html",
"coveralls": "npm run coverage | coveralls"
"coveralls": "tap test.js --cov --coverage-report=text-lcov | coveralls"
},
"repository": {
"type": "git",
Expand Down

0 comments on commit 9291352

Please sign in to comment.