(oldPath)
| 36 | // Given an old path like /enterprise/2.21/user/github/category/article, |
| 37 | // return an old version like 2.21. |
| 38 | export function getOldVersionFromOldPath(oldPath) { |
| 39 | // We should never be calling this function on a path that starts with a new version, |
| 40 | // so we can assume the path either uses the old /enterprise format or it's dotcom. |
| 41 | if (!patterns.enterprise.test(oldPath)) return 'dotcom' |
| 42 | |
| 43 | const ghesNumber = oldPath.match(patterns.getEnterpriseVersionNumber) |
| 44 | return ghesNumber ? ghesNumber[1] : latest |
| 45 | } |
| 46 | |
| 47 | // Given an old path like /en/enterprise/2.21/user/github/category/article, |
| 48 | // return a new path like /en/enterprise-server@2.21/github/category/article. |
no outgoing calls
no test coverage detected