semver 7.2.2 → 7.2.3
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/classes/range.js +11 -7
- package/package.json +2 -2
package/classes/range.js
CHANGED
|
@@ -68,7 +68,7 @@ class Range {
|
|
|
68
68
|
range = range.trim()
|
|
69
69
|
// `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`
|
|
70
70
|
const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE]
|
|
71
|
-
range = range.replace(hr, hyphenReplace)
|
|
71
|
+
range = range.replace(hr, hyphenReplace(this.options.includePrerelease))
|
|
72
72
|
debug('hyphen replace', range)
|
|
73
73
|
// `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`
|
|
74
74
|
range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace)
|
|
@@ -384,27 +384,31 @@ const replaceStars = (comp, options) => {
|
|
|
384
384
|
// 1.2 - 3.4.5 => >=1.2.0 <=3.4.5
|
|
385
385
|
// 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do
|
|
386
386
|
// 1.2 - 3.4 => >=1.2.0 <3.5.0
|
|
387
|
-
const hyphenReplace = ($0,
|
|
387
|
+
const hyphenReplace = incPr => ($0,
|
|
388
388
|
from, fM, fm, fp, fpr, fb,
|
|
389
389
|
to, tM, tm, tp, tpr, tb) => {
|
|
390
390
|
if (isX(fM)) {
|
|
391
391
|
from = ''
|
|
392
392
|
} else if (isX(fm)) {
|
|
393
|
-
from = `>=${fM}.0.0`
|
|
393
|
+
from = `>=${fM}.0.0${incPr ? '-0' : ''}`
|
|
394
394
|
} else if (isX(fp)) {
|
|
395
|
-
from = `>=${fM}.${fm}.0`
|
|
396
|
-
} else {
|
|
395
|
+
from = `>=${fM}.${fm}.0${incPr ? '-0' : ''}`
|
|
396
|
+
} else if (fpr) {
|
|
397
397
|
from = `>=${from}`
|
|
398
|
+
} else {
|
|
399
|
+
from = `>=${from}${incPr ? '-0' : ''}`
|
|
398
400
|
}
|
|
399
401
|
|
|
400
402
|
if (isX(tM)) {
|
|
401
403
|
to = ''
|
|
402
404
|
} else if (isX(tm)) {
|
|
403
|
-
to = `<${+tM + 1}.0.0`
|
|
405
|
+
to = `<${+tM + 1}.0.0${incPr ? '-0' : ''}`
|
|
404
406
|
} else if (isX(tp)) {
|
|
405
|
-
to = `<${tM}.${+tm + 1}.0`
|
|
407
|
+
to = `<${tM}.${+tm + 1}.0${incPr ? '-0' : ''}`
|
|
406
408
|
} else if (tpr) {
|
|
407
409
|
to = `<=${tM}.${tm}.${tp}-${tpr}`
|
|
410
|
+
} else if (incPr) {
|
|
411
|
+
to = `<${tM}.${tm}.${+tp + 1}-0`
|
|
408
412
|
} else {
|
|
409
413
|
to = `<=${to}`
|
|
410
414
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "semver",
|
|
3
|
-
"version": "7.2.
|
|
3
|
+
"version": "7.2.3",
|
|
4
4
|
"description": "The semantic version parser used by npm.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"postpublish": "git push origin --follow-tags"
|
|
12
12
|
},
|
|
13
13
|
"devDependencies": {
|
|
14
|
-
"tap": "^14.10.
|
|
14
|
+
"tap": "^14.10.7"
|
|
15
15
|
},
|
|
16
16
|
"license": "ISC",
|
|
17
17
|
"repository": "https://github.com/npm/node-semver",
|