Permalink
Browse files

deal with '+' in version numbers - specifically for Python 2.7.2+

  • Loading branch information...
1 parent e059844 commit 215f98598c37403f0d5612af9616f364d251cc40 @vyclone vyclone committed with isaacs Sep 24, 2012
Showing with 2 additions and 1 deletion.
  1. +1 −1 semver.js
  2. +1 −0 test.js
View
@@ -8,7 +8,7 @@ var semver = "\\s*[v=]*\\s*([0-9]+)" // major
+ "\\.([0-9]+)" // minor
+ "\\.([0-9]+)" // patch
+ "(-[0-9]+-?)?" // build
- + "([a-zA-Z-][a-zA-Z0-9-\.:]*)?" // tag
+ + "([a-zA-Z-+][a-zA-Z0-9-\.:]*)?" // tag
, exprComparator = "^((<|>)?=?)\s*("+semver+")$|^$"
, xRangePlain = "[v=]*([0-9]+|x|X|\\*)"
+ "(?:\\.([0-9]+|x|X|\\*)"
View
@@ -41,6 +41,7 @@ test("\ncomparison tests", function (t) {
, ["1.2.3-5", "1.2.3-5-foo"]
, ["1.2.3-5", "1.2.3-4"]
, ["1.2.3-5-foo", "1.2.3-5-Foo"]
+ , ["3.0.0", "2.7.2+"]
].forEach(function (v) {
var v0 = v[0]
, v1 = v[1]

0 comments on commit 215f985

Please sign in to comment.