Skip to content

Commit ebe6aa3

Browse files
authored
repo sync
2 parents a1bd343 + c940dcd commit ebe6aa3

35 files changed

+91
-80
lines changed

middleware/abort.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module.exports = function (req, res, next) {
1+
module.exports = function abort (req, res, next) {
22
// If the client aborts the connection, send an error
33
req.once('aborted', () => {
44
// NOTE: Node.js will also automatically set `req.aborted = true`

middleware/archived-enterprise-versions-assets.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const ONE_DAY = 24 * 60 * 60 // 1 day in seconds
1111
//
1212
// See also ./archived-enterprise-versions.js for non-CSS/JS paths
1313

14-
module.exports = async (req, res, next) => {
14+
module.exports = async function archivedEnterpriseVersionsAssets (req, res, next) {
1515
const { isArchived, requestedVersion } = isArchivedVersion(req)
1616
if (!isArchived) return next()
1717

middleware/archived-enterprise-versions.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const archivedFrontmatterFallbacks = require('../lib/redirects/static/archived-f
1111
// This module handles requests for deprecated GitHub Enterprise versions
1212
// by routing them to static content in help-docs-archived-enterprise-versions
1313

14-
module.exports = async (req, res, next) => {
14+
module.exports = async function archivedEnterpriseVersions (req, res, next) {
1515
const { isArchived, requestedVersion } = isArchivedVersion(req)
1616
if (!isArchived) return next()
1717

middleware/block-robots.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ function blockIndex (path) {
3030
return pathRegExps.some(pathRe => pathRe.test(path))
3131
}
3232

33-
const middleware = (req, res, next) => {
33+
const middleware = function blockRobots (req, res, next) {
3434
if (blockIndex(req.path)) res.set('x-robots-tag', 'noindex')
3535
return next()
3636
}

middleware/breadcrumbs.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ const { getPathWithoutLanguage } = require('../lib/path-utils')
33
const nonEnterpriseDefaultVersion = require('../lib/non-enterprise-default-version')
44
const removeFPTFromPath = require('../lib/remove-fpt-from-path')
55

6-
module.exports = async (req, res, next) => {
6+
module.exports = async function breadcrumbs (req, res, next) {
77
if (!req.context.page) return next()
88
if (req.context.page.hidden) return next()
99

middleware/categories-for-support-team.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const dotcomDir = path.join(__dirname, '../content/github')
88
const dotcomIndex = path.join(dotcomDir, 'index.md')
99
const linkRegex = /{% (?:topic_)?link_in_list ?\/(.*?) ?%}/g
1010

11-
module.exports = async (req, res, next) => {
11+
module.exports = async function categoriesForSupportTeam (req, res, next) {
1212
if (req.path !== '/categories.json') return next()
1313
const categories = await generateCategories()
1414
return res.json(categories)

middleware/contextualizers/enterprise-release-notes.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ async function renderPatchNotes (patch, ctx) {
6666
return patch
6767
}
6868

69-
module.exports = async (req, res, next) => {
69+
module.exports = async function enterpriseReleaseNotesContext (req, res, next) {
7070
// The `/release-notes` sub-path
7171
if (!req.path.endsWith('/release-notes')) return next()
7272

middleware/contextualizers/graphql.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const explorerUrl = process.env.NODE_ENV === 'production'
88
? 'https://graphql.github.com/explorer'
99
: 'http://localhost:3000'
1010

11-
module.exports = async (req, res, next) => {
11+
module.exports = function graphqlContext (req, res, next) {
1212
const currentVersionObj = allVersions[req.context.currentVersion]
1313
// ignore requests to non-GraphQL reference paths
1414
// and to versions that don't exist

middleware/contextualizers/rest.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ const path = require('path')
22
const rest = require('../../lib/rest')
33
const removeFPTFromPath = require('../../lib/remove-fpt-from-path')
44

5-
module.exports = async function (req, res, next) {
5+
module.exports = function restContext (req, res, next) {
66
req.context.rest = rest
77

88
// link to include in `Works with GitHub Apps` notes

middleware/contextualizers/webhooks.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const webhookPayloads = require(path.join(process.cwd(), 'lib/webhooks'))
44
const nonEnterpriseDefaultVersion = require('../../lib/non-enterprise-default-version')
55
const allVersions = require('../../lib/all-versions')
66

7-
module.exports = async (req, res, next) => {
7+
module.exports = function webhooksContext (req, res, next) {
88
const currentVersionObj = allVersions[req.context.currentVersion]
99
// ignore requests to non-webhook reference paths
1010
// and to versions that don't exist

0 commit comments

Comments
 (0)