MCPcopy Index your code
hub / github.com/github/docs / getNewVersionFromOldVersion

Function getNewVersionFromOldVersion

lib/old-versions-utils.js:30–34  ·  view source on GitHub ↗
(oldVersion)

Source from the content-addressed store, hash-verified

28// return a new version like enterprise-server@2.21.
29// Fall back to latest GHES version if one can't be found.
30export function getNewVersionFromOldVersion(oldVersion) {
31 return oldVersion === 'dotcom'
32 ? nonEnterpriseDefaultVersion
33 : newVersions.find((newVersion) => newVersion.includes(oldVersion)) || latestNewVersion
34}
35
36// Given an old path like /enterprise/2.21/user/github/category/article,
37// return an old version like 2.21.

Callers 1

getNewVersionedPathFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected