({
project,
targetVersion,
currentVersion,
currentUrlVersion,
currentURL,
currentAnchor,
})
| 141 | } |
| 142 | |
| 143 | export function findEndingRoute({ |
| 144 | project, |
| 145 | targetVersion, |
| 146 | currentVersion, |
| 147 | currentUrlVersion, |
| 148 | currentURL, |
| 149 | currentAnchor, |
| 150 | }) { |
| 151 | let projectVersionID = getCompactVersion(targetVersion); |
| 152 | // if the user is navigating to/from api versions Ember >= 2.16 or Ember Data >= 4.0, take them |
| 153 | // to the home page instead of trying to translate the url |
| 154 | if (shouldGoToVersionIndex(project, targetVersion, currentVersion)) { |
| 155 | return `/${project}/${projectVersionID}`; |
| 156 | } else { |
| 157 | return `${currentURL.replace(currentUrlVersion, projectVersionID)}${currentAnchor}`; |
| 158 | } |
| 159 | } |
| 160 | |
| 161 | function shouldGoToVersionIndex(project, targetVersion, currentVersion) { |
| 162 | let boundaryVersion; |
no test coverage detected