Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

semver@1.1.0

  • Loading branch information...
commit 362fc6272791b9b7d7976d523e24ee5c40470a9a 1 parent f23ff1d
@isaacs isaacs authored
View
20 node_modules/semver/package.json
@@ -1,6 +1,6 @@
{
"name": "semver",
- "version": "1.0.14",
+ "version": "1.1.0",
"description": "The semantic version parser used by npm.",
"main": "semver.js",
"scripts": {
@@ -20,19 +20,7 @@
"bin": {
"semver": "./bin/semver"
},
- "_npmUser": {
- "name": "isaacs",
- "email": "i@izs.me"
- },
- "_id": "semver@1.0.14",
- "dependencies": {},
- "optionalDependencies": {},
- "engines": {
- "node": "*"
- },
- "_engineSupported": true,
- "_npmVersion": "1.1.22",
- "_nodeVersion": "v0.7.9",
- "_defaultsLoaded": true,
- "_from": "semver@1"
+ "readme": "semver(1) -- The semantic versioner for npm\n===========================================\n\n## Usage\n\n $ npm install semver\n\n semver.valid('1.2.3') // true\n semver.valid('a.b.c') // false\n semver.clean(' =v1.2.3 ') // '1.2.3'\n semver.satisfies('1.2.3', '1.x || >=2.5.0 || 5.0.0 - 7.2.3') // true\n semver.gt('1.2.3', '9.8.7') // false\n semver.lt('1.2.3', '9.8.7') // true\n\nAs a command-line utility:\n\n $ semver -h\n\n Usage: semver -v <version> [-r <range>]\n Test if version(s) satisfy the supplied range(s),\n and sort them.\n\n Multiple versions or ranges may be supplied.\n\n Program exits successfully if any valid version satisfies\n all supplied ranges, and prints all satisfying versions.\n\n If no versions are valid, or ranges are not satisfied,\n then exits failure.\n\n Versions are printed in ascending order, so supplying\n multiple versions to the utility will just sort them.\n\n## Versions\n\nA version is the following things, in this order:\n\n* a number (Major)\n* a period\n* a number (minor)\n* a period\n* a number (patch)\n* OPTIONAL: a hyphen, followed by a number (build)\n* OPTIONAL: a collection of pretty much any non-whitespace characters\n (tag)\n\nA leading `\"=\"` or `\"v\"` character is stripped off and ignored.\n\n## Comparisons\n\nThe ordering of versions is done using the following algorithm, given\ntwo versions and asked to find the greater of the two:\n\n* If the majors are numerically different, then take the one\n with a bigger major number. `2.3.4 > 1.3.4`\n* If the minors are numerically different, then take the one\n with the bigger minor number. `2.3.4 > 2.2.4`\n* If the patches are numerically different, then take the one with the\n bigger patch number. `2.3.4 > 2.3.3`\n* If only one of them has a build number, then take the one with the\n build number. `2.3.4-0 > 2.3.4`\n* If they both have build numbers, and the build numbers are numerically\n different, then take the one with the bigger build number.\n `2.3.4-10 > 2.3.4-9`\n* If only one of them has a tag, then take the one without the tag.\n `2.3.4 > 2.3.4-beta`\n* If they both have tags, then take the one with the lexicographically\n larger tag. `2.3.4-beta > 2.3.4-alpha`\n* At this point, they're equal.\n\n## Ranges\n\nThe following range styles are supported:\n\n* `>1.2.3` Greater than a specific version.\n* `<1.2.3` Less than\n* `1.2.3 - 2.3.4` := `>=1.2.3 <=2.3.4`\n* `~1.2.3` := `>=1.2.3 <1.3.0`\n* `~1.2` := `>=1.2.0 <2.0.0`\n* `~1` := `>=1.0.0 <2.0.0`\n* `1.2.x` := `>=1.2.0 <1.3.0`\n* `1.x` := `>=1.0.0 <2.0.0`\n\nRanges can be joined with either a space (which implies \"and\") or a\n`||` (which implies \"or\").\n\n## Functions\n\n* valid(v): Return the parsed version, or null if it's not valid.\n* inc(v, release): Return the version incremented by the release type\n (major, minor, patch, or build), or null if it's not valid.\n\n### Comparison\n\n* gt(v1, v2): `v1 > v2`\n* gte(v1, v2): `v1 >= v2`\n* lt(v1, v2): `v1 < v2`\n* lte(v1, v2): `v1 <= v2`\n* eq(v1, v2): `v1 == v2` This is true if they're logically equivalent,\n even if they're not the exact same string. You already know how to\n compare strings.\n* neq(v1, v2): `v1 != v2` The opposite of eq.\n* cmp(v1, comparator, v2): Pass in a comparison string, and it'll call\n the corresponding function above. `\"===\"` and `\"!==\"` do simple\n string comparison, but are included for completeness. Throws if an\n invalid comparison string is provided.\n* compare(v1, v2): Return 0 if v1 == v2, or 1 if v1 is greater, or -1 if\n v2 is greater. Sorts in ascending order if passed to Array.sort().\n* rcompare(v1, v2): The reverse of compare. Sorts an array of versions\n in descending order when passed to Array.sort().\n\n\n### Ranges\n\n* validRange(range): Return the valid range or null if it's not valid\n* satisfies(version, range): Return true if the version satisfies the\n range.\n* maxSatisfying(versions, range): Return the highest version in the list\n that satisfies the range, or null if none of them do.\n",
+ "_id": "semver@1.1.0",
+ "_from": "semver@latest"
}
View
4 node_modules/semver/semver.js
@@ -4,11 +4,11 @@
// This implementation is a *hair* less strict in that it allows
// v1.2.3 things, and also tags that don't begin with a char.
-var semver = "\\s*[v=]*\\s*([0-9]+)" // major
+var semver = "\\s*[v=]*\\s*([0-9]+)" // major
+ "\\.([0-9]+)" // minor
+ "\\.([0-9]+)" // patch
+ "(-[0-9]+-?)?" // build
- + "([a-zA-Z-][a-zA-Z0-9-\.:]*)?" // tag
+ + "([a-zA-Z-+][a-zA-Z0-9-\.:]*)?" // tag
, exprComparator = "^((<|>)?=?)\s*("+semver+")$|^$"
, xRangePlain = "[v=]*([0-9]+|x|X|\\*)"
+ "(?:\\.([0-9]+|x|X|\\*)"
View
406 node_modules/semver/test.js
@@ -0,0 +1,406 @@
+var tap = require("tap")
+ , test = tap.test
+ , semver = require("./semver.js")
+ , eq = semver.eq
+ , gt = semver.gt
+ , lt = semver.lt
+ , neq = semver.neq
+ , cmp = semver.cmp
+ , gte = semver.gte
+ , lte = semver.lte
+ , satisfies = semver.satisfies
+ , validRange = semver.validRange
+ , inc = semver.inc
+ , replaceStars = semver.replaceStars
+ , toComparators = semver.toComparators
+
+tap.plan(8)
+
+test("\ncomparison tests", function (t) {
+; [ ["0.0.0", "0.0.0foo"]
+ , ["0.0.1", "0.0.0"]
+ , ["1.0.0", "0.9.9"]
+ , ["0.10.0", "0.9.0"]
+ , ["0.99.0", "0.10.0"]
+ , ["2.0.0", "1.2.3"]
+ , ["v0.0.0", "0.0.0foo"]
+ , ["v0.0.1", "0.0.0"]
+ , ["v1.0.0", "0.9.9"]
+ , ["v0.10.0", "0.9.0"]
+ , ["v0.99.0", "0.10.0"]
+ , ["v2.0.0", "1.2.3"]
+ , ["0.0.0", "v0.0.0foo"]
+ , ["0.0.1", "v0.0.0"]
+ , ["1.0.0", "v0.9.9"]
+ , ["0.10.0", "v0.9.0"]
+ , ["0.99.0", "v0.10.0"]
+ , ["2.0.0", "v1.2.3"]
+ , ["1.2.3", "1.2.3-asdf"]
+ , ["1.2.3-4", "1.2.3"]
+ , ["1.2.3-4-foo", "1.2.3"]
+ , ["1.2.3-5", "1.2.3-5-foo"]
+ , ["1.2.3-5", "1.2.3-4"]
+ , ["1.2.3-5-foo", "1.2.3-5-Foo"]
+ , ["3.0.0", "2.7.2+"]
+ ].forEach(function (v) {
+ var v0 = v[0]
+ , v1 = v[1]
+ t.ok(gt(v0, v1), "gt('"+v0+"', '"+v1+"')")
+ t.ok(lt(v1, v0), "lt('"+v1+"', '"+v0+"')")
+ t.ok(!gt(v1, v0), "!gt('"+v1+"', '"+v0+"')")
+ t.ok(!lt(v0, v1), "!lt('"+v0+"', '"+v1+"')")
+ t.ok(eq(v0, v0), "eq('"+v0+"', '"+v0+"')")
+ t.ok(eq(v1, v1), "eq('"+v1+"', '"+v1+"')")
+ t.ok(neq(v0, v1), "neq('"+v0+"', '"+v1+"')")
+ t.ok(cmp(v1, "==", v1), "cmp('"+v1+"' == '"+v1+"')")
+ t.ok(cmp(v0, ">=", v1), "cmp('"+v0+"' >= '"+v1+"')")
+ t.ok(cmp(v1, "<=", v0), "cmp('"+v1+"' <= '"+v0+"')")
+ t.ok(cmp(v0, "!=", v1), "cmp('"+v0+"' != '"+v1+"')")
+ })
+ t.end()
+})
+
+test("\nequality tests", function (t) {
+; [ ["1.2.3", "v1.2.3"]
+ , ["1.2.3", "=1.2.3"]
+ , ["1.2.3", "v 1.2.3"]
+ , ["1.2.3", "= 1.2.3"]
+ , ["1.2.3", " v1.2.3"]
+ , ["1.2.3", " =1.2.3"]
+ , ["1.2.3", " v 1.2.3"]
+ , ["1.2.3", " = 1.2.3"]
+ , ["1.2.3-0", "v1.2.3-0"]
+ , ["1.2.3-0", "=1.2.3-0"]
+ , ["1.2.3-0", "v 1.2.3-0"]
+ , ["1.2.3-0", "= 1.2.3-0"]
+ , ["1.2.3-0", " v1.2.3-0"]
+ , ["1.2.3-0", " =1.2.3-0"]
+ , ["1.2.3-0", " v 1.2.3-0"]
+ , ["1.2.3-0", " = 1.2.3-0"]
+ , ["1.2.3-01", "v1.2.3-1"]
+ , ["1.2.3-01", "=1.2.3-1"]
+ , ["1.2.3-01", "v 1.2.3-1"]
+ , ["1.2.3-01", "= 1.2.3-1"]
+ , ["1.2.3-01", " v1.2.3-1"]
+ , ["1.2.3-01", " =1.2.3-1"]
+ , ["1.2.3-01", " v 1.2.3-1"]
+ , ["1.2.3-01", " = 1.2.3-1"]
+ , ["1.2.3beta", "v1.2.3beta"]
+ , ["1.2.3beta", "=1.2.3beta"]
+ , ["1.2.3beta", "v 1.2.3beta"]
+ , ["1.2.3beta", "= 1.2.3beta"]
+ , ["1.2.3beta", " v1.2.3beta"]
+ , ["1.2.3beta", " =1.2.3beta"]
+ , ["1.2.3beta", " v 1.2.3beta"]
+ , ["1.2.3beta", " = 1.2.3beta"]
+ ].forEach(function (v) {
+ var v0 = v[0]
+ , v1 = v[1]
+ t.ok(eq(v0, v1), "eq('"+v0+"', '"+v1+"')")
+ t.ok(!neq(v0, v1), "!neq('"+v0+"', '"+v1+"')")
+ t.ok(cmp(v0, "==", v1), "cmp("+v0+"=="+v1+")")
+ t.ok(!cmp(v0, "!=", v1), "!cmp("+v0+"!="+v1+")")
+ t.ok(!cmp(v0, "===", v1), "!cmp("+v0+"==="+v1+")")
+ t.ok(cmp(v0, "!==", v1), "cmp("+v0+"!=="+v1+")")
+ t.ok(!gt(v0, v1), "!gt('"+v0+"', '"+v1+"')")
+ t.ok(gte(v0, v1), "gte('"+v0+"', '"+v1+"')")
+ t.ok(!lt(v0, v1), "!lt('"+v0+"', '"+v1+"')")
+ t.ok(lte(v0, v1), "lte('"+v0+"', '"+v1+"')")
+ })
+ t.end()
+})
+
+
+test("\nrange tests", function (t) {
+; [ ["1.0.0 - 2.0.0", "1.2.3"]
+ , ["1.0.0", "1.0.0"]
+ , [">=*", "0.2.4"]
+ , ["", "1.0.0"]
+ , ["*", "1.2.3"]
+ , ["*", "v1.2.3-foo"]
+ , [">=1.0.0", "1.0.0"]
+ , [">=1.0.0", "1.0.1"]
+ , [">=1.0.0", "1.1.0"]
+ , [">1.0.0", "1.0.1"]
+ , [">1.0.0", "1.1.0"]
+ , ["<=2.0.0", "2.0.0"]
+ , ["<=2.0.0", "1.9999.9999"]
+ , ["<=2.0.0", "0.2.9"]
+ , ["<2.0.0", "1.9999.9999"]
+ , ["<2.0.0", "0.2.9"]
+ , [">= 1.0.0", "1.0.0"]
+ , [">= 1.0.0", "1.0.1"]
+ , [">= 1.0.0", "1.1.0"]
+ , ["> 1.0.0", "1.0.1"]
+ , ["> 1.0.0", "1.1.0"]
+ , ["<= 2.0.0", "2.0.0"]
+ , ["<= 2.0.0", "1.9999.9999"]
+ , ["<= 2.0.0", "0.2.9"]
+ , ["< 2.0.0", "1.9999.9999"]
+ , ["<\t2.0.0", "0.2.9"]
+ , [">=0.1.97", "v0.1.97"]
+ , [">=0.1.97", "0.1.97"]
+ , ["0.1.20 || 1.2.4", "1.2.4"]
+ , [">=0.2.3 || <0.0.1", "0.0.0"]
+ , [">=0.2.3 || <0.0.1", "0.2.3"]
+ , [">=0.2.3 || <0.0.1", "0.2.4"]
+ , ["||", "1.3.4"]
+ , ["2.x.x", "2.1.3"]
+ , ["1.2.x", "1.2.3"]
+ , ["1.2.x || 2.x", "2.1.3"]
+ , ["1.2.x || 2.x", "1.2.3"]
+ , ["x", "1.2.3"]
+ , ["2.*.*", "2.1.3"]
+ , ["1.2.*", "1.2.3"]
+ , ["1.2.* || 2.*", "2.1.3"]
+ , ["1.2.* || 2.*", "1.2.3"]
+ , ["*", "1.2.3"]
+ , ["2", "2.1.2"]
+ , ["2.3", "2.3.1"]
+ , ["~2.4", "2.4.0"] // >=2.4.0 <2.5.0
+ , ["~2.4", "2.4.5"]
+ , ["~>3.2.1", "3.2.2"] // >=3.2.1 <3.3.0
+ , ["~1", "1.2.3"] // >=1.0.0 <2.0.0
+ , ["~>1", "1.2.3"]
+ , ["~> 1", "1.2.3"]
+ , ["~1.0", "1.0.2"] // >=1.0.0 <1.1.0
+ , ["~ 1.0", "1.0.2"]
+ , [">=1", "1.0.0"]
+ , [">= 1", "1.0.0"]
+ , ["<1.2", "1.1.1"]
+ , ["< 1.2", "1.1.1"]
+ , ["1", "1.0.0beta"]
+ , ["~v0.5.4-pre", "0.5.5"]
+ , ["~v0.5.4-pre", "0.5.4"]
+ , ["=0.7.x", "0.7.2"]
+ , [">=0.7.x", "0.7.2"]
+ , ["=0.7.x", "0.7.0-asdf"]
+ , [">=0.7.x", "0.7.0-asdf"]
+ , ["<=0.7.x", "0.6.2"]
+ ].forEach(function (v) {
+ t.ok(satisfies(v[1], v[0]), v[0]+" satisfied by "+v[1])
+ })
+ t.end()
+})
+
+test("\nnegative range tests", function (t) {
+; [ ["1.0.0 - 2.0.0", "2.2.3"]
+ , ["1.0.0", "1.0.1"]
+ , [">=1.0.0", "0.0.0"]
+ , [">=1.0.0", "0.0.1"]
+ , [">=1.0.0", "0.1.0"]
+ , [">1.0.0", "0.0.1"]
+ , [">1.0.0", "0.1.0"]
+ , ["<=2.0.0", "3.0.0"]
+ , ["<=2.0.0", "2.9999.9999"]
+ , ["<=2.0.0", "2.2.9"]
+ , ["<2.0.0", "2.9999.9999"]
+ , ["<2.0.0", "2.2.9"]
+ , [">=0.1.97", "v0.1.93"]
+ , [">=0.1.97", "0.1.93"]
+ , ["0.1.20 || 1.2.4", "1.2.3"]
+ , [">=0.2.3 || <0.0.1", "0.0.3"]
+ , [">=0.2.3 || <0.0.1", "0.2.2"]
+ , ["2.x.x", "1.1.3"]
+ , ["2.x.x", "3.1.3"]
+ , ["1.2.x", "1.3.3"]
+ , ["1.2.x || 2.x", "3.1.3"]
+ , ["1.2.x || 2.x", "1.1.3"]
+ , ["2.*.*", "1.1.3"]
+ , ["2.*.*", "3.1.3"]
+ , ["1.2.*", "1.3.3"]
+ , ["1.2.* || 2.*", "3.1.3"]
+ , ["1.2.* || 2.*", "1.1.3"]
+ , ["2", "1.1.2"]
+ , ["2.3", "2.4.1"]
+ , ["~2.4", "2.5.0"] // >=2.4.0 <2.5.0
+ , ["~2.4", "2.3.9"]
+ , ["~>3.2.1", "3.3.2"] // >=3.2.1 <3.3.0
+ , ["~>3.2.1", "3.2.0"] // >=3.2.1 <3.3.0
+ , ["~1", "0.2.3"] // >=1.0.0 <2.0.0
+ , ["~>1", "2.2.3"]
+ , ["~1.0", "1.1.0"] // >=1.0.0 <1.1.0
+ , ["<1", "1.0.0"]
+ , [">=1.2", "1.1.1"]
+ , ["1", "2.0.0beta"]
+ , ["~v0.5.4-beta", "0.5.4-alpha"]
+ , ["<1", "1.0.0beta"]
+ , ["< 1", "1.0.0beta"]
+ , ["=0.7.x", "0.8.2"]
+ , [">=0.7.x", "0.6.2"]
+ , ["<=0.7.x", "0.7.2"]
+ ].forEach(function (v) {
+ t.ok(!satisfies(v[1], v[0]), v[0]+" not satisfied by "+v[1])
+ })
+ t.end()
+})
+
+test("\nincrement versions test", function (t) {
+; [ [ "1.2.3", "major", "2.0.0" ]
+ , [ "1.2.3", "minor", "1.3.0" ]
+ , [ "1.2.3", "patch", "1.2.4" ]
+ , [ "1.2.3", "build", "1.2.3-1" ]
+ , [ "1.2.3-4", "build", "1.2.3-5" ]
+ , [ "1.2.3tag", "major", "2.0.0" ]
+ , [ "1.2.3-tag", "major", "2.0.0" ]
+ , [ "1.2.3tag", "build", "1.2.3-1" ]
+ , [ "1.2.3-tag", "build", "1.2.3-1" ]
+ , [ "1.2.3-4-tag", "build", "1.2.3-5" ]
+ , [ "1.2.3-4tag", "build", "1.2.3-5" ]
+ , [ "1.2.3", "fake", null ]
+ , [ "fake", "major", null ]
+ ].forEach(function (v) {
+ t.equal(inc(v[0], v[1]), v[2], "inc("+v[0]+", "+v[1]+") === "+v[2])
+ })
+
+ t.end()
+})
+
+test("\nreplace stars test", function (t) {
+; [ [ "", "" ]
+ , [ "*", "" ]
+ , [ "> *", "" ]
+ , [ "<*", "" ]
+ , [ " >= *", "" ]
+ , [ "* || 1.2.3", " || 1.2.3" ]
+ ].forEach(function (v) {
+ t.equal(replaceStars(v[0]), v[1], "replaceStars("+v[0]+") === "+v[1])
+ })
+
+ t.end()
+})
+
+test("\nvalid range test", function (t) {
+; [ ["1.0.0 - 2.0.0", ">=1.0.0 <=2.0.0"]
+ , ["1.0.0", "1.0.0"]
+ , [">=*", ""]
+ , ["", ""]
+ , ["*", ""]
+ , ["*", ""]
+ , [">=1.0.0", ">=1.0.0"]
+ , [">1.0.0", ">1.0.0"]
+ , ["<=2.0.0", "<=2.0.0"]
+ , ["1", ">=1.0.0- <2.0.0-"]
+ , ["<=2.0.0", "<=2.0.0"]
+ , ["<=2.0.0", "<=2.0.0"]
+ , ["<2.0.0", "<2.0.0"]
+ , ["<2.0.0", "<2.0.0"]
+ , [">= 1.0.0", ">=1.0.0"]
+ , [">= 1.0.0", ">=1.0.0"]
+ , [">= 1.0.0", ">=1.0.0"]
+ , ["> 1.0.0", ">1.0.0"]
+ , ["> 1.0.0", ">1.0.0"]
+ , ["<= 2.0.0", "<=2.0.0"]
+ , ["<= 2.0.0", "<=2.0.0"]
+ , ["<= 2.0.0", "<=2.0.0"]
+ , ["< 2.0.0", "<2.0.0"]
+ , ["< 2.0.0", "<2.0.0"]
+ , [">=0.1.97", ">=0.1.97"]
+ , [">=0.1.97", ">=0.1.97"]
+ , ["0.1.20 || 1.2.4", "0.1.20||1.2.4"]
+ , [">=0.2.3 || <0.0.1", ">=0.2.3||<0.0.1"]
+ , [">=0.2.3 || <0.0.1", ">=0.2.3||<0.0.1"]
+ , [">=0.2.3 || <0.0.1", ">=0.2.3||<0.0.1"]
+ , ["||", "||"]
+ , ["2.x.x", ">=2.0.0- <3.0.0-"]
+ , ["1.2.x", ">=1.2.0- <1.3.0-"]
+ , ["1.2.x || 2.x", ">=1.2.0- <1.3.0-||>=2.0.0- <3.0.0-"]
+ , ["1.2.x || 2.x", ">=1.2.0- <1.3.0-||>=2.0.0- <3.0.0-"]
+ , ["x", ""]
+ , ["2.*.*", null]
+ , ["1.2.*", null]
+ , ["1.2.* || 2.*", null]
+ , ["1.2.* || 2.*", null]
+ , ["*", ""]
+ , ["2", ">=2.0.0- <3.0.0-"]
+ , ["2.3", ">=2.3.0- <2.4.0-"]
+ , ["~2.4", ">=2.4.0- <2.5.0-"]
+ , ["~2.4", ">=2.4.0- <2.5.0-"]
+ , ["~>3.2.1", ">=3.2.1- <3.3.0-"]
+ , ["~1", ">=1.0.0- <2.0.0-"]
+ , ["~>1", ">=1.0.0- <2.0.0-"]
+ , ["~> 1", ">=1.0.0- <2.0.0-"]
+ , ["~1.0", ">=1.0.0- <1.1.0-"]
+ , ["~ 1.0", ">=1.0.0- <1.1.0-"]
+ , ["<1", "<1.0.0-"]
+ , ["< 1", "<1.0.0-"]
+ , [">=1", ">=1.0.0-"]
+ , [">= 1", ">=1.0.0-"]
+ , ["<1.2", "<1.2.0-"]
+ , ["< 1.2", "<1.2.0-"]
+ , ["1", ">=1.0.0- <2.0.0-"]
+ ].forEach(function (v) {
+ t.equal(validRange(v[0]), v[1], "validRange("+v[0]+") === "+v[1])
+ })
+
+ t.end()
+})
+
+test("\ncomparators test", function (t) {
+; [ ["1.0.0 - 2.0.0", [[">=1.0.0", "<=2.0.0"]] ]
+ , ["1.0.0", [["1.0.0"]] ]
+ , [">=*", [[">=0.0.0-"]] ]
+ , ["", [[""]]]
+ , ["*", [[""]] ]
+ , ["*", [[""]] ]
+ , [">=1.0.0", [[">=1.0.0"]] ]
+ , [">=1.0.0", [[">=1.0.0"]] ]
+ , [">=1.0.0", [[">=1.0.0"]] ]
+ , [">1.0.0", [[">1.0.0"]] ]
+ , [">1.0.0", [[">1.0.0"]] ]
+ , ["<=2.0.0", [["<=2.0.0"]] ]
+ , ["1", [[">=1.0.0-", "<2.0.0-"]] ]
+ , ["<=2.0.0", [["<=2.0.0"]] ]
+ , ["<=2.0.0", [["<=2.0.0"]] ]
+ , ["<2.0.0", [["<2.0.0"]] ]
+ , ["<2.0.0", [["<2.0.0"]] ]
+ , [">= 1.0.0", [[">=1.0.0"]] ]
+ , [">= 1.0.0", [[">=1.0.0"]] ]
+ , [">= 1.0.0", [[">=1.0.0"]] ]
+ , ["> 1.0.0", [[">1.0.0"]] ]
+ , ["> 1.0.0", [[">1.0.0"]] ]
+ , ["<= 2.0.0", [["<=2.0.0"]] ]
+ , ["<= 2.0.0", [["<=2.0.0"]] ]
+ , ["<= 2.0.0", [["<=2.0.0"]] ]
+ , ["< 2.0.0", [["<2.0.0"]] ]
+ , ["<\t2.0.0", [["<2.0.0"]] ]
+ , [">=0.1.97", [[">=0.1.97"]] ]
+ , [">=0.1.97", [[">=0.1.97"]] ]
+ , ["0.1.20 || 1.2.4", [["0.1.20"], ["1.2.4"]] ]
+ , [">=0.2.3 || <0.0.1", [[">=0.2.3"], ["<0.0.1"]] ]
+ , [">=0.2.3 || <0.0.1", [[">=0.2.3"], ["<0.0.1"]] ]
+ , [">=0.2.3 || <0.0.1", [[">=0.2.3"], ["<0.0.1"]] ]
+ , ["||", [[""], [""]] ]
+ , ["2.x.x", [[">=2.0.0-", "<3.0.0-"]] ]
+ , ["1.2.x", [[">=1.2.0-", "<1.3.0-"]] ]
+ , ["1.2.x || 2.x", [[">=1.2.0-", "<1.3.0-"], [">=2.0.0-", "<3.0.0-"]] ]
+ , ["1.2.x || 2.x", [[">=1.2.0-", "<1.3.0-"], [">=2.0.0-", "<3.0.0-"]] ]
+ , ["x", [[""]] ]
+ , ["2.*.*", [[">=2.0.0-", "<3.0.0-"]] ]
+ , ["1.2.*", [[">=1.2.0-", "<1.3.0-"]] ]
+ , ["1.2.* || 2.*", [[">=1.2.0-", "<1.3.0-"], [">=2.0.0-", "<3.0.0-"]] ]
+ , ["1.2.* || 2.*", [[">=1.2.0-", "<1.3.0-"], [">=2.0.0-", "<3.0.0-"]] ]
+ , ["*", [[""]] ]
+ , ["2", [[">=2.0.0-", "<3.0.0-"]] ]
+ , ["2.3", [[">=2.3.0-", "<2.4.0-"]] ]
+ , ["~2.4", [[">=2.4.0-", "<2.5.0-"]] ]
+ , ["~2.4", [[">=2.4.0-", "<2.5.0-"]] ]
+ , ["~>3.2.1", [[">=3.2.1-", "<3.3.0-"]] ]
+ , ["~1", [[">=1.0.0-", "<2.0.0-"]] ]
+ , ["~>1", [[">=1.0.0-", "<2.0.0-"]] ]
+ , ["~> 1", [[">=1.0.0-", "<2.0.0-"]] ]
+ , ["~1.0", [[">=1.0.0-", "<1.1.0-"]] ]
+ , ["~ 1.0", [[">=1.0.0-", "<1.1.0-"]] ]
+ , ["<1", [["<1.0.0-"]] ]
+ , ["< 1", [["<1.0.0-"]] ]
+ , [">=1", [[">=1.0.0-"]] ]
+ , [">= 1", [[">=1.0.0-"]] ]
+ , ["<1.2", [["<1.2.0-"]] ]
+ , ["< 1.2", [["<1.2.0-"]] ]
+ , ["1", [[">=1.0.0-", "<2.0.0-"]] ]
+ ].forEach(function (v) {
+ t.equivalent(toComparators(v[0]), v[1], "toComparators("+v[0]+") === "+JSON.stringify(v[1]))
+ })
+
+ t.end()
+})
View
2  package.json
@@ -34,7 +34,7 @@
"main": "./lib/npm.js",
"bin": "./bin/npm-cli.js",
"dependencies": {
- "semver": "~1.0.14",
+ "semver": "~1.1.0",
"ini": "1",
"slide": "1",
"abbrev": "1",
Please sign in to comment.
Something went wrong with that request. Please try again.