Skip to content

Commit

Permalink
fix version rules having extraneous >=0
Browse files Browse the repository at this point in the history
  • Loading branch information
haarg committed Sep 14, 2024
1 parent 6bd62b3 commit 61a3fc9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/cpan-versions.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ export const simpleVersion = (version) => {
};

export const mergeVersions = (versionList) => {
const versions = versionList.map(v => v.split(/\s*,\s*/)).flat();
return versions
const versions = versionList.map(v => v.split(/\s*,\s*/)).flat()
.filter((value, index, array) => array.indexOf(value) === index)
.join(',');
.filter(v => v !== '>=0');
return versions.length ? versions.join(',') : '>=0';
};

export const cpanmVersion = (version) => {
Expand Down
4 changes: 2 additions & 2 deletions test/get-prereqs.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ describe('getPrereqs', function () {
'Dist::Zilla::Plugin::GatherFile': '>=0',
'Dist::Zilla::Plugin::Git::GatherDir': '>=5',
'Dist::Zilla::Plugin::PodWeaver': '>=0',
'Dist::Zilla::PluginBundle::Basic': '>=0,>=6',
'Dist::Zilla::PluginBundle::Basic': '>=6',
'Dist::Zilla::PluginBundle::ConfigSlicer': '>=0',
'Dist::Zilla::PluginBundle::Filter': '>=2',
'Dist::Zilla::PluginBundle::Git::VersionManager': '>=0',
Expand All @@ -84,7 +84,7 @@ describe('getPrereqs', function () {
'Dist::Zilla::Plugin::GatherFile': '>=0',
'Dist::Zilla::Plugin::Git::GatherDir': '>=5',
'Dist::Zilla::Plugin::PodWeaver': '>=0',
'Dist::Zilla::PluginBundle::Basic': '>=0,>=6',
'Dist::Zilla::PluginBundle::Basic': '>=6',
'Dist::Zilla::PluginBundle::ConfigSlicer': '>=0',
'Dist::Zilla::PluginBundle::Filter': '>=2',
'Dist::Zilla::PluginBundle::Git::VersionManager': '>=0',
Expand Down

0 comments on commit 61a3fc9

Please sign in to comment.