Skip to content

Commit

Permalink
style: merge both filter functions in get-last-release
Browse files Browse the repository at this point in the history
  • Loading branch information
pvdlg committed Nov 27, 2019
1 parent 97748c5 commit e722354
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/get-last-release.js
Expand Up @@ -30,10 +30,10 @@ module.exports = ({branch, options: {tagFormat}}, {before} = {}) => {
const [{version, gitTag, channels} = {}] = branch.tags
.filter(
tag =>
(branch.type === 'prerelease' && tag.channels.some(channel => isSameChannel(branch.channel, channel))) ||
!semver.prerelease(tag.version)
((branch.type === 'prerelease' && tag.channels.some(channel => isSameChannel(branch.channel, channel))) ||
!semver.prerelease(tag.version)) &&
(isUndefined(before) || semver.lt(tag.version, before))
)
.filter(tag => isUndefined(before) || semver.lt(tag.version, before))
.sort((a, b) => semver.rcompare(a.version, b.version));

if (gitTag) {
Expand Down

0 comments on commit e722354

Please sign in to comment.