MCPcopy Create free account
hub / github.com/github/docs / getOldVersionFromNewVersion

Function getOldVersionFromNewVersion

lib/old-versions-utils.js:21–25  ·  view source on GitHub ↗
(newVersion)

Source from the content-addressed store, hash-verified

19// Fall back to latest GHES version if one can't be found,
20// for example, if the new version is private-instances@latest.
21export function getOldVersionFromNewVersion(newVersion) {
22 return newVersion === nonEnterpriseDefaultVersion
23 ? 'dotcom'
24 : oldVersions.find((oldVersion) => newVersion.includes(oldVersion)) || latest
25}
26
27// Given an old version like 2.21,
28// return a new version like enterprise-server@2.21.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected