Avoid func declarations using function keyword (#2813)

We had only a few function expressions declared with the function keyword; almost everything is using function declarations.

This came up after this discussion: https://github.com/badges/shields/pull/2803#discussion_r249011621 though is actually not related ot that example.

What’s being removed is a third option, which is assigning to a variable a function expression using the `function` keyword. There’s still room for the programmer to choose between arrow function expressions and function declarations.
This commit is contained in:
Paul Melnikow
2019-01-21 15:33:43 -05:00
committed by GitHub
parent 18a65fc69c
commit 8dc8afeb55
6 changed files with 16 additions and 17 deletions

View File

@@ -9,7 +9,7 @@ const defaultErrorMessages = {
404: 'not found',
}
const checkErrorResponse = function(badgeData, err, res, errorMessages = {}) {
function checkErrorResponse(badgeData, err, res, errorMessages = {}) {
errorMessages = { ...defaultErrorMessages, ...errorMessages }
if (err != null) {
badgeData.text[1] = 'inaccessible'