semver 6.1.1 → 6.1.2
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
|
@@ -810,7 +810,11 @@ Comparator.prototype.test = function (version) {
|
|
|
810
810
|
}
|
|
811
811
|
|
|
812
812
|
if (typeof version === 'string') {
|
|
813
|
-
|
|
813
|
+
try {
|
|
814
|
+
version = new SemVer(version, this.options)
|
|
815
|
+
} catch (er) {
|
|
816
|
+
return false
|
|
817
|
+
}
|
|
814
818
|
}
|
|
815
819
|
|
|
816
820
|
return cmp(version, this.operator, this.semver, this.options)
|
|
@@ -1261,7 +1265,11 @@ Range.prototype.test = function (version) {
|
|
|
1261
1265
|
}
|
|
1262
1266
|
|
|
1263
1267
|
if (typeof version === 'string') {
|
|
1264
|
-
|
|
1268
|
+
try {
|
|
1269
|
+
version = new SemVer(version, this.options)
|
|
1270
|
+
} catch (er) {
|
|
1271
|
+
return false
|
|
1272
|
+
}
|
|
1265
1273
|
}
|
|
1266
1274
|
|
|
1267
1275
|
for (var i = 0; i < this.set.length; i++) {
|