compare-versions
Advanced tools
Comparing version 3.0.0 to 3.0.1
{ | ||
"name": "compare-versions", | ||
"version": "3.0.0", | ||
"version": "3.0.1", | ||
"description": "Compare semver version strings to find greater, equal or lesser.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -17,3 +17,3 @@ /* global define */ | ||
function split(v) { | ||
var temp = v.split('.'); | ||
var temp = v.replace(/^v/, '').split('.'); | ||
var arr = temp.splice(0, 2); | ||
@@ -20,0 +20,0 @@ arr.push(temp.join('.')); |
{ | ||
"name": "compare-versions", | ||
"version": "3.0.0", | ||
"version": "3.0.1", | ||
"description": "Compare semver version strings to find greater, equal or lesser.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -8,3 +8,3 @@ # compare-versions | ||
This library supports the full semver specification, including comparing versions with different number of digits like `1.0.0`, `1.0`, `1`, and pre-release versions like `1.0.0-alpha`. Also supports wildcards for minor and patch version like `1.0.x` or `1.0.*`. | ||
This library supports the full semver specification, including comparing versions with different number of digits like `1.0.0`, `1.0`, `1`, and pre-release versions like `1.0.0-alpha`. Also supports wildcards for minor and patch version like `1.0.x` or `1.0.*`. Any leading `v` is ignored. | ||
@@ -11,0 +11,0 @@ ## Install |
@@ -66,2 +66,9 @@ var assert = require('assert'); | ||
it('should ignore leading `v`', function () { | ||
assert.equal(compare('v1.0.0', '1.0.0'), 0); | ||
assert.equal(compare('v1.0.0', 'v1.0.0'), 0); | ||
assert.equal(compare('v1.0.0', 'v1.0.0'), 0); | ||
assert.equal(compare('v1.0.0-alpha', '1.0.0-alpha'), 0); | ||
}); | ||
it('should throw on invalid input', function () { | ||
@@ -68,0 +75,0 @@ [ |
@@ -48,3 +48,4 @@ var assert = require('assert'); | ||
['3.2.1', '3.2.0'], | ||
['v0.5.4-pre', '0.5.4-alpha'] | ||
['v0.5.4-pre', '0.5.4-alpha'], | ||
['v3.2.1', 'v2.3.2'] | ||
].forEach(function (tuple) { | ||
@@ -51,0 +52,0 @@ var v1 = tuple[0]; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
13608
12
267