Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 43e0b8c commit 713deb6Copy full SHA for 713deb6
āstatic/pypi_checker.js
@@ -1,4 +1,10 @@
1
function semverCompare(a, b) {
2
+ // Remove leading letters, such as `v` (`v4.23` becomes `4.23`)
3
+ const clean = (v) => v.replace(/^[a-zA-Z]+/, "");
4
+ a = clean(a);
5
+ b = clean(b);
6
+
7
+ // Actual comparison
8
if (a.startsWith(b + "-")) return -1
9
if (b.startsWith(a + "-")) return 1
10
return a.localeCompare(b, undefined, { numeric: true, sensitivity: "case", caseFirst: "upper" })
0 commit comments