Skip to content

Commit 3ea9bf0

Browse files
committed
Merge pull request #368 from nodejs/thefourtheye-patch-2
simplify the link selection logic
2 parents 7244bc3 + 2252323 commit 3ea9bf0

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

scripts/helpers/changeloglink.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,8 @@ const semver = require('semver')
55
module.exports = function (version) {
66
if (!version) { return '' }
77

8-
const legacyLink = semver.satisfies(version, '>=1.0.0 <4.0.0')
9-
? `https://github.com/nodejs/node/blob/${version}/CHANGELOG.md`
10-
: `https://github.com/nodejs/node-v0.x-archive/blob/${version}/ChangeLog`
8+
if (semver.satisfies(version, '>= 1.0.0'))
9+
return `https://github.com/nodejs/node/blob/${version}/CHANGELOG.md`
1110

12-
return semver.gte(version, '4.0.0')
13-
? `https://github.com/nodejs/node/blob/${version}/CHANGELOG.md`
14-
: legacyLink
11+
return `https://github.com/nodejs/node-v0.x-archive/blob/${version}/ChangeLog`
1512
}

0 commit comments

Comments
 (0)