MCPcopy
hub / github.com/github/docs / isDeprecatedVersion

Function isDeprecatedVersion

middleware/redirects/handle-redirects.js:193–207  ·  view source on GitHub ↗
(path)

Source from the content-addressed store, hash-verified

191}
192
193function isDeprecatedVersion(path) {
194 // When we rewrote how redirects work, from a lookup model to a
195 // functional model, the enterprise-server releases that got
196 // deprecated since then fall between the cracks. Especially
197 // for custom NextJS page-like pages like /admin/release-notes
198 // These URLs don't come from any remaining .json lookup file
199 // and they're not active pages either (e.g. req.context.pages)
200 const split = path.split('/')
201 for (const version of deprecatedWithFunctionalRedirects) {
202 if (split.includes(`enterprise-server@${version}`)) {
203 return true
204 }
205 }
206 return false
207}

Callers 1

handleRedirectsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected