semver 5.4.0 → 5.4.1
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 +10 -2
package/package.json
CHANGED
package/semver.js
CHANGED
|
@@ -1153,7 +1153,11 @@ exports.maxSatisfying = maxSatisfying;
|
|
|
1153
1153
|
function maxSatisfying(versions, range, loose) {
|
|
1154
1154
|
var max = null;
|
|
1155
1155
|
var maxSV = null;
|
|
1156
|
-
|
|
1156
|
+
try {
|
|
1157
|
+
var rangeObj = new Range(range, loose);
|
|
1158
|
+
} catch (er) {
|
|
1159
|
+
return null;
|
|
1160
|
+
}
|
|
1157
1161
|
versions.forEach(function (v) {
|
|
1158
1162
|
if (rangeObj.test(v)) { // satisfies(v, range, loose)
|
|
1159
1163
|
if (!max || maxSV.compare(v) === -1) { // compare(max, v, true)
|
|
@@ -1169,7 +1173,11 @@ exports.minSatisfying = minSatisfying;
|
|
|
1169
1173
|
function minSatisfying(versions, range, loose) {
|
|
1170
1174
|
var min = null;
|
|
1171
1175
|
var minSV = null;
|
|
1172
|
-
|
|
1176
|
+
try {
|
|
1177
|
+
var rangeObj = new Range(range, loose);
|
|
1178
|
+
} catch (er) {
|
|
1179
|
+
return null;
|
|
1180
|
+
}
|
|
1173
1181
|
versions.forEach(function (v) {
|
|
1174
1182
|
if (rangeObj.test(v)) { // satisfies(v, range, loose)
|
|
1175
1183
|
if (!min || minSV.compare(v) === 1) { // compare(min, v, true)
|