semver 6.1.2 → 6.1.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/package.json +1 -1
- package/semver.js +9 -4
package/package.json
CHANGED
package/semver.js
CHANGED
|
@@ -1164,10 +1164,14 @@ function replaceXRange (comp, options) {
|
|
|
1164
1164
|
gtlt = ''
|
|
1165
1165
|
}
|
|
1166
1166
|
|
|
1167
|
+
// if we're including prereleases in the match, then we need
|
|
1168
|
+
// to fix this to -0, the lowest possible prerelease value
|
|
1169
|
+
pr = options.includePrerelease ? '-0' : ''
|
|
1170
|
+
|
|
1167
1171
|
if (xM) {
|
|
1168
1172
|
if (gtlt === '>' || gtlt === '<') {
|
|
1169
1173
|
// nothing is allowed
|
|
1170
|
-
ret = '<0.0.0'
|
|
1174
|
+
ret = '<0.0.0-0'
|
|
1171
1175
|
} else {
|
|
1172
1176
|
// nothing is forbidden
|
|
1173
1177
|
ret = '*'
|
|
@@ -1204,11 +1208,12 @@ function replaceXRange (comp, options) {
|
|
|
1204
1208
|
}
|
|
1205
1209
|
}
|
|
1206
1210
|
|
|
1207
|
-
ret = gtlt + M + '.' + m + '.' + p
|
|
1211
|
+
ret = gtlt + M + '.' + m + '.' + p + pr
|
|
1208
1212
|
} else if (xm) {
|
|
1209
|
-
ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
|
|
1213
|
+
ret = '>=' + M + '.0.0' + pr + ' <' + (+M + 1) + '.0.0' + pr
|
|
1210
1214
|
} else if (xp) {
|
|
1211
|
-
ret = '>=' + M + '.' + m + '.0
|
|
1215
|
+
ret = '>=' + M + '.' + m + '.0' + pr +
|
|
1216
|
+
' <' + M + '.' + (+m + 1) + '.0' + pr
|
|
1212
1217
|
}
|
|
1213
1218
|
|
|
1214
1219
|
debug('xRange return', ret)
|