1
0
mirror of synced 2025-12-21 19:06:49 -05:00

be more flexible so we do not rewrite hardcoded deprecated versions OR supported

This commit is contained in:
Sarah Schneider
2021-04-26 16:01:44 -04:00
parent 7feff26f49
commit 7bd169f35c

View File

@@ -50,7 +50,7 @@ function getNewHref (node, languageCode, version) {
// /enterprise-server/rest/reference/oauth-authorizations (this redirects to the latest version)
// /enterprise-server@latest/rest/reference/oauth-authorizations (this redirects to the latest version)
const firstLinkSegment = href.split('/')[1]
if ([...supportedPlans, ...supportedVersions, 'enterprise-server@latest'].includes(firstLinkSegment)) {
if ([...supportedPlans, ...supportedVersions, 'enterprise-server@latest'].some(v => firstLinkSegment.startsWith(v))) {
newHref = path.join('/', languageCode, href)
}