Skip to content

Commit

Permalink
lib: sort affected versions ASC (#831)
Browse files Browse the repository at this point in the history
* fix: sort affected versions ASC

* fixup! fix: sort affected versions ASC

* fixup! fixup! fix: sort affected versions ASC
  • Loading branch information
RafaelGSS authored Jul 16, 2024
1 parent 987aaca commit 09cf7fd
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/security_blog.js
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,12 @@ export default class SecurityBlog {
affectedVersions.add(affectedVersion);
}
}
return Array.from(affectedVersions).join(', ');
const parseToNumber = str => +(str.match(/[\d.]+/g)[0]);
return Array.from(affectedVersions)
.sort((a, b) => {
return parseToNumber(a) > parseToNumber(b) ? -1 : 1;
})
.join(', ');
}

getSecurityPreReleaseTemplate() {
Expand Down

0 comments on commit 09cf7fd

Please sign in to comment.