MCPcopy
hub / github.com/github/docs / features

Function features

middleware/contextualizers/features.js:7–17  ·  view source on GitHub ↗
(req, res, next)

Source from the content-addressed store, hash-verified

5import { getDeepDataByLanguage } from '../../lib/get-data.js'
6
7export default function features(req, res, next) {
8 if (!req.context.page) return next()
9
10 Object.entries(getFeaturesByVersion(req.context.currentVersion)).forEach(
11 ([featureName, isFeatureAvailableInCurrentVersion]) => {
12 req.context[featureName] = isFeatureAvailableInCurrentVersion
13 }
14 )
15
16 return next()
17}
18
19let allFeatures
20

Callers

nothing calls this directly

Calls 2

getFeaturesByVersionFunction · 0.85
nextFunction · 0.50

Tested by

no test coverage detected