2021-07-14 23:49:18 +03:00
|
|
|
import { next, latest } from './enterprise-server-releases.js'
|
|
|
|
import versionSatisfiesRange from './version-satisfies-range.js'
|
2021-03-22 19:20:27 +03:00
|
|
|
|
|
|
|
// Special handling for frontmatter that evalues to the next GHES release number or a hardcoded `next`:
|
|
|
|
// we don't want to return it as an applicable version or it will become a permalink,
|
|
|
|
// but we also don't want to throw an error if no other versions are found.
|
2021-07-15 00:35:01 +03:00
|
|
|
export default function checkIfNextVersionOnly(value) {
|
2021-03-22 19:20:27 +03:00
|
|
|
if (value === '*') return false
|
|
|
|
|
2021-07-15 00:35:01 +03:00
|
|
|
const ghesNextVersionOnly =
|
|
|
|
versionSatisfiesRange(next, value) && !versionSatisfiesRange(latest, value)
|
2021-03-22 19:20:27 +03:00
|
|
|
|
2021-07-15 00:35:01 +03:00
|
|
|
return ghesNextVersionOnly || value === 'next'
|
2021-03-22 19:20:27 +03:00
|
|
|
}
|