semver 1.1.3 → 1.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/semver.js +3 -1
- package/test.js +3 -0
package/package.json
CHANGED
package/semver.js
CHANGED
|
@@ -15,7 +15,8 @@ var semver = "\\s*[v=]*\\s*([0-9]+)" // major
|
|
|
15
15
|
+ "(?:\\.([0-9]+|x|X|\\*)"
|
|
16
16
|
+ "([a-zA-Z-][a-zA-Z0-9-\.:]*)?)?)?"
|
|
17
17
|
, xRange = "((?:<|>)=?)?\\s*" + xRangePlain
|
|
18
|
-
,
|
|
18
|
+
, exprLoneSpermy = "(?:~>?)"
|
|
19
|
+
, exprSpermy = exprLoneSpermy + xRange
|
|
19
20
|
, expressions = exports.expressions =
|
|
20
21
|
{ parse : new RegExp("^\\s*"+semver+"\\s*$")
|
|
21
22
|
, parsePackage : new RegExp("^\\s*([^\/]+)[-@](" +semver+")\\s*$")
|
|
@@ -97,6 +98,7 @@ function toComparators (range) {
|
|
|
97
98
|
.split("||")
|
|
98
99
|
.map(function (orchunk) {
|
|
99
100
|
return orchunk
|
|
101
|
+
.replace(new RegExp("(" + exprLoneSpermy + ")\\s+"), "$1")
|
|
100
102
|
.split(" ")
|
|
101
103
|
.map(replaceXRanges)
|
|
102
104
|
.map(replaceSpermies)
|
package/test.js
CHANGED
|
@@ -171,6 +171,7 @@ test("\nrange tests", function (t) {
|
|
|
171
171
|
, ["~> 1", "1.2.3"]
|
|
172
172
|
, ["~1.0", "1.0.2"] // >=1.0.0 <1.1.0
|
|
173
173
|
, ["~ 1.0", "1.0.2"]
|
|
174
|
+
, ["~ 1.0.3", "1.0.12"]
|
|
174
175
|
, [">=1", "1.0.0"]
|
|
175
176
|
, [">= 1", "1.0.0"]
|
|
176
177
|
, ["<1.2", "1.1.1"]
|
|
@@ -417,6 +418,8 @@ test("\ncomparators test", function (t) {
|
|
|
417
418
|
, ["~> 1", [[">=1.0.0-", "<2.0.0-"]] ]
|
|
418
419
|
, ["~1.0", [[">=1.0.0-", "<1.1.0-"]] ]
|
|
419
420
|
, ["~ 1.0", [[">=1.0.0-", "<1.1.0-"]] ]
|
|
421
|
+
, ["~ 1.0.3", [[">=1.0.3-", "<1.1.0-"]] ]
|
|
422
|
+
, ["~> 1.0.3", [[">=1.0.3-", "<1.1.0-"]] ]
|
|
420
423
|
, ["<1", [["<1.0.0-"]] ]
|
|
421
424
|
, ["< 1", [["<1.0.0-"]] ]
|
|
422
425
|
, [">=1", [[">=1.0.0-"]] ]
|