node-pre-gyp
Advanced tools
Comparing version 0.5.28 to 0.5.29
# node-pre-gyp changelog | ||
## 0.5.29 | ||
- Added support for semver `build`. | ||
- Fixed support for downloading from urls that include `+`. | ||
## 0.5.28 | ||
@@ -4,0 +9,0 @@ |
@@ -23,3 +23,3 @@ | ||
var requestOpts = { | ||
uri: uri | ||
uri: uri.replace('+','%2B') | ||
, headers: { | ||
@@ -26,0 +26,0 @@ 'User-Agent': 'node-pre-gyp (node ' + process.version + ')' |
@@ -128,3 +128,4 @@ module.exports = exports; | ||
, version: module_version.version | ||
, prerelease: module_version.prerelease.length ? v.slice(v.indexOf(module_version.prerelease[0])) : '' | ||
, prerelease: module_version.prerelease.length ? module_version.prerelease.join('.') : '' | ||
, build :module_version.build.length ? module_version.build.join('.') : '' | ||
, major: module_version.major | ||
@@ -131,0 +132,0 @@ , minor: module_version.minor |
@@ -65,3 +65,4 @@ { | ||
"_shasum": "857fcabfc3397d2625b8228262e86aa7a011b05d", | ||
"_resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz" | ||
"_resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", | ||
"readme": "ERROR: No README data found!" | ||
} |
@@ -57,3 +57,4 @@ { | ||
"_shasum": "7a16ba69729132340506170494bc83f7076fe08f", | ||
"_resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.2.11.tgz" | ||
"_resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.2.11.tgz", | ||
"readme": "ERROR: No README data found!" | ||
} |
@@ -44,3 +44,8 @@ { | ||
"_shasum": "4e808c2ce144c6c1788918e034d6797bc6cf6281", | ||
"_resolved": "https://registry.npmjs.org/ini/-/ini-1.1.0.tgz" | ||
"_resolved": "https://registry.npmjs.org/ini/-/ini-1.1.0.tgz", | ||
"bugs": { | ||
"url": "https://github.com/isaacs/ini/issues" | ||
}, | ||
"readme": "ERROR: No README data found!", | ||
"homepage": "https://github.com/isaacs/ini" | ||
} |
@@ -65,3 +65,4 @@ { | ||
"_shasum": "de3f98543dbf96082be48ad1a0c7cda836301dcf", | ||
"_resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz" | ||
"_resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz", | ||
"readme": "ERROR: No README data found!" | ||
} |
@@ -75,3 +75,4 @@ { | ||
"directories": {}, | ||
"_resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-0.1.3.tgz" | ||
"_resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-0.1.3.tgz", | ||
"readme": "ERROR: No README data found!" | ||
} |
@@ -46,3 +46,3 @@ { | ||
"_shasum": "b88ef9421a08151352a659e0c3a58c4b82eb7576", | ||
"_from": "rc@~0.5.0", | ||
"_from": "rc@~0.5.1", | ||
"_npmVersion": "1.4.26", | ||
@@ -64,3 +64,4 @@ "_npmUser": { | ||
"directories": {}, | ||
"_resolved": "https://registry.npmjs.org/rc/-/rc-0.5.1.tgz" | ||
"_resolved": "https://registry.npmjs.org/rc/-/rc-0.5.1.tgz", | ||
"readme": "ERROR: No README data found!" | ||
} |
{ | ||
"name": "semver", | ||
"version": "3.0.1", | ||
"version": "4.1.0", | ||
"description": "The semantic version parser used by npm.", | ||
@@ -24,3 +24,3 @@ "main": "semver.js", | ||
}, | ||
"gitHead": "4b24aeb54dd23560f53b0df01e64e5f229e6172f", | ||
"gitHead": "f8db569b9fd00788d14064aaf81854ed81e1337a", | ||
"bugs": { | ||
@@ -30,6 +30,7 @@ "url": "https://github.com/isaacs/node-semver/issues" | ||
"homepage": "https://github.com/isaacs/node-semver", | ||
"_id": "semver@3.0.1", | ||
"_shasum": "720ac012515a252f91fb0dd2e99a56a70d6cf078", | ||
"_from": "semver@~3.0.1", | ||
"_npmVersion": "2.0.0-alpha-5", | ||
"_id": "semver@4.1.0", | ||
"_shasum": "bc80a9ff68532814362cc3cfda3c7b75ed9c321c", | ||
"_from": "semver@~4.1.0", | ||
"_npmVersion": "2.1.3", | ||
"_nodeVersion": "0.10.31", | ||
"_npmUser": { | ||
@@ -43,10 +44,14 @@ "name": "isaacs", | ||
"email": "i@izs.me" | ||
}, | ||
{ | ||
"name": "othiym23", | ||
"email": "ogd@aoaioxxysz.net" | ||
} | ||
], | ||
"dist": { | ||
"shasum": "720ac012515a252f91fb0dd2e99a56a70d6cf078", | ||
"tarball": "http://registry.npmjs.org/semver/-/semver-3.0.1.tgz" | ||
"shasum": "bc80a9ff68532814362cc3cfda3c7b75ed9c321c", | ||
"tarball": "http://registry.npmjs.org/semver/-/semver-4.1.0.tgz" | ||
}, | ||
"directories": {}, | ||
"_resolved": "https://registry.npmjs.org/semver/-/semver-3.0.1.tgz" | ||
"_resolved": "https://registry.npmjs.org/semver/-/semver-4.1.0.tgz" | ||
} |
@@ -44,50 +44,167 @@ semver(1) -- The semantic versioner for npm | ||
The following range styles are supported: | ||
A `version range` is a set of `comparators` which specify versions | ||
that satisfy the range. | ||
* `1.2.3` A specific version. When nothing else will do. Must be a full | ||
version number, with major, minor, and patch versions specified. | ||
Note that build metadata is still ignored, so `1.2.3+build2012` will | ||
satisfy this range. | ||
* `>1.2.3` Greater than a specific version. | ||
* `<1.2.3` Less than a specific version. If there is no prerelease | ||
tag on the version range, then no prerelease version will be allowed | ||
either, even though these are technically "less than". | ||
* `>=1.2.3` Greater than or equal to. Note that prerelease versions | ||
are NOT equal to their "normal" equivalents, so `1.2.3-beta` will | ||
not satisfy this range, but `2.3.0-beta` will. | ||
* `<=1.2.3` Less than or equal to. In this case, prerelease versions | ||
ARE allowed, so `1.2.3-beta` would satisfy. | ||
A `comparator` is composed of an `operator` and a `version`. The set | ||
of primitive `operators` is: | ||
* `<` Less than | ||
* `<=` Less than or equal to | ||
* `>` Greater than | ||
* `>=` Greater than or equal to | ||
* `=` Equal. If no operator is specified, then equality is assumed, | ||
so this operator is optional, but MAY be included. | ||
For example, the comparator `>=1.2.7` would match the versions | ||
`1.2.7`, `1.2.8`, `2.5.3`, and `1.3.9`, but not the versions `1.2.6` | ||
or `1.1.0`. | ||
Comparators can be joined by whitespace to form a `comparator set`, | ||
which is satisfied by the **intersection** of all of the comparators | ||
it includes. | ||
A range is composed of one or more comparator sets, joined by `||`. A | ||
version matches a range if and only if every comparator in at least | ||
one of the `||`-separated comparator sets is satisfied by the version. | ||
For example, the range `>=1.2.7 <1.3.0` would match the versions | ||
`1.2.7`, `1.2.8`, and `1.2.99`, but not the versions `1.2.6`, `1.3.0`, | ||
or `1.1.0`. | ||
The range `1.2.7 || >=1.2.9 <2.0.0` would match the versions `1.2.7`, | ||
`1.2.9`, and `1.4.6`, but not the versions `1.2.8` or `2.0.0`. | ||
### Prerelease Tags | ||
If a version has a prerelease tag (for example, `1.2.3-alpha.3`) then | ||
it will only be allowed to satisfy comparator sets if at least one | ||
comparator with the same `[major, minor, patch]` tuple also has a | ||
prerelease tag. | ||
For example, the range `>1.2.3-alpha.3` would be allowed to match the | ||
version `1.2.3-alpha.7`, but it would *not* be satisfied by | ||
`3.4.5-alpha.9`, even though `3.4.5-alpha.9` is technically "greater | ||
than" `1.2.3-alpha.3` according to the SemVer sort rules. The version | ||
range only accepts prerelease tags on the `1.2.3` version. The | ||
version `3.4.5` *would* satisfy the range, because it does not have a | ||
prerelease flag, and `3.4.5` is greater than `1.2.3-alpha.7`. | ||
The purpose for this behavior is twofold. First, prerelease versions | ||
frequently are updated very quickly, and contain many breaking changes | ||
that are (by the author's design) not yet fit for public consumption. | ||
Therefore, by default, they are excluded from range matching | ||
semantics. | ||
Second, a user who has opted into using a prerelease version has | ||
clearly indicated the intent to use *that specific* set of | ||
alpha/beta/rc versions. By including a prerelease tag in the range, | ||
the user is indicating that they are aware of the risk. However, it | ||
is still not appropriate to assume that they have opted into taking a | ||
similar risk on the *next* set of prerelease versions. | ||
### Advanced Range Syntax | ||
Advanced range syntax desugars to primitive comparators in | ||
deterministic ways. | ||
Advanced ranges may be combined in the same way as primitive | ||
comparators using white space or `||`. | ||
#### Hyphen Ranges `X.Y.Z - A.B.C` | ||
Specifies an inclusive set. | ||
* `1.2.3 - 2.3.4` := `>=1.2.3 <=2.3.4` | ||
* `~1.2.3` := `>=1.2.3-0 <1.3.0-0` "Reasonably close to `1.2.3`". When | ||
using tilde operators, prerelease versions are supported as well, | ||
but a prerelease of the next significant digit will NOT be | ||
satisfactory, so `1.3.0-beta` will not satisfy `~1.2.3`. | ||
* `^1.2.3` := `>=1.2.3-0 <2.0.0-0` "Compatible with `1.2.3`". When | ||
using caret operators, anything from the specified version (including | ||
prerelease) will be supported up to, but not including, the next | ||
major version (or its prereleases). `1.5.1` will satisfy `^1.2.3`, | ||
while `1.2.2` and `2.0.0-beta` will not. | ||
* `^0.1.3` := `0.1.3` "Compatible with `0.1.3`". `0.x.x` versions are | ||
special: since the semver spec specifies that `0.x.x` versions make | ||
no stability guarantees, only the version specified is considered | ||
valid. | ||
* `^0.0.2` := `0.0.2` "Only the version `0.0.2` is considered compatible" | ||
* `~1.2` := `>=1.2.0-0 <1.3.0-0` "Any version starting with `1.2`" | ||
* `^1.2` := `>=1.2.0-0 <2.0.0-0` "Any version compatible with `1.2`" | ||
* `1.2.x` := `>=1.2.0-0 <1.3.0-0` "Any version starting with `1.2`" | ||
* `1.2.*` Same as `1.2.x`. | ||
* `1.2` Same as `1.2.x`. | ||
* `~1` := `>=1.0.0-0 <2.0.0-0` "Any version starting with `1`" | ||
* `^1` := `>=1.0.0-0 <2.0.0-0` "Any version compatible with `1`" | ||
* `1.x` := `>=1.0.0-0 <2.0.0-0` "Any version starting with `1`" | ||
* `1.*` Same as `1.x`. | ||
* `1` Same as `1.x`. | ||
* `*` Any version whatsoever. | ||
* `x` Same as `*`. | ||
* `""` (just an empty string) Same as `*`. | ||
If a partial version is provided as the first version in the inclusive | ||
range, then the missing pieces are replaced with zeroes. | ||
Ranges can be joined with either a space (which implies "and") or a | ||
`||` (which implies "or"). | ||
* `1.2 - 2.3.4` := `>=1.2.0 <=2.3.4` | ||
If a partial version is provided as the second version in the | ||
inclusive range, then all versions that start with the supplied parts | ||
of the tuple are accepted, but nothing that would be greater than the | ||
provided tuple parts. | ||
* `1.2.3 - 2.3` := `>=1.2.3 <2.4.0` | ||
* `1.2.3 - 2` := `>=1.2.3 <3.0.0` | ||
#### X-Ranges `1.2.x` `1.X` `1.2.*` `*` | ||
Any of `X`, `x`, or `*` may be used to "stand in" for one of the | ||
numeric values in the `[major, minor, patch]` tuple. | ||
* `*` := `>=0.0.0` (Any version satisfies) | ||
* `1.x` := `>=1.0.0 <2.0.0` (Matching major version) | ||
* `1.2.x` := `>=1.2.0 <1.3.0` (Matching major and minor versions) | ||
A partial version range is treated as an X-Range, so the special | ||
character is in fact optional. | ||
* `""` (empty string) := `*` := `>=0.0.0` | ||
* `1` := `1.x.x` := `>=1.0.0 <2.0.0` | ||
* `1.2` := `1.2.x` := `>=1.2.0 <1.3.0` | ||
#### Tilde Ranges `~1.2.3` `~1.2` `~1` | ||
Allows patch-level changes if a minor version is specified on the | ||
comparator. Allows minor-level changes if not. | ||
* `~1.2.3` := `>=1.2.3 <1.(2+1).0` := `>=1.2.3 <1.3.0` | ||
* `~1.2` := `>=1.2.0 <1.(2+1).0` := `>=1.2.0 <1.3.0` (Same as `1.2.x`) | ||
* `~1` := `>=1.0.0 <(1+1).0.0` := `>=1.0.0 <2.0.0` (Same as `1.x`) | ||
* `~0.2.3` := `>=0.2.3 <0.(2+1).0` := `>=0.2.3 <0.3.0` | ||
* `~0.2` := `>=0.2.0 <0.(2+1).0` := `>=0.2.0 <0.3.0` (Same as `0.2.x`) | ||
* `~0` := `>=0.0.0 <(0+1).0.0` := `>=0.0.0 <1.0.0` (Same as `0.x`) | ||
* `~1.2.3-beta.2` := `>=1.2.3-beta.2 <1.3.0` Note that prereleases in | ||
the `1.2.3` version will be allowed, if they are greater than or | ||
equal to `beta.2`. So, `1.2.3-beta.4` would be allowed, but | ||
`1.2.4-beta.2` would not, because it is a prerelease of a | ||
different `[major, minor, patch]` tuple. | ||
Note: this is the same as the `~>` operator in rubygems. | ||
#### Caret Ranges `^1.2.3` `^0.2.5` `^0.0.4` | ||
Allows changes that do not modify the left-most non-zero digit in the | ||
`[major, minor, patch]` tuple. In other words, this allows patch and | ||
minor updates for versions `1.0.0` and above, patch updates for | ||
versions `0.X >=0.1.0`, and *no* updates for versions `0.0.X`. | ||
Many authors treat a `0.x` version as if the `x` were the major | ||
"breaking-change" indicator. | ||
Caret ranges are ideal when an author may make breaking changes | ||
between `0.2.4` and `0.3.0` releases, which is a common practice. | ||
However, it presumes that there will *not* be breaking changes between | ||
`0.2.4` and `0.2.5`. It allows for changes that are presumed to be | ||
additive (but non-breaking), according to commonly observed practices. | ||
* `^1.2.3` := `>=1.2.3 <2.0.0` | ||
* `^0.2.3` := `>=0.2.3 <0.3.0` | ||
* `^0.0.3` := `>=0.0.3 <0.0.4` | ||
* `^1.2.3-beta.2` := `>=1.2.3-beta.2 <2.0.0` Note that prereleases in | ||
the `1.2.3` version will be allowed, if they are greater than or | ||
equal to `beta.2`. So, `1.2.3-beta.4` would be allowed, but | ||
`1.2.4-beta.2` would not, because it is a prerelease of a | ||
different `[major, minor, patch]` tuple. | ||
* `^0.0.3-beta` := `>=0.0.3-beta <0.0.4` Note that prereleases in the | ||
`0.0.3` version *only* will be allowed, if they are greater than or | ||
equal to `beta`. So, `0.0.3-pr.2` would be allowed. | ||
When parsing caret ranges, a missing `patch` value desugars to the | ||
number `0`, but will allow flexibility within that value, even if the | ||
major and minor versions are both `0`. | ||
* `^1.2.x` := `>=1.2.0 <2.0.0` | ||
* `^0.0.x` := `>=0.0.0 <0.1.0` | ||
* `^0.0` := `>=0.0.0 <0.1.0` | ||
A missing `minor` and `patch` values will desugar to zero, but also | ||
allow flexibility within those values, even if the major version is | ||
zero. | ||
* `^1.x` := `>=1.0.0 <2.0.0` | ||
* `^0.x` := `>=0.0.0 <1.0.0` | ||
## Functions | ||
@@ -94,0 +211,0 @@ |
@@ -131,4 +131,5 @@ ;(function(exports) { | ||
'(?:\\.(' + src[XRANGEIDENTIFIER] + ')' + | ||
'(?:(' + src[PRERELEASE] + ')' + | ||
')?)?)?'; | ||
'(?:' + src[PRERELEASE] + ')?' + | ||
src[BUILD] + '?' + | ||
')?)?'; | ||
@@ -139,7 +140,6 @@ var XRANGEPLAINLOOSE = R++; | ||
'(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' + | ||
'(?:(' + src[PRERELEASELOOSE] + ')' + | ||
')?)?)?'; | ||
'(?:' + src[PRERELEASELOOSE] + ')?' + | ||
src[BUILD] + '?' + | ||
')?)?'; | ||
// >=2.x, for example, means >=2.0.0-0 | ||
// <1.x would be the same as "<1.0.0-0", though. | ||
var XRANGE = R++; | ||
@@ -241,3 +241,3 @@ src[XRANGE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAIN] + '$'; | ||
function clean(version, loose) { | ||
var s = parse(version.trim().replace(/^[=v]+/, ""), loose); | ||
var s = parse(version.trim().replace(/^[=v]+/, ''), loose); | ||
return s ? s.version : null; | ||
@@ -351,11 +351,16 @@ } | ||
// down to pre-release. premajor and prepatch work the same way. | ||
SemVer.prototype.inc = function(release) { | ||
SemVer.prototype.inc = function(release, identifier) { | ||
switch (release) { | ||
case 'premajor': | ||
this.inc('major'); | ||
this.inc('pre'); | ||
this.prerelease.length = 0; | ||
this.patch = 0; | ||
this.minor = 0; | ||
this.major++; | ||
this.inc('pre', identifier); | ||
break; | ||
case 'preminor': | ||
this.inc('minor'); | ||
this.inc('pre'); | ||
this.prerelease.length = 0; | ||
this.patch = 0; | ||
this.minor++; | ||
this.inc('pre', identifier); | ||
break; | ||
@@ -367,4 +372,4 @@ case 'prepatch': | ||
this.prerelease.length = 0; | ||
this.inc('patch'); | ||
this.inc('pre'); | ||
this.inc('patch', identifier); | ||
this.inc('pre', identifier); | ||
break; | ||
@@ -375,10 +380,24 @@ // If the input is a non-prerelease version, this acts the same as | ||
if (this.prerelease.length === 0) | ||
this.inc('patch'); | ||
this.inc('pre'); | ||
this.inc('patch', identifier); | ||
this.inc('pre', identifier); | ||
break; | ||
case 'major': | ||
this.major++; | ||
this.minor = -1; | ||
// If this is a pre-major version, bump up to the same major version. | ||
// Otherwise increment major. | ||
// 1.0.0-5 bumps to 1.0.0 | ||
// 1.1.0 bumps to 2.0.0 | ||
if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) | ||
this.major++; | ||
this.minor = 0; | ||
this.patch = 0; | ||
this.prerelease = []; | ||
break; | ||
case 'minor': | ||
this.minor++; | ||
// If this is a pre-minor version, bump up to the same minor version. | ||
// Otherwise increment minor. | ||
// 1.2.0-5 bumps to 1.2.0 | ||
// 1.2.1 bumps to 1.3.0 | ||
if (this.patch !== 0 || this.prerelease.length === 0) | ||
this.minor++; | ||
this.patch = 0; | ||
@@ -396,3 +415,3 @@ this.prerelease = []; | ||
break; | ||
// This probably shouldn't be used publically. | ||
// This probably shouldn't be used publicly. | ||
// 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction. | ||
@@ -413,2 +432,11 @@ case 'pre': | ||
} | ||
if (identifier) { | ||
// 1.2.0-beta.1 bumps to 1.2.0-beta.2, | ||
// 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0 | ||
if (this.prerelease[0] === identifier) { | ||
if (isNaN(this.prerelease[1])) | ||
this.prerelease = [identifier, 0]; | ||
} else | ||
this.prerelease = [identifier, 0]; | ||
} | ||
break; | ||
@@ -424,5 +452,10 @@ | ||
exports.inc = inc; | ||
function inc(version, release, loose) { | ||
function inc(version, release, loose, identifier) { | ||
if (typeof(loose) === 'string') { | ||
identifier = loose; | ||
loose = undefined; | ||
} | ||
try { | ||
return new SemVer(version, loose).inc(release).version; | ||
return new SemVer(version, loose).inc(release, identifier).version; | ||
} catch (er) { | ||
@@ -520,4 +553,12 @@ return null; | ||
switch (op) { | ||
case '===': ret = a === b; break; | ||
case '!==': ret = a !== b; break; | ||
case '===': | ||
if (typeof a === 'object') a = a.version; | ||
if (typeof b === 'object') b = b.version; | ||
ret = a === b; | ||
break; | ||
case '!==': | ||
if (typeof a === 'object') a = a.version; | ||
if (typeof b === 'object') b = b.version; | ||
ret = a !== b; | ||
break; | ||
case '': case '=': case '==': ret = eq(a, b, loose); break; | ||
@@ -554,2 +595,4 @@ case '!=': ret = neq(a, b, loose); break; | ||
this.value = this.operator + this.semver.version; | ||
; | ||
} | ||
@@ -572,17 +615,4 @@ | ||
this.semver = ANY; | ||
else { | ||
else | ||
this.semver = new SemVer(m[2], this.loose); | ||
// <1.2.3-rc DOES allow 1.2.3-beta (has prerelease) | ||
// >=1.2.3 DOES NOT allow 1.2.3-beta | ||
// <=1.2.3 DOES allow 1.2.3-beta | ||
// However, <1.2.3 does NOT allow 1.2.3-beta, | ||
// even though `1.2.3-beta < 1.2.3` | ||
// The assumption is that the 1.2.3 version has something you | ||
// *don't* want, so we push the prerelease down to the minimum. | ||
if (this.operator === '<' && !this.semver.prerelease.length) { | ||
this.semver.prerelease = ['0']; | ||
this.semver.format(); | ||
} | ||
} | ||
}; | ||
@@ -600,4 +630,10 @@ | ||
; | ||
return (this.semver === ANY) ? true : | ||
cmp(version, this.operator, this.semver, this.loose); | ||
if (this.semver === ANY) | ||
return true; | ||
if (typeof version === 'string') | ||
version = new SemVer(version, this.loose); | ||
return cmp(version, this.operator, this.semver, this.loose); | ||
}; | ||
@@ -739,6 +775,6 @@ | ||
else if (isX(m)) | ||
ret = '>=' + M + '.0.0-0 <' + (+M + 1) + '.0.0-0'; | ||
ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'; | ||
else if (isX(p)) | ||
// ~1.2 == >=1.2.0- <1.3.0- | ||
ret = '>=' + M + '.' + m + '.0-0 <' + M + '.' + (+m + 1) + '.0-0'; | ||
ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'; | ||
else if (pr) { | ||
@@ -749,7 +785,7 @@ ; | ||
ret = '>=' + M + '.' + m + '.' + p + pr + | ||
' <' + M + '.' + (+m + 1) + '.0-0'; | ||
' <' + M + '.' + (+m + 1) + '.0'; | ||
} else | ||
// ~1.2.3 == >=1.2.3-0 <1.3.0-0 | ||
ret = '>=' + M + '.' + m + '.' + p + '-0' + | ||
' <' + M + '.' + (+m + 1) + '.0-0'; | ||
// ~1.2.3 == >=1.2.3 <1.3.0 | ||
ret = '>=' + M + '.' + m + '.' + p + | ||
' <' + M + '.' + (+m + 1) + '.0'; | ||
@@ -774,2 +810,3 @@ ; | ||
function replaceCaret(comp, loose) { | ||
; | ||
var r = loose ? re[CARETLOOSE] : re[CARET]; | ||
@@ -779,7 +816,2 @@ return comp.replace(r, function(_, M, m, p, pr) { | ||
var ret; | ||
if (pr) { | ||
if (pr.charAt(0) !== '-') | ||
pr = '-' + pr; | ||
} else | ||
pr = ''; | ||
@@ -789,16 +821,35 @@ if (isX(M)) | ||
else if (isX(m)) | ||
ret = '>=' + M + '.0.0-0 <' + (+M + 1) + '.0.0-0'; | ||
ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'; | ||
else if (isX(p)) { | ||
if (M === '0') | ||
ret = '>=' + M + '.' + m + '.0-0 <' + M + '.' + (+m + 1) + '.0-0'; | ||
ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'; | ||
else | ||
ret = '>=' + M + '.' + m + '.0-0 <' + (+M + 1) + '.0.0-0'; | ||
} else if (M === '0') | ||
ret = '=' + M + '.' + m + '.' + p + pr; | ||
else if (pr) | ||
ret = '>=' + M + '.' + m + '.' + p + pr + | ||
' <' + (+M + 1) + '.0.0-0'; | ||
else | ||
ret = '>=' + M + '.' + m + '.' + p + '-0' + | ||
' <' + (+M + 1) + '.0.0-0'; | ||
ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0'; | ||
} else if (pr) { | ||
; | ||
if (pr.charAt(0) !== '-') | ||
pr = '-' + pr; | ||
if (M === '0') { | ||
if (m === '0') | ||
ret = '>=' + M + '.' + m + '.' + p + pr + | ||
' <' + M + '.' + m + '.' + (+p + 1); | ||
else | ||
ret = '>=' + M + '.' + m + '.' + p + pr + | ||
' <' + M + '.' + (+m + 1) + '.0'; | ||
} else | ||
ret = '>=' + M + '.' + m + '.' + p + pr + | ||
' <' + (+M + 1) + '.0.0'; | ||
} else { | ||
; | ||
if (M === '0') { | ||
if (m === '0') | ||
ret = '>=' + M + '.' + m + '.' + p + | ||
' <' + M + '.' + m + '.' + (+p + 1); | ||
else | ||
ret = '>=' + M + '.' + m + '.' + p + | ||
' <' + M + '.' + (+m + 1) + '.0'; | ||
} else | ||
ret = '>=' + M + '.' + m + '.' + p + | ||
' <' + (+M + 1) + '.0.0'; | ||
} | ||
@@ -830,6 +881,12 @@ ; | ||
if (gtlt && anyX) { | ||
// replace X with 0, and then append the -0 min-prerelease | ||
if (xM) | ||
M = 0; | ||
if (xM) { | ||
if (gtlt === '>' || gtlt === '<') { | ||
// nothing is allowed | ||
ret = '<0.0.0'; | ||
} else { | ||
// nothing is forbidden | ||
ret = '*'; | ||
} | ||
} else if (gtlt && anyX) { | ||
// replace X with 0 | ||
if (xm) | ||
@@ -841,9 +898,7 @@ m = 0; | ||
if (gtlt === '>') { | ||
// >1 => >=2.0.0-0 | ||
// >1.2 => >=1.3.0-0 | ||
// >1.2.3 => >= 1.2.4-0 | ||
// >1 => >=2.0.0 | ||
// >1.2 => >=1.3.0 | ||
// >1.2.3 => >= 1.2.4 | ||
gtlt = '>='; | ||
if (xM) { | ||
// no change | ||
} else if (xm) { | ||
if (xm) { | ||
M = +M + 1; | ||
@@ -856,16 +911,17 @@ m = 0; | ||
} | ||
} else if (gtlt === '<=') { | ||
// <=0.7.x is actually <0.8.0, since any 0.7.x should | ||
// pass. Similarly, <=7.x is actually <8.0.0, etc. | ||
gtlt = '<' | ||
if (xm) | ||
M = +M + 1 | ||
else | ||
m = +m + 1 | ||
} | ||
ret = gtlt + M + '.' + m + '.' + p + '-0'; | ||
} else if (xM) { | ||
// allow any | ||
ret = '*'; | ||
ret = gtlt + M + '.' + m + '.' + p; | ||
} else if (xm) { | ||
// append '-0' onto the version, otherwise | ||
// '1.x.x' matches '2.0.0-beta', since the tag | ||
// *lowers* the version value | ||
ret = '>=' + M + '.0.0-0 <' + (+M + 1) + '.0.0-0'; | ||
ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'; | ||
} else if (xp) { | ||
ret = '>=' + M + '.' + m + '.0-0 <' + M + '.' + (+m + 1) + '.0-0'; | ||
ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'; | ||
} | ||
@@ -889,5 +945,5 @@ | ||
// M, m, patch, prerelease, build | ||
// 1.2 - 3.4.5 => >=1.2.0-0 <=3.4.5 | ||
// 1.2.3 - 3.4 => >=1.2.0-0 <3.5.0-0 Any 3.4.x will do | ||
// 1.2 - 3.4 => >=1.2.0-0 <3.5.0-0 | ||
// 1.2 - 3.4.5 => >=1.2.0 <=3.4.5 | ||
// 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do | ||
// 1.2 - 3.4 => >=1.2.0 <3.5.0 | ||
function hyphenReplace($0, | ||
@@ -900,5 +956,5 @@ from, fM, fm, fp, fpr, fb, | ||
else if (isX(fm)) | ||
from = '>=' + fM + '.0.0-0'; | ||
from = '>=' + fM + '.0.0'; | ||
else if (isX(fp)) | ||
from = '>=' + fM + '.' + fm + '.0-0'; | ||
from = '>=' + fM + '.' + fm + '.0'; | ||
else | ||
@@ -910,5 +966,5 @@ from = '>=' + from; | ||
else if (isX(tm)) | ||
to = '<' + (+tM + 1) + '.0.0-0'; | ||
to = '<' + (+tM + 1) + '.0.0'; | ||
else if (isX(tp)) | ||
to = '<' + tM + '.' + (+tm + 1) + '.0-0'; | ||
to = '<' + tM + '.' + (+tm + 1) + '.0'; | ||
else if (tpr) | ||
@@ -927,2 +983,6 @@ to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr; | ||
return false; | ||
if (typeof version === 'string') | ||
version = new SemVer(version, this.loose); | ||
for (var i = 0; i < this.set.length; i++) { | ||
@@ -940,2 +1000,27 @@ if (testSet(this.set[i], version)) | ||
} | ||
if (version.prerelease.length) { | ||
// Find the set of versions that are allowed to have prereleases | ||
// For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0 | ||
// That should allow `1.2.3-pr.2` to pass. | ||
// However, `1.2.4-alpha.notready` should NOT be allowed, | ||
// even though it's within the range set by the comparators. | ||
for (var i = 0; i < set.length; i++) { | ||
; | ||
if (set[i].semver === ANY) | ||
return true; | ||
if (set[i].semver.prerelease.length > 0) { | ||
var allowed = set[i].semver; | ||
if (allowed.major === version.major && | ||
allowed.minor === version.minor && | ||
allowed.patch === version.patch) | ||
return true; | ||
} | ||
} | ||
// Version has a -pre, but it's not one of the ones we like. | ||
return false; | ||
} | ||
return true; | ||
@@ -942,0 +1027,0 @@ } |
@@ -141,4 +141,5 @@ // export the class if we are in a Node-like system. | ||
'(?:\\.(' + src[XRANGEIDENTIFIER] + ')' + | ||
'(?:(' + src[PRERELEASE] + ')' + | ||
')?)?)?'; | ||
'(?:' + src[PRERELEASE] + ')?' + | ||
src[BUILD] + '?' + | ||
')?)?'; | ||
@@ -149,7 +150,6 @@ var XRANGEPLAINLOOSE = R++; | ||
'(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' + | ||
'(?:(' + src[PRERELEASELOOSE] + ')' + | ||
')?)?)?'; | ||
'(?:' + src[PRERELEASELOOSE] + ')?' + | ||
src[BUILD] + '?' + | ||
')?)?'; | ||
// >=2.x, for example, means >=2.0.0-0 | ||
// <1.x would be the same as "<1.0.0-0", though. | ||
var XRANGE = R++; | ||
@@ -251,3 +251,3 @@ src[XRANGE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAIN] + '$'; | ||
function clean(version, loose) { | ||
var s = parse(version.trim().replace(/^[=v]+/, ""), loose); | ||
var s = parse(version.trim().replace(/^[=v]+/, ''), loose); | ||
return s ? s.version : null; | ||
@@ -361,11 +361,16 @@ } | ||
// down to pre-release. premajor and prepatch work the same way. | ||
SemVer.prototype.inc = function(release) { | ||
SemVer.prototype.inc = function(release, identifier) { | ||
switch (release) { | ||
case 'premajor': | ||
this.inc('major'); | ||
this.inc('pre'); | ||
this.prerelease.length = 0; | ||
this.patch = 0; | ||
this.minor = 0; | ||
this.major++; | ||
this.inc('pre', identifier); | ||
break; | ||
case 'preminor': | ||
this.inc('minor'); | ||
this.inc('pre'); | ||
this.prerelease.length = 0; | ||
this.patch = 0; | ||
this.minor++; | ||
this.inc('pre', identifier); | ||
break; | ||
@@ -377,4 +382,4 @@ case 'prepatch': | ||
this.prerelease.length = 0; | ||
this.inc('patch'); | ||
this.inc('pre'); | ||
this.inc('patch', identifier); | ||
this.inc('pre', identifier); | ||
break; | ||
@@ -385,10 +390,24 @@ // If the input is a non-prerelease version, this acts the same as | ||
if (this.prerelease.length === 0) | ||
this.inc('patch'); | ||
this.inc('pre'); | ||
this.inc('patch', identifier); | ||
this.inc('pre', identifier); | ||
break; | ||
case 'major': | ||
this.major++; | ||
this.minor = -1; | ||
// If this is a pre-major version, bump up to the same major version. | ||
// Otherwise increment major. | ||
// 1.0.0-5 bumps to 1.0.0 | ||
// 1.1.0 bumps to 2.0.0 | ||
if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) | ||
this.major++; | ||
this.minor = 0; | ||
this.patch = 0; | ||
this.prerelease = []; | ||
break; | ||
case 'minor': | ||
this.minor++; | ||
// If this is a pre-minor version, bump up to the same minor version. | ||
// Otherwise increment minor. | ||
// 1.2.0-5 bumps to 1.2.0 | ||
// 1.2.1 bumps to 1.3.0 | ||
if (this.patch !== 0 || this.prerelease.length === 0) | ||
this.minor++; | ||
this.patch = 0; | ||
@@ -406,3 +425,3 @@ this.prerelease = []; | ||
break; | ||
// This probably shouldn't be used publically. | ||
// This probably shouldn't be used publicly. | ||
// 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction. | ||
@@ -423,2 +442,11 @@ case 'pre': | ||
} | ||
if (identifier) { | ||
// 1.2.0-beta.1 bumps to 1.2.0-beta.2, | ||
// 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0 | ||
if (this.prerelease[0] === identifier) { | ||
if (isNaN(this.prerelease[1])) | ||
this.prerelease = [identifier, 0]; | ||
} else | ||
this.prerelease = [identifier, 0]; | ||
} | ||
break; | ||
@@ -434,5 +462,10 @@ | ||
exports.inc = inc; | ||
function inc(version, release, loose) { | ||
function inc(version, release, loose, identifier) { | ||
if (typeof(loose) === 'string') { | ||
identifier = loose; | ||
loose = undefined; | ||
} | ||
try { | ||
return new SemVer(version, loose).inc(release).version; | ||
return new SemVer(version, loose).inc(release, identifier).version; | ||
} catch (er) { | ||
@@ -530,4 +563,12 @@ return null; | ||
switch (op) { | ||
case '===': ret = a === b; break; | ||
case '!==': ret = a !== b; break; | ||
case '===': | ||
if (typeof a === 'object') a = a.version; | ||
if (typeof b === 'object') b = b.version; | ||
ret = a === b; | ||
break; | ||
case '!==': | ||
if (typeof a === 'object') a = a.version; | ||
if (typeof b === 'object') b = b.version; | ||
ret = a !== b; | ||
break; | ||
case '': case '=': case '==': ret = eq(a, b, loose); break; | ||
@@ -564,2 +605,4 @@ case '!=': ret = neq(a, b, loose); break; | ||
this.value = this.operator + this.semver.version; | ||
debug('comp', this); | ||
} | ||
@@ -582,17 +625,4 @@ | ||
this.semver = ANY; | ||
else { | ||
else | ||
this.semver = new SemVer(m[2], this.loose); | ||
// <1.2.3-rc DOES allow 1.2.3-beta (has prerelease) | ||
// >=1.2.3 DOES NOT allow 1.2.3-beta | ||
// <=1.2.3 DOES allow 1.2.3-beta | ||
// However, <1.2.3 does NOT allow 1.2.3-beta, | ||
// even though `1.2.3-beta < 1.2.3` | ||
// The assumption is that the 1.2.3 version has something you | ||
// *don't* want, so we push the prerelease down to the minimum. | ||
if (this.operator === '<' && !this.semver.prerelease.length) { | ||
this.semver.prerelease = ['0']; | ||
this.semver.format(); | ||
} | ||
} | ||
}; | ||
@@ -610,4 +640,10 @@ | ||
debug('Comparator.test', version, this.loose); | ||
return (this.semver === ANY) ? true : | ||
cmp(version, this.operator, this.semver, this.loose); | ||
if (this.semver === ANY) | ||
return true; | ||
if (typeof version === 'string') | ||
version = new SemVer(version, this.loose); | ||
return cmp(version, this.operator, this.semver, this.loose); | ||
}; | ||
@@ -749,6 +785,6 @@ | ||
else if (isX(m)) | ||
ret = '>=' + M + '.0.0-0 <' + (+M + 1) + '.0.0-0'; | ||
ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'; | ||
else if (isX(p)) | ||
// ~1.2 == >=1.2.0- <1.3.0- | ||
ret = '>=' + M + '.' + m + '.0-0 <' + M + '.' + (+m + 1) + '.0-0'; | ||
ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'; | ||
else if (pr) { | ||
@@ -759,7 +795,7 @@ debug('replaceTilde pr', pr); | ||
ret = '>=' + M + '.' + m + '.' + p + pr + | ||
' <' + M + '.' + (+m + 1) + '.0-0'; | ||
' <' + M + '.' + (+m + 1) + '.0'; | ||
} else | ||
// ~1.2.3 == >=1.2.3-0 <1.3.0-0 | ||
ret = '>=' + M + '.' + m + '.' + p + '-0' + | ||
' <' + M + '.' + (+m + 1) + '.0-0'; | ||
// ~1.2.3 == >=1.2.3 <1.3.0 | ||
ret = '>=' + M + '.' + m + '.' + p + | ||
' <' + M + '.' + (+m + 1) + '.0'; | ||
@@ -784,2 +820,3 @@ debug('tilde return', ret); | ||
function replaceCaret(comp, loose) { | ||
debug('caret', comp, loose); | ||
var r = loose ? re[CARETLOOSE] : re[CARET]; | ||
@@ -789,7 +826,2 @@ return comp.replace(r, function(_, M, m, p, pr) { | ||
var ret; | ||
if (pr) { | ||
if (pr.charAt(0) !== '-') | ||
pr = '-' + pr; | ||
} else | ||
pr = ''; | ||
@@ -799,16 +831,35 @@ if (isX(M)) | ||
else if (isX(m)) | ||
ret = '>=' + M + '.0.0-0 <' + (+M + 1) + '.0.0-0'; | ||
ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'; | ||
else if (isX(p)) { | ||
if (M === '0') | ||
ret = '>=' + M + '.' + m + '.0-0 <' + M + '.' + (+m + 1) + '.0-0'; | ||
ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'; | ||
else | ||
ret = '>=' + M + '.' + m + '.0-0 <' + (+M + 1) + '.0.0-0'; | ||
} else if (M === '0') | ||
ret = '=' + M + '.' + m + '.' + p + pr; | ||
else if (pr) | ||
ret = '>=' + M + '.' + m + '.' + p + pr + | ||
' <' + (+M + 1) + '.0.0-0'; | ||
else | ||
ret = '>=' + M + '.' + m + '.' + p + '-0' + | ||
' <' + (+M + 1) + '.0.0-0'; | ||
ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0'; | ||
} else if (pr) { | ||
debug('replaceCaret pr', pr); | ||
if (pr.charAt(0) !== '-') | ||
pr = '-' + pr; | ||
if (M === '0') { | ||
if (m === '0') | ||
ret = '>=' + M + '.' + m + '.' + p + pr + | ||
' <' + M + '.' + m + '.' + (+p + 1); | ||
else | ||
ret = '>=' + M + '.' + m + '.' + p + pr + | ||
' <' + M + '.' + (+m + 1) + '.0'; | ||
} else | ||
ret = '>=' + M + '.' + m + '.' + p + pr + | ||
' <' + (+M + 1) + '.0.0'; | ||
} else { | ||
debug('no pr'); | ||
if (M === '0') { | ||
if (m === '0') | ||
ret = '>=' + M + '.' + m + '.' + p + | ||
' <' + M + '.' + m + '.' + (+p + 1); | ||
else | ||
ret = '>=' + M + '.' + m + '.' + p + | ||
' <' + M + '.' + (+m + 1) + '.0'; | ||
} else | ||
ret = '>=' + M + '.' + m + '.' + p + | ||
' <' + (+M + 1) + '.0.0'; | ||
} | ||
@@ -840,6 +891,12 @@ debug('caret return', ret); | ||
if (gtlt && anyX) { | ||
// replace X with 0, and then append the -0 min-prerelease | ||
if (xM) | ||
M = 0; | ||
if (xM) { | ||
if (gtlt === '>' || gtlt === '<') { | ||
// nothing is allowed | ||
ret = '<0.0.0'; | ||
} else { | ||
// nothing is forbidden | ||
ret = '*'; | ||
} | ||
} else if (gtlt && anyX) { | ||
// replace X with 0 | ||
if (xm) | ||
@@ -851,9 +908,7 @@ m = 0; | ||
if (gtlt === '>') { | ||
// >1 => >=2.0.0-0 | ||
// >1.2 => >=1.3.0-0 | ||
// >1.2.3 => >= 1.2.4-0 | ||
// >1 => >=2.0.0 | ||
// >1.2 => >=1.3.0 | ||
// >1.2.3 => >= 1.2.4 | ||
gtlt = '>='; | ||
if (xM) { | ||
// no change | ||
} else if (xm) { | ||
if (xm) { | ||
M = +M + 1; | ||
@@ -866,16 +921,17 @@ m = 0; | ||
} | ||
} else if (gtlt === '<=') { | ||
// <=0.7.x is actually <0.8.0, since any 0.7.x should | ||
// pass. Similarly, <=7.x is actually <8.0.0, etc. | ||
gtlt = '<' | ||
if (xm) | ||
M = +M + 1 | ||
else | ||
m = +m + 1 | ||
} | ||
ret = gtlt + M + '.' + m + '.' + p + '-0'; | ||
} else if (xM) { | ||
// allow any | ||
ret = '*'; | ||
ret = gtlt + M + '.' + m + '.' + p; | ||
} else if (xm) { | ||
// append '-0' onto the version, otherwise | ||
// '1.x.x' matches '2.0.0-beta', since the tag | ||
// *lowers* the version value | ||
ret = '>=' + M + '.0.0-0 <' + (+M + 1) + '.0.0-0'; | ||
ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'; | ||
} else if (xp) { | ||
ret = '>=' + M + '.' + m + '.0-0 <' + M + '.' + (+m + 1) + '.0-0'; | ||
ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'; | ||
} | ||
@@ -899,5 +955,5 @@ | ||
// M, m, patch, prerelease, build | ||
// 1.2 - 3.4.5 => >=1.2.0-0 <=3.4.5 | ||
// 1.2.3 - 3.4 => >=1.2.0-0 <3.5.0-0 Any 3.4.x will do | ||
// 1.2 - 3.4 => >=1.2.0-0 <3.5.0-0 | ||
// 1.2 - 3.4.5 => >=1.2.0 <=3.4.5 | ||
// 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do | ||
// 1.2 - 3.4 => >=1.2.0 <3.5.0 | ||
function hyphenReplace($0, | ||
@@ -910,5 +966,5 @@ from, fM, fm, fp, fpr, fb, | ||
else if (isX(fm)) | ||
from = '>=' + fM + '.0.0-0'; | ||
from = '>=' + fM + '.0.0'; | ||
else if (isX(fp)) | ||
from = '>=' + fM + '.' + fm + '.0-0'; | ||
from = '>=' + fM + '.' + fm + '.0'; | ||
else | ||
@@ -920,5 +976,5 @@ from = '>=' + from; | ||
else if (isX(tm)) | ||
to = '<' + (+tM + 1) + '.0.0-0'; | ||
to = '<' + (+tM + 1) + '.0.0'; | ||
else if (isX(tp)) | ||
to = '<' + tM + '.' + (+tm + 1) + '.0-0'; | ||
to = '<' + tM + '.' + (+tm + 1) + '.0'; | ||
else if (tpr) | ||
@@ -937,2 +993,6 @@ to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr; | ||
return false; | ||
if (typeof version === 'string') | ||
version = new SemVer(version, this.loose); | ||
for (var i = 0; i < this.set.length; i++) { | ||
@@ -950,2 +1010,27 @@ if (testSet(this.set[i], version)) | ||
} | ||
if (version.prerelease.length) { | ||
// Find the set of versions that are allowed to have prereleases | ||
// For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0 | ||
// That should allow `1.2.3-pr.2` to pass. | ||
// However, `1.2.4-alpha.notready` should NOT be allowed, | ||
// even though it's within the range set by the comparators. | ||
for (var i = 0; i < set.length; i++) { | ||
debug(set[i].semver); | ||
if (set[i].semver === ANY) | ||
return true; | ||
if (set[i].semver.prerelease.length > 0) { | ||
var allowed = set[i].semver; | ||
if (allowed.major === version.major && | ||
allowed.minor === version.minor && | ||
allowed.patch === version.patch) | ||
return true; | ||
} | ||
} | ||
// Version has a -pre, but it's not one of the ones we like. | ||
return false; | ||
} | ||
return true; | ||
@@ -952,0 +1037,0 @@ } |
@@ -1,1 +0,1 @@ | ||
(function(e){if(typeof module==="object"&&module.exports===e)e=module.exports=H;e.SEMVER_SPEC_VERSION="2.0.0";var r=e.re=[];var t=e.src=[];var n=0;var i=n++;t[i]="0|[1-9]\\d*";var s=n++;t[s]="[0-9]+";var a=n++;t[a]="\\d*[a-zA-Z-][a-zA-Z0-9-]*";var o=n++;t[o]="("+t[i]+")\\."+"("+t[i]+")\\."+"("+t[i]+")";var f=n++;t[f]="("+t[s]+")\\."+"("+t[s]+")\\."+"("+t[s]+")";var u=n++;t[u]="(?:"+t[i]+"|"+t[a]+")";var c=n++;t[c]="(?:"+t[s]+"|"+t[a]+")";var l=n++;t[l]="(?:-("+t[u]+"(?:\\."+t[u]+")*))";var p=n++;t[p]="(?:-?("+t[c]+"(?:\\."+t[c]+")*))";var h=n++;t[h]="[0-9A-Za-z-]+";var v=n++;t[v]="(?:\\+("+t[h]+"(?:\\."+t[h]+")*))";var m=n++;var g="v?"+t[o]+t[l]+"?"+t[v]+"?";t[m]="^"+g+"$";var w="[v=\\s]*"+t[f]+t[p]+"?"+t[v]+"?";var d=n++;t[d]="^"+w+"$";var y=n++;t[y]="((?:<|>)?=?)";var b=n++;t[b]=t[s]+"|x|X|\\*";var $=n++;t[$]=t[i]+"|x|X|\\*";var j=n++;t[j]="[v=\\s]*("+t[$]+")"+"(?:\\.("+t[$]+")"+"(?:\\.("+t[$]+")"+"(?:("+t[l]+")"+")?)?)?";var k=n++;t[k]="[v=\\s]*("+t[b]+")"+"(?:\\.("+t[b]+")"+"(?:\\.("+t[b]+")"+"(?:("+t[p]+")"+")?)?)?";var E=n++;t[E]="^"+t[y]+"\\s*"+t[j]+"$";var x=n++;t[x]="^"+t[y]+"\\s*"+t[k]+"$";var R=n++;t[R]="(?:~>?)";var S=n++;t[S]="(\\s*)"+t[R]+"\\s+";r[S]=new RegExp(t[S],"g");var V="$1~";var I=n++;t[I]="^"+t[R]+t[j]+"$";var T=n++;t[T]="^"+t[R]+t[k]+"$";var A=n++;t[A]="(?:\\^)";var C=n++;t[C]="(\\s*)"+t[A]+"\\s+";r[C]=new RegExp(t[C],"g");var M="$1^";var z=n++;t[z]="^"+t[A]+t[j]+"$";var P=n++;t[P]="^"+t[A]+t[k]+"$";var Z=n++;t[Z]="^"+t[y]+"\\s*("+w+")$|^$";var q=n++;t[q]="^"+t[y]+"\\s*("+g+")$|^$";var L=n++;t[L]="(\\s*)"+t[y]+"\\s*("+w+"|"+t[j]+")";r[L]=new RegExp(t[L],"g");var X="$1$2$3";var _=n++;t[_]="^\\s*("+t[j]+")"+"\\s+-\\s+"+"("+t[j]+")"+"\\s*$";var N=n++;t[N]="^\\s*("+t[k]+")"+"\\s+-\\s+"+"("+t[k]+")"+"\\s*$";var O=n++;t[O]="(<|>)?=?\\s*\\*";for(var B=0;B<n;B++){if(!r[B])r[B]=new RegExp(t[B])}e.parse=D;function D(e,t){var n=t?r[d]:r[m];return n.test(e)?new H(e,t):null}e.valid=F;function F(e,r){var t=D(e,r);return t?t.version:null}e.clean=G;function G(e,r){var t=D(e.trim().replace(/^[=v]+/,""),r);return t?t.version:null}e.SemVer=H;function H(e,t){if(e instanceof H){if(e.loose===t)return e;else e=e.version}else if(typeof e!=="string"){throw new TypeError("Invalid Version: "+e)}if(!(this instanceof H))return new H(e,t);this.loose=t;var n=e.trim().match(t?r[d]:r[m]);if(!n)throw new TypeError("Invalid Version: "+e);this.raw=e;this.major=+n[1];this.minor=+n[2];this.patch=+n[3];if(!n[4])this.prerelease=[];else this.prerelease=n[4].split(".").map(function(e){return/^[0-9]+$/.test(e)?+e:e});this.build=n[5]?n[5].split("."):[];this.format()}H.prototype.format=function(){this.version=this.major+"."+this.minor+"."+this.patch;if(this.prerelease.length)this.version+="-"+this.prerelease.join(".");return this.version};H.prototype.inspect=function(){return'<SemVer "'+this+'">'};H.prototype.toString=function(){return this.version};H.prototype.compare=function(e){if(!(e instanceof H))e=new H(e,this.loose);return this.compareMain(e)||this.comparePre(e)};H.prototype.compareMain=function(e){if(!(e instanceof H))e=new H(e,this.loose);return Q(this.major,e.major)||Q(this.minor,e.minor)||Q(this.patch,e.patch)};H.prototype.comparePre=function(e){if(!(e instanceof H))e=new H(e,this.loose);if(this.prerelease.length&&!e.prerelease.length)return-1;else if(!this.prerelease.length&&e.prerelease.length)return 1;else if(!this.prerelease.length&&!e.prerelease.length)return 0;var r=0;do{var t=this.prerelease[r];var n=e.prerelease[r];if(t===undefined&&n===undefined)return 0;else if(n===undefined)return 1;else if(t===undefined)return-1;else if(t===n)continue;else return Q(t,n)}while(++r)};H.prototype.inc=function(e){switch(e){case"premajor":this.inc("major");this.inc("pre");break;case"preminor":this.inc("minor");this.inc("pre");break;case"prepatch":this.prerelease.length=0;this.inc("patch");this.inc("pre");break;case"prerelease":if(this.prerelease.length===0)this.inc("patch");this.inc("pre");break;case"major":this.major++;this.minor=-1;case"minor":this.minor++;this.patch=0;this.prerelease=[];break;case"patch":if(this.prerelease.length===0)this.patch++;this.prerelease=[];break;case"pre":if(this.prerelease.length===0)this.prerelease=[0];else{var r=this.prerelease.length;while(--r>=0){if(typeof this.prerelease[r]==="number"){this.prerelease[r]++;r=-2}}if(r===-1)this.prerelease.push(0)}break;default:throw new Error("invalid increment argument: "+e)}this.format();return this};e.inc=J;function J(e,r,t){try{return new H(e,t).inc(r).version}catch(n){return null}}e.compareIdentifiers=Q;var K=/^[0-9]+$/;function Q(e,r){var t=K.test(e);var n=K.test(r);if(t&&n){e=+e;r=+r}return t&&!n?-1:n&&!t?1:e<r?-1:e>r?1:0}e.rcompareIdentifiers=U;function U(e,r){return Q(r,e)}e.compare=W;function W(e,r,t){return new H(e,t).compare(r)}e.compareLoose=Y;function Y(e,r){return W(e,r,true)}e.rcompare=er;function er(e,r,t){return W(r,e,t)}e.sort=rr;function rr(r,t){return r.sort(function(r,n){return e.compare(r,n,t)})}e.rsort=tr;function tr(r,t){return r.sort(function(r,n){return e.rcompare(r,n,t)})}e.gt=nr;function nr(e,r,t){return W(e,r,t)>0}e.lt=ir;function ir(e,r,t){return W(e,r,t)<0}e.eq=sr;function sr(e,r,t){return W(e,r,t)===0}e.neq=ar;function ar(e,r,t){return W(e,r,t)!==0}e.gte=or;function or(e,r,t){return W(e,r,t)>=0}e.lte=fr;function fr(e,r,t){return W(e,r,t)<=0}e.cmp=ur;function ur(e,r,t,n){var i;switch(r){case"===":i=e===t;break;case"!==":i=e!==t;break;case"":case"=":case"==":i=sr(e,t,n);break;case"!=":i=ar(e,t,n);break;case">":i=nr(e,t,n);break;case">=":i=or(e,t,n);break;case"<":i=ir(e,t,n);break;case"<=":i=fr(e,t,n);break;default:throw new TypeError("Invalid operator: "+r)}return i}e.Comparator=cr;function cr(e,r){if(e instanceof cr){if(e.loose===r)return e;else e=e.value}if(!(this instanceof cr))return new cr(e,r);this.loose=r;this.parse(e);if(this.semver===lr)this.value="";else this.value=this.operator+this.semver.version}var lr={};cr.prototype.parse=function(e){var t=this.loose?r[Z]:r[q];var n=e.match(t);if(!n)throw new TypeError("Invalid comparator: "+e);this.operator=n[1];if(this.operator==="=")this.operator="";if(!n[2])this.semver=lr;else{this.semver=new H(n[2],this.loose);if(this.operator==="<"&&!this.semver.prerelease.length){this.semver.prerelease=["0"];this.semver.format()}}};cr.prototype.inspect=function(){return'<SemVer Comparator "'+this+'">'};cr.prototype.toString=function(){return this.value};cr.prototype.test=function(e){return this.semver===lr?true:ur(e,this.operator,this.semver,this.loose)};e.Range=pr;function pr(e,r){if(e instanceof pr&&e.loose===r)return e;if(!(this instanceof pr))return new pr(e,r);this.loose=r;this.raw=e;this.set=e.split(/\s*\|\|\s*/).map(function(e){return this.parseRange(e.trim())},this).filter(function(e){return e.length});if(!this.set.length){throw new TypeError("Invalid SemVer Range: "+e)}this.format()}pr.prototype.inspect=function(){return'<SemVer Range "'+this.range+'">'};pr.prototype.format=function(){this.range=this.set.map(function(e){return e.join(" ").trim()}).join("||").trim();return this.range};pr.prototype.toString=function(){return this.range};pr.prototype.parseRange=function(e){var t=this.loose;e=e.trim();var n=t?r[N]:r[_];e=e.replace(n,kr);e=e.replace(r[L],X);e=e.replace(r[S],V);e=e.replace(r[C],M);e=e.split(/\s+/).join(" ");var i=t?r[Z]:r[q];var s=e.split(" ").map(function(e){return vr(e,t)}).join(" ").split(/\s+/);if(this.loose){s=s.filter(function(e){return!!e.match(i)})}s=s.map(function(e){return new cr(e,t)});return s};e.toComparators=hr;function hr(e,r){return new pr(e,r).set.map(function(e){return e.map(function(e){return e.value}).join(" ").trim().split(" ")})}function vr(e,r){e=dr(e,r);e=gr(e,r);e=br(e,r);e=jr(e,r);return e}function mr(e){return!e||e.toLowerCase()==="x"||e==="*"}function gr(e,r){return e.trim().split(/\s+/).map(function(e){return wr(e,r)}).join(" ")}function wr(e,t){var n=t?r[T]:r[I];return e.replace(n,function(e,r,t,n,i){var s;if(mr(r))s="";else if(mr(t))s=">="+r+".0.0-0 <"+(+r+1)+".0.0-0";else if(mr(n))s=">="+r+"."+t+".0-0 <"+r+"."+(+t+1)+".0-0";else if(i){if(i.charAt(0)!=="-")i="-"+i;s=">="+r+"."+t+"."+n+i+" <"+r+"."+(+t+1)+".0-0"}else s=">="+r+"."+t+"."+n+"-0"+" <"+r+"."+(+t+1)+".0-0";return s})}function dr(e,r){return e.trim().split(/\s+/).map(function(e){return yr(e,r)}).join(" ")}function yr(e,t){var n=t?r[P]:r[z];return e.replace(n,function(e,r,t,n,i){var s;if(i){if(i.charAt(0)!=="-")i="-"+i}else i="";if(mr(r))s="";else if(mr(t))s=">="+r+".0.0-0 <"+(+r+1)+".0.0-0";else if(mr(n)){if(r==="0")s=">="+r+"."+t+".0-0 <"+r+"."+(+t+1)+".0-0";else s=">="+r+"."+t+".0-0 <"+(+r+1)+".0.0-0"}else if(r==="0")s="="+r+"."+t+"."+n+i;else if(i)s=">="+r+"."+t+"."+n+i+" <"+(+r+1)+".0.0-0";else s=">="+r+"."+t+"."+n+"-0"+" <"+(+r+1)+".0.0-0";return s})}function br(e,r){return e.split(/\s+/).map(function(e){return $r(e,r)}).join(" ")}function $r(e,t){e=e.trim();var n=t?r[x]:r[E];return e.replace(n,function(e,r,t,n,i,s){var a=mr(t);var o=a||mr(n);var f=o||mr(i);var u=f;if(r==="="&&u)r="";if(r&&u){if(a)t=0;if(o)n=0;if(f)i=0;if(r===">"){r=">=";if(a){}else if(o){t=+t+1;n=0;i=0}else if(f){n=+n+1;i=0}}e=r+t+"."+n+"."+i+"-0"}else if(a){e="*"}else if(o){e=">="+t+".0.0-0 <"+(+t+1)+".0.0-0"}else if(f){e=">="+t+"."+n+".0-0 <"+t+"."+(+n+1)+".0-0"}return e})}function jr(e,t){return e.trim().replace(r[O],"")}function kr(e,r,t,n,i,s,a,o,f,u,c,l,p){if(mr(t))r="";else if(mr(n))r=">="+t+".0.0-0";else if(mr(i))r=">="+t+"."+n+".0-0";else r=">="+r;if(mr(f))o="";else if(mr(u))o="<"+(+f+1)+".0.0-0";else if(mr(c))o="<"+f+"."+(+u+1)+".0-0";else if(l)o="<="+f+"."+u+"."+c+"-"+l;else o="<="+o;return(r+" "+o).trim()}pr.prototype.test=function(e){if(!e)return false;for(var r=0;r<this.set.length;r++){if(Er(this.set[r],e))return true}return false};function Er(e,r){for(var t=0;t<e.length;t++){if(!e[t].test(r))return false}return true}e.satisfies=xr;function xr(e,r,t){try{r=new pr(r,t)}catch(n){return false}return r.test(e)}e.maxSatisfying=Rr;function Rr(e,r,t){return e.filter(function(e){return xr(e,r,t)}).sort(function(e,r){return er(e,r,t)})[0]||null}e.validRange=Sr;function Sr(e,r){try{return new pr(e,r).range||"*"}catch(t){return null}}e.ltr=Vr;function Vr(e,r,t){return Tr(e,r,"<",t)}e.gtr=Ir;function Ir(e,r,t){return Tr(e,r,">",t)}e.outside=Tr;function Tr(e,r,t,n){e=new H(e,n);r=new pr(r,n);var i,s,a,o,f;switch(t){case">":i=nr;s=fr;a=ir;o=">";f=">=";break;case"<":i=ir;s=or;a=nr;o="<";f="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(xr(e,r,n)){return false}for(var u=0;u<r.set.length;++u){var c=r.set[u];var l=null;var p=null;c.forEach(function(e){l=l||e;p=p||e;if(i(e.semver,l.semver,n)){l=e}else if(a(e.semver,p.semver,n)){p=e}});if(l.operator===o||l.operator===f){return false}if((!p.operator||p.operator===o)&&s(e,p.semver)){return false}else if(p.operator===f&&a(e,p.semver)){return false}}return true}if(typeof define==="function"&&define.amd)define(e)})(typeof exports==="object"?exports:typeof define==="function"&&define.amd?{}:semver={}); | ||
(function(e){if(typeof module==="object"&&module.exports===e)e=module.exports=H;e.SEMVER_SPEC_VERSION="2.0.0";var r=e.re=[];var t=e.src=[];var n=0;var i=n++;t[i]="0|[1-9]\\d*";var s=n++;t[s]="[0-9]+";var a=n++;t[a]="\\d*[a-zA-Z-][a-zA-Z0-9-]*";var o=n++;t[o]="("+t[i]+")\\."+"("+t[i]+")\\."+"("+t[i]+")";var f=n++;t[f]="("+t[s]+")\\."+"("+t[s]+")\\."+"("+t[s]+")";var u=n++;t[u]="(?:"+t[i]+"|"+t[a]+")";var l=n++;t[l]="(?:"+t[s]+"|"+t[a]+")";var p=n++;t[p]="(?:-("+t[u]+"(?:\\."+t[u]+")*))";var c=n++;t[c]="(?:-?("+t[l]+"(?:\\."+t[l]+")*))";var h=n++;t[h]="[0-9A-Za-z-]+";var v=n++;t[v]="(?:\\+("+t[h]+"(?:\\."+t[h]+")*))";var m=n++;var g="v?"+t[o]+t[p]+"?"+t[v]+"?";t[m]="^"+g+"$";var w="[v=\\s]*"+t[f]+t[c]+"?"+t[v]+"?";var d=n++;t[d]="^"+w+"$";var y=n++;t[y]="((?:<|>)?=?)";var b=n++;t[b]=t[s]+"|x|X|\\*";var j=n++;t[j]=t[i]+"|x|X|\\*";var $=n++;t[$]="[v=\\s]*("+t[j]+")"+"(?:\\.("+t[j]+")"+"(?:\\.("+t[j]+")"+"(?:"+t[p]+")?"+t[v]+"?"+")?)?";var k=n++;t[k]="[v=\\s]*("+t[b]+")"+"(?:\\.("+t[b]+")"+"(?:\\.("+t[b]+")"+"(?:"+t[c]+")?"+t[v]+"?"+")?)?";var E=n++;t[E]="^"+t[y]+"\\s*"+t[$]+"$";var x=n++;t[x]="^"+t[y]+"\\s*"+t[k]+"$";var R=n++;t[R]="(?:~>?)";var S=n++;t[S]="(\\s*)"+t[R]+"\\s+";r[S]=new RegExp(t[S],"g");var V="$1~";var I=n++;t[I]="^"+t[R]+t[$]+"$";var T=n++;t[T]="^"+t[R]+t[k]+"$";var A=n++;t[A]="(?:\\^)";var C=n++;t[C]="(\\s*)"+t[A]+"\\s+";r[C]=new RegExp(t[C],"g");var M="$1^";var z=n++;t[z]="^"+t[A]+t[$]+"$";var N=n++;t[N]="^"+t[A]+t[k]+"$";var P=n++;t[P]="^"+t[y]+"\\s*("+w+")$|^$";var Z=n++;t[Z]="^"+t[y]+"\\s*("+g+")$|^$";var q=n++;t[q]="(\\s*)"+t[y]+"\\s*("+w+"|"+t[$]+")";r[q]=new RegExp(t[q],"g");var L="$1$2$3";var X=n++;t[X]="^\\s*("+t[$]+")"+"\\s+-\\s+"+"("+t[$]+")"+"\\s*$";var _=n++;t[_]="^\\s*("+t[k]+")"+"\\s+-\\s+"+"("+t[k]+")"+"\\s*$";var O=n++;t[O]="(<|>)?=?\\s*\\*";for(var B=0;B<n;B++){if(!r[B])r[B]=new RegExp(t[B])}e.parse=D;function D(e,t){var n=t?r[d]:r[m];return n.test(e)?new H(e,t):null}e.valid=F;function F(e,r){var t=D(e,r);return t?t.version:null}e.clean=G;function G(e,r){var t=D(e.trim().replace(/^[=v]+/,""),r);return t?t.version:null}e.SemVer=H;function H(e,t){if(e instanceof H){if(e.loose===t)return e;else e=e.version}else if(typeof e!=="string"){throw new TypeError("Invalid Version: "+e)}if(!(this instanceof H))return new H(e,t);this.loose=t;var n=e.trim().match(t?r[d]:r[m]);if(!n)throw new TypeError("Invalid Version: "+e);this.raw=e;this.major=+n[1];this.minor=+n[2];this.patch=+n[3];if(!n[4])this.prerelease=[];else this.prerelease=n[4].split(".").map(function(e){return/^[0-9]+$/.test(e)?+e:e});this.build=n[5]?n[5].split("."):[];this.format()}H.prototype.format=function(){this.version=this.major+"."+this.minor+"."+this.patch;if(this.prerelease.length)this.version+="-"+this.prerelease.join(".");return this.version};H.prototype.inspect=function(){return'<SemVer "'+this+'">'};H.prototype.toString=function(){return this.version};H.prototype.compare=function(e){if(!(e instanceof H))e=new H(e,this.loose);return this.compareMain(e)||this.comparePre(e)};H.prototype.compareMain=function(e){if(!(e instanceof H))e=new H(e,this.loose);return Q(this.major,e.major)||Q(this.minor,e.minor)||Q(this.patch,e.patch)};H.prototype.comparePre=function(e){if(!(e instanceof H))e=new H(e,this.loose);if(this.prerelease.length&&!e.prerelease.length)return-1;else if(!this.prerelease.length&&e.prerelease.length)return 1;else if(!this.prerelease.length&&!e.prerelease.length)return 0;var r=0;do{var t=this.prerelease[r];var n=e.prerelease[r];if(t===undefined&&n===undefined)return 0;else if(n===undefined)return 1;else if(t===undefined)return-1;else if(t===n)continue;else return Q(t,n)}while(++r)};H.prototype.inc=function(e,r){switch(e){case"premajor":this.prerelease.length=0;this.patch=0;this.minor=0;this.major++;this.inc("pre",r);break;case"preminor":this.prerelease.length=0;this.patch=0;this.minor++;this.inc("pre",r);break;case"prepatch":this.prerelease.length=0;this.inc("patch",r);this.inc("pre",r);break;case"prerelease":if(this.prerelease.length===0)this.inc("patch",r);this.inc("pre",r);break;case"major":if(this.minor!==0||this.patch!==0||this.prerelease.length===0)this.major++;this.minor=0;this.patch=0;this.prerelease=[];break;case"minor":if(this.patch!==0||this.prerelease.length===0)this.minor++;this.patch=0;this.prerelease=[];break;case"patch":if(this.prerelease.length===0)this.patch++;this.prerelease=[];break;case"pre":if(this.prerelease.length===0)this.prerelease=[0];else{var t=this.prerelease.length;while(--t>=0){if(typeof this.prerelease[t]==="number"){this.prerelease[t]++;t=-2}}if(t===-1)this.prerelease.push(0)}if(r){if(this.prerelease[0]===r){if(isNaN(this.prerelease[1]))this.prerelease=[r,0]}else this.prerelease=[r,0]}break;default:throw new Error("invalid increment argument: "+e)}this.format();return this};e.inc=J;function J(e,r,t,n){if(typeof t==="string"){n=t;t=undefined}try{return new H(e,t).inc(r,n).version}catch(i){return null}}e.compareIdentifiers=Q;var K=/^[0-9]+$/;function Q(e,r){var t=K.test(e);var n=K.test(r);if(t&&n){e=+e;r=+r}return t&&!n?-1:n&&!t?1:e<r?-1:e>r?1:0}e.rcompareIdentifiers=U;function U(e,r){return Q(r,e)}e.compare=W;function W(e,r,t){return new H(e,t).compare(r)}e.compareLoose=Y;function Y(e,r){return W(e,r,true)}e.rcompare=er;function er(e,r,t){return W(r,e,t)}e.sort=rr;function rr(r,t){return r.sort(function(r,n){return e.compare(r,n,t)})}e.rsort=tr;function tr(r,t){return r.sort(function(r,n){return e.rcompare(r,n,t)})}e.gt=nr;function nr(e,r,t){return W(e,r,t)>0}e.lt=ir;function ir(e,r,t){return W(e,r,t)<0}e.eq=sr;function sr(e,r,t){return W(e,r,t)===0}e.neq=ar;function ar(e,r,t){return W(e,r,t)!==0}e.gte=or;function or(e,r,t){return W(e,r,t)>=0}e.lte=fr;function fr(e,r,t){return W(e,r,t)<=0}e.cmp=ur;function ur(e,r,t,n){var i;switch(r){case"===":if(typeof e==="object")e=e.version;if(typeof t==="object")t=t.version;i=e===t;break;case"!==":if(typeof e==="object")e=e.version;if(typeof t==="object")t=t.version;i=e!==t;break;case"":case"=":case"==":i=sr(e,t,n);break;case"!=":i=ar(e,t,n);break;case">":i=nr(e,t,n);break;case">=":i=or(e,t,n);break;case"<":i=ir(e,t,n);break;case"<=":i=fr(e,t,n);break;default:throw new TypeError("Invalid operator: "+r)}return i}e.Comparator=lr;function lr(e,r){if(e instanceof lr){if(e.loose===r)return e;else e=e.value}if(!(this instanceof lr))return new lr(e,r);this.loose=r;this.parse(e);if(this.semver===pr)this.value="";else this.value=this.operator+this.semver.version}var pr={};lr.prototype.parse=function(e){var t=this.loose?r[P]:r[Z];var n=e.match(t);if(!n)throw new TypeError("Invalid comparator: "+e);this.operator=n[1];if(this.operator==="=")this.operator="";if(!n[2])this.semver=pr;else this.semver=new H(n[2],this.loose)};lr.prototype.inspect=function(){return'<SemVer Comparator "'+this+'">'};lr.prototype.toString=function(){return this.value};lr.prototype.test=function(e){if(this.semver===pr)return true;if(typeof e==="string")e=new H(e,this.loose);return ur(e,this.operator,this.semver,this.loose)};e.Range=cr;function cr(e,r){if(e instanceof cr&&e.loose===r)return e;if(!(this instanceof cr))return new cr(e,r);this.loose=r;this.raw=e;this.set=e.split(/\s*\|\|\s*/).map(function(e){return this.parseRange(e.trim())},this).filter(function(e){return e.length});if(!this.set.length){throw new TypeError("Invalid SemVer Range: "+e)}this.format()}cr.prototype.inspect=function(){return'<SemVer Range "'+this.range+'">'};cr.prototype.format=function(){this.range=this.set.map(function(e){return e.join(" ").trim()}).join("||").trim();return this.range};cr.prototype.toString=function(){return this.range};cr.prototype.parseRange=function(e){var t=this.loose;e=e.trim();var n=t?r[_]:r[X];e=e.replace(n,kr);e=e.replace(r[q],L);e=e.replace(r[S],V);e=e.replace(r[C],M);e=e.split(/\s+/).join(" ");var i=t?r[P]:r[Z];var s=e.split(" ").map(function(e){return vr(e,t)}).join(" ").split(/\s+/);if(this.loose){s=s.filter(function(e){return!!e.match(i)})}s=s.map(function(e){return new lr(e,t)});return s};e.toComparators=hr;function hr(e,r){return new cr(e,r).set.map(function(e){return e.map(function(e){return e.value}).join(" ").trim().split(" ")})}function vr(e,r){e=dr(e,r);e=gr(e,r);e=br(e,r);e=$r(e,r);return e}function mr(e){return!e||e.toLowerCase()==="x"||e==="*"}function gr(e,r){return e.trim().split(/\s+/).map(function(e){return wr(e,r)}).join(" ")}function wr(e,t){var n=t?r[T]:r[I];return e.replace(n,function(e,r,t,n,i){var s;if(mr(r))s="";else if(mr(t))s=">="+r+".0.0 <"+(+r+1)+".0.0";else if(mr(n))s=">="+r+"."+t+".0 <"+r+"."+(+t+1)+".0";else if(i){if(i.charAt(0)!=="-")i="-"+i;s=">="+r+"."+t+"."+n+i+" <"+r+"."+(+t+1)+".0"}else s=">="+r+"."+t+"."+n+" <"+r+"."+(+t+1)+".0";return s})}function dr(e,r){return e.trim().split(/\s+/).map(function(e){return yr(e,r)}).join(" ")}function yr(e,t){var n=t?r[N]:r[z];return e.replace(n,function(e,r,t,n,i){var s;if(mr(r))s="";else if(mr(t))s=">="+r+".0.0 <"+(+r+1)+".0.0";else if(mr(n)){if(r==="0")s=">="+r+"."+t+".0 <"+r+"."+(+t+1)+".0";else s=">="+r+"."+t+".0 <"+(+r+1)+".0.0"}else if(i){if(i.charAt(0)!=="-")i="-"+i;if(r==="0"){if(t==="0")s=">="+r+"."+t+"."+n+i+" <"+r+"."+t+"."+(+n+1);else s=">="+r+"."+t+"."+n+i+" <"+r+"."+(+t+1)+".0"}else s=">="+r+"."+t+"."+n+i+" <"+(+r+1)+".0.0"}else{if(r==="0"){if(t==="0")s=">="+r+"."+t+"."+n+" <"+r+"."+t+"."+(+n+1);else s=">="+r+"."+t+"."+n+" <"+r+"."+(+t+1)+".0"}else s=">="+r+"."+t+"."+n+" <"+(+r+1)+".0.0"}return s})}function br(e,r){return e.split(/\s+/).map(function(e){return jr(e,r)}).join(" ")}function jr(e,t){e=e.trim();var n=t?r[x]:r[E];return e.replace(n,function(e,r,t,n,i,s){var a=mr(t);var o=a||mr(n);var f=o||mr(i);var u=f;if(r==="="&&u)r="";if(a){if(r===">"||r==="<"){e="<0.0.0"}else{e="*"}}else if(r&&u){if(o)n=0;if(f)i=0;if(r===">"){r=">=";if(o){t=+t+1;n=0;i=0}else if(f){n=+n+1;i=0}}else if(r==="<="){r="<";if(o)t=+t+1;else n=+n+1}e=r+t+"."+n+"."+i}else if(o){e=">="+t+".0.0 <"+(+t+1)+".0.0"}else if(f){e=">="+t+"."+n+".0 <"+t+"."+(+n+1)+".0"}return e})}function $r(e,t){return e.trim().replace(r[O],"")}function kr(e,r,t,n,i,s,a,o,f,u,l,p,c){if(mr(t))r="";else if(mr(n))r=">="+t+".0.0";else if(mr(i))r=">="+t+"."+n+".0";else r=">="+r;if(mr(f))o="";else if(mr(u))o="<"+(+f+1)+".0.0";else if(mr(l))o="<"+f+"."+(+u+1)+".0";else if(p)o="<="+f+"."+u+"."+l+"-"+p;else o="<="+o;return(r+" "+o).trim()}cr.prototype.test=function(e){if(!e)return false;if(typeof e==="string")e=new H(e,this.loose);for(var r=0;r<this.set.length;r++){if(Er(this.set[r],e))return true}return false};function Er(e,r){for(var t=0;t<e.length;t++){if(!e[t].test(r))return false}if(r.prerelease.length){for(var t=0;t<e.length;t++){if(e[t].semver===pr)return true;if(e[t].semver.prerelease.length>0){var n=e[t].semver;if(n.major===r.major&&n.minor===r.minor&&n.patch===r.patch)return true}}return false}return true}e.satisfies=xr;function xr(e,r,t){try{r=new cr(r,t)}catch(n){return false}return r.test(e)}e.maxSatisfying=Rr;function Rr(e,r,t){return e.filter(function(e){return xr(e,r,t)}).sort(function(e,r){return er(e,r,t)})[0]||null}e.validRange=Sr;function Sr(e,r){try{return new cr(e,r).range||"*"}catch(t){return null}}e.ltr=Vr;function Vr(e,r,t){return Tr(e,r,"<",t)}e.gtr=Ir;function Ir(e,r,t){return Tr(e,r,">",t)}e.outside=Tr;function Tr(e,r,t,n){e=new H(e,n);r=new cr(r,n);var i,s,a,o,f;switch(t){case">":i=nr;s=fr;a=ir;o=">";f=">=";break;case"<":i=ir;s=or;a=nr;o="<";f="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(xr(e,r,n)){return false}for(var u=0;u<r.set.length;++u){var l=r.set[u];var p=null;var c=null;l.forEach(function(e){p=p||e;c=c||e;if(i(e.semver,p.semver,n)){p=e}else if(a(e.semver,c.semver,n)){c=e}});if(p.operator===o||p.operator===f){return false}if((!c.operator||c.operator===o)&&s(e,c.semver)){return false}else if(c.operator===f&&a(e,c.semver)){return false}}return true}if(typeof define==="function"&&define.amd)define(e)})(typeof exports==="object"?exports:typeof define==="function"&&define.amd?{}:semver={}); |
@@ -17,3 +17,7 @@ var tap = require('tap'); | ||
[' v1.2.3 ', '1.2.3'], | ||
['\t1.2.3', '1.2.3'] | ||
['\t1.2.3', '1.2.3'], | ||
['>1.2.3', null], | ||
['~1.2.3', null], | ||
['<=1.2.3', null], | ||
['1.2.x', null] | ||
].forEach(function(tuple) { | ||
@@ -20,0 +24,0 @@ var range = tuple[0]; |
@@ -42,3 +42,3 @@ var tap = require('tap'); | ||
['=0.7.x', '0.8.0-asdf'], | ||
['<=0.7.x', '0.7.0'], | ||
['<0.7.x', '0.7.0'], | ||
['~1.2.2', '1.3.0'], | ||
@@ -70,3 +70,3 @@ ['1.0.0 - 2.0.0', '2.2.3'], | ||
['=0.7.x', '0.8.2'], | ||
['<=0.7.x', '0.7.2'] | ||
['<0.7.x', '0.7.2'] | ||
].forEach(function(tuple) { | ||
@@ -73,0 +73,0 @@ var range = tuple[0]; |
@@ -135,2 +135,11 @@ 'use strict'; | ||
[['1.0.0 - 2.0.0', '1.2.3'], | ||
['^1.2.3+build', '1.2.3'], | ||
['^1.2.3+build', '1.3.0'], | ||
['1.2.3-pre+asdf - 2.4.3-pre+asdf', '1.2.3'], | ||
['1.2.3pre+asdf - 2.4.3-pre+asdf', '1.2.3', true], | ||
['1.2.3-pre+asdf - 2.4.3pre+asdf', '1.2.3', true], | ||
['1.2.3pre+asdf - 2.4.3pre+asdf', '1.2.3', true], | ||
['1.2.3-pre+asdf - 2.4.3-pre+asdf', '1.2.3-pre.2'], | ||
['1.2.3-pre+asdf - 2.4.3-pre+asdf', '2.4.3-alpha'], | ||
['1.2.3+asdf - 2.4.3+asdf', '1.2.3'], | ||
['1.0.0', '1.0.0'], | ||
@@ -193,9 +202,7 @@ ['>=*', '0.2.4'], | ||
['< 1.2', '1.1.1'], | ||
['1', '1.0.0beta', true], | ||
['~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.2'], | ||
['=0.7.x', '0.7.0-asdf'], | ||
['>=0.7.x', '0.7.0-asdf'], | ||
['<=0.7.x', '0.6.2'], | ||
@@ -212,7 +219,4 @@ ['~1.2.1 >=1.2.3', '1.2.3'], | ||
['>=1.2.1 >=1.2.3', '1.2.3'], | ||
['<=1.2.3', '1.2.3-beta'], | ||
['>1.2', '1.3.0-beta'], | ||
['>=1.2', '1.2.8'], | ||
['^1.2.3', '1.8.1'], | ||
['^1.2.3', '1.2.3-beta'], | ||
['^0.1.2', '0.1.2'], | ||
@@ -222,4 +226,5 @@ ['^0.1', '0.1.2'], | ||
['^1.2 ^1', '1.4.2'], | ||
['^1.2', '1.2.0-pre'], | ||
['^1.2.3', '1.2.3-pre'] | ||
['^1.2.3-alpha', '1.2.3-pre'], | ||
['^1.2.0-alpha', '1.2.0-pre'], | ||
['^0.0.1-alpha', '0.0.1-beta'] | ||
].forEach(function(v) { | ||
@@ -238,2 +243,16 @@ var range = v[0]; | ||
[['1.0.0 - 2.0.0', '2.2.3'], | ||
['1.2.3+asdf - 2.4.3+asdf', '1.2.3-pre.2'], | ||
['1.2.3+asdf - 2.4.3+asdf', '2.4.3-alpha'], | ||
['^1.2.3+build', '2.0.0'], | ||
['^1.2.3+build', '1.2.0'], | ||
['^1.2.3', '1.2.3-pre'], | ||
['^1.2', '1.2.0-pre'], | ||
['>1.2', '1.3.0-beta'], | ||
['<=1.2.3', '1.2.3-beta'], | ||
['^1.2.3', '1.2.3-beta'], | ||
['=0.7.x', '0.7.0-asdf'], | ||
['>=0.7.x', '0.7.0-asdf'], | ||
['1', '1.0.0beta', true], | ||
['<1', '1.0.0beta', true], | ||
['< 1', '1.0.0beta', true], | ||
['1.0.0', '1.0.1'], | ||
@@ -278,7 +297,5 @@ ['>=1.0.0', '0.0.0'], | ||
['~v0.5.4-beta', '0.5.4-alpha'], | ||
['<1', '1.0.0beta', true], | ||
['< 1', '1.0.0beta', true], | ||
['=0.7.x', '0.8.2'], | ||
['>=0.7.x', '0.6.2'], | ||
['<=0.7.x', '0.7.2'], | ||
['<0.7.x', '0.7.2'], | ||
['<1.2.3', '1.2.3-beta'], | ||
@@ -305,4 +322,4 @@ ['=1.2.3', '1.2.3-beta'], | ||
test('\nincrement versions test', function(t) { | ||
// [version, inc, result] | ||
// inc(version, inc) -> result | ||
// [version, inc, result, identifier] | ||
// inc(version, inc) -> result | ||
[['1.2.3', 'major', '2.0.0'], | ||
@@ -342,6 +359,49 @@ ['1.2.3', 'minor', '1.3.0'], | ||
['1.2.0', 'preminor', '1.3.0-0'], | ||
['1.2.0-1', 'preminor', '1.3.0-0'], | ||
['1.2.3-1', 'preminor', '1.3.0-0'], | ||
['1.2.0', 'premajor', '2.0.0-0'], | ||
['1.2.0-1', 'premajor', '2.0.0-0'] | ||
['1.2.3-1', 'premajor', '2.0.0-0'], | ||
['1.2.0-1', 'minor', '1.2.0'], | ||
['1.0.0-1', 'major', '1.0.0'], | ||
['1.2.3', 'major', '2.0.0', false, 'dev'], | ||
['1.2.3', 'minor', '1.3.0', false, 'dev'], | ||
['1.2.3', 'patch', '1.2.4', false, 'dev'], | ||
['1.2.3tag', 'major', '2.0.0', true, 'dev'], | ||
['1.2.3-tag', 'major', '2.0.0', false, 'dev'], | ||
['1.2.3', 'fake', null, false, 'dev'], | ||
['1.2.0-0', 'patch', '1.2.0', false, 'dev'], | ||
['fake', 'major', null, false, 'dev'], | ||
['1.2.3-4', 'major', '2.0.0', false, 'dev'], | ||
['1.2.3-4', 'minor', '1.3.0', false, 'dev'], | ||
['1.2.3-4', 'patch', '1.2.3', false, 'dev'], | ||
['1.2.3-alpha.0.beta', 'major', '2.0.0', false, 'dev'], | ||
['1.2.3-alpha.0.beta', 'minor', '1.3.0', false, 'dev'], | ||
['1.2.3-alpha.0.beta', 'patch', '1.2.3', false, 'dev'], | ||
['1.2.4', 'prerelease', '1.2.5-dev.0', false, 'dev'], | ||
['1.2.3-0', 'prerelease', '1.2.3-dev.0', false, 'dev'], | ||
['1.2.3-alpha.0', 'prerelease', '1.2.3-dev.0', false, 'dev'], | ||
['1.2.3-alpha.0', 'prerelease', '1.2.3-alpha.1', false, 'alpha'], | ||
['1.2.3-alpha.0.beta', 'prerelease', '1.2.3-dev.0', false, 'dev'], | ||
['1.2.3-alpha.0.beta', 'prerelease', '1.2.3-alpha.1.beta', false, 'alpha'], | ||
['1.2.3-alpha.10.0.beta', 'prerelease', '1.2.3-dev.0', false, 'dev'], | ||
['1.2.3-alpha.10.0.beta', 'prerelease', '1.2.3-alpha.10.1.beta', false, 'alpha'], | ||
['1.2.3-alpha.10.1.beta', 'prerelease', '1.2.3-alpha.10.2.beta', false, 'alpha'], | ||
['1.2.3-alpha.10.2.beta', 'prerelease', '1.2.3-alpha.10.3.beta', false, 'alpha'], | ||
['1.2.3-alpha.10.beta.0', 'prerelease', '1.2.3-dev.0', false, 'dev'], | ||
['1.2.3-alpha.10.beta.0', 'prerelease', '1.2.3-alpha.10.beta.1', false, 'alpha'], | ||
['1.2.3-alpha.10.beta.1', 'prerelease', '1.2.3-alpha.10.beta.2', false, 'alpha'], | ||
['1.2.3-alpha.10.beta.2', 'prerelease', '1.2.3-alpha.10.beta.3', false, 'alpha'], | ||
['1.2.3-alpha.9.beta', 'prerelease', '1.2.3-dev.0', false, 'dev'], | ||
['1.2.3-alpha.9.beta', 'prerelease', '1.2.3-alpha.10.beta', false, 'alpha'], | ||
['1.2.3-alpha.10.beta', 'prerelease', '1.2.3-alpha.11.beta', false, 'alpha'], | ||
['1.2.3-alpha.11.beta', 'prerelease', '1.2.3-alpha.12.beta', false, 'alpha'], | ||
['1.2.0', 'prepatch', '1.2.1-dev.0', 'dev'], | ||
['1.2.0-1', 'prepatch', '1.2.1-dev.0', 'dev'], | ||
['1.2.0', 'preminor', '1.3.0-dev.0', 'dev'], | ||
['1.2.3-1', 'preminor', '1.3.0-dev.0', 'dev'], | ||
['1.2.0', 'premajor', '2.0.0-dev.0', 'dev'], | ||
['1.2.3-1', 'premajor', '2.0.0-dev.0', 'dev'], | ||
['1.2.0-1', 'minor', '1.2.0', 'dev'], | ||
['1.0.0-1', 'major', '1.0.0', 'dev'], | ||
['1.2.3-dev.bar', 'prerelease', '1.2.3-dev.0', false, 'dev'] | ||
@@ -353,4 +413,6 @@ ].forEach(function(v) { | ||
var loose = v[3]; | ||
var found = inc(pre, what, loose); | ||
t.equal(found, wanted, 'inc(' + pre + ', ' + what + ') === ' + wanted); | ||
var id = v[4]; | ||
var found = inc(pre, what, loose, id); | ||
var cmd = 'inc(' + pre + ', ' + what + ', ' + id + ')'; | ||
t.equal(found, wanted, cmd + ' === ' + wanted); | ||
}); | ||
@@ -367,3 +429,3 @@ | ||
['1.0.0', '1.0.0'], | ||
['>=*', '>=0.0.0-0'], | ||
['>=*', '*'], | ||
['', '*'], | ||
@@ -375,7 +437,7 @@ ['*', '*'], | ||
['<=2.0.0', '<=2.0.0'], | ||
['1', '>=1.0.0-0 <2.0.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-0'], | ||
['<2.0.0', '<2.0.0-0'], | ||
['<2.0.0', '<2.0.0'], | ||
['<2.0.0', '<2.0.0'], | ||
['>= 1.0.0', '>=1.0.0'], | ||
@@ -389,52 +451,52 @@ ['>= 1.0.0', '>=1.0.0'], | ||
['<= 2.0.0', '<=2.0.0'], | ||
['< 2.0.0', '<2.0.0-0'], | ||
['< 2.0.0', '<2.0.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'], | ||
['>=0.2.3 || <0.0.1', '>=0.2.3||<0.0.1-0'], | ||
['>=0.2.3 || <0.0.1', '>=0.2.3||<0.0.1-0'], | ||
['>=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-0 <3.0.0-0'], | ||
['1.2.x', '>=1.2.0-0 <1.3.0-0'], | ||
['1.2.x || 2.x', '>=1.2.0-0 <1.3.0-0||>=2.0.0-0 <3.0.0-0'], | ||
['1.2.x || 2.x', '>=1.2.0-0 <1.3.0-0||>=2.0.0-0 <3.0.0-0'], | ||
['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-0 <3.0.0-0'], | ||
['1.2.*', '>=1.2.0-0 <1.3.0-0'], | ||
['1.2.* || 2.*', '>=1.2.0-0 <1.3.0-0||>=2.0.0-0 <3.0.0-0'], | ||
['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'], | ||
['*', '*'], | ||
['2', '>=2.0.0-0 <3.0.0-0'], | ||
['2.3', '>=2.3.0-0 <2.4.0-0'], | ||
['~2.4', '>=2.4.0-0 <2.5.0-0'], | ||
['~2.4', '>=2.4.0-0 <2.5.0-0'], | ||
['~>3.2.1', '>=3.2.1-0 <3.3.0-0'], | ||
['~1', '>=1.0.0-0 <2.0.0-0'], | ||
['~>1', '>=1.0.0-0 <2.0.0-0'], | ||
['~> 1', '>=1.0.0-0 <2.0.0-0'], | ||
['~1.0', '>=1.0.0-0 <1.1.0-0'], | ||
['~ 1.0', '>=1.0.0-0 <1.1.0-0'], | ||
['^0', '>=0.0.0-0 <1.0.0-0'], | ||
['^ 1', '>=1.0.0-0 <2.0.0-0'], | ||
['^0.1', '>=0.1.0-0 <0.2.0-0'], | ||
['^1.0', '>=1.0.0-0 <2.0.0-0'], | ||
['^1.2', '>=1.2.0-0 <2.0.0-0'], | ||
['^0.0.1', '0.0.1'], | ||
['^0.0.1-beta', '0.0.1-beta'], | ||
['^0.1.2', '0.1.2'], | ||
['^1.2.3', '>=1.2.3-0 <2.0.0-0'], | ||
['^1.2.3-beta.4', '>=1.2.3-beta.4 <2.0.0-0'], | ||
['<1', '<1.0.0-0'], | ||
['< 1', '<1.0.0-0'], | ||
['>=1', '>=1.0.0-0'], | ||
['>= 1', '>=1.0.0-0'], | ||
['<1.2', '<1.2.0-0'], | ||
['< 1.2', '<1.2.0-0'], | ||
['1', '>=1.0.0-0 <2.0.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'], | ||
['^0', '>=0.0.0 <1.0.0'], | ||
['^ 1', '>=1.0.0 <2.0.0'], | ||
['^0.1', '>=0.1.0 <0.2.0'], | ||
['^1.0', '>=1.0.0 <2.0.0'], | ||
['^1.2', '>=1.2.0 <2.0.0'], | ||
['^0.0.1', '>=0.0.1 <0.0.2'], | ||
['^0.0.1-beta', '>=0.0.1-beta <0.0.2'], | ||
['^0.1.2', '>=0.1.2 <0.2.0'], | ||
['^1.2.3', '>=1.2.3 <2.0.0'], | ||
['^1.2.3-beta.4', '>=1.2.3-beta.4 <2.0.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'], | ||
['>01.02.03', '>1.2.3', true], | ||
['>01.02.03', null], | ||
['~1.2.3beta', '>=1.2.3-beta <1.3.0-0', true], | ||
['~1.2.3beta', '>=1.2.3-beta <1.3.0', true], | ||
['~1.2.3beta', null], | ||
['^ 1.2 ^ 1', '>=1.2.0-0 <2.0.0-0 >=1.0.0-0 <2.0.0-0'] | ||
['^ 1.2 ^ 1', '>=1.2.0 <2.0.0 >=1.0.0 <2.0.0'] | ||
].forEach(function(v) { | ||
@@ -457,3 +519,3 @@ var pre = v[0]; | ||
['1.0.0', [['1.0.0']]], | ||
['>=*', [['>=0.0.0-0']]], | ||
['>=*', [['']]], | ||
['', [['']]], | ||
@@ -468,7 +530,7 @@ ['*', [['']]], | ||
['<=2.0.0', [['<=2.0.0']]], | ||
['1', [['>=1.0.0-0', '<2.0.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-0']]], | ||
['<2.0.0', [['<2.0.0-0']]], | ||
['<2.0.0', [['<2.0.0']]], | ||
['<2.0.0', [['<2.0.0']]], | ||
['>= 1.0.0', [['>=1.0.0']]], | ||
@@ -482,43 +544,46 @@ ['>= 1.0.0', [['>=1.0.0']]], | ||
['<= 2.0.0', [['<=2.0.0']]], | ||
['< 2.0.0', [['<2.0.0-0']]], | ||
['<\t2.0.0', [['<2.0.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']]], | ||
['>=0.2.3 || <0.0.1', [['>=0.2.3'], ['<0.0.1-0']]], | ||
['>=0.2.3 || <0.0.1', [['>=0.2.3'], ['<0.0.1-0']]], | ||
['>=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-0', '<3.0.0-0']]], | ||
['1.2.x', [['>=1.2.0-0', '<1.3.0-0']]], | ||
['1.2.x || 2.x', [['>=1.2.0-0', '<1.3.0-0'], ['>=2.0.0-0', '<3.0.0-0']]], | ||
['1.2.x || 2.x', [['>=1.2.0-0', '<1.3.0-0'], ['>=2.0.0-0', '<3.0.0-0']]], | ||
['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-0', '<3.0.0-0']]], | ||
['1.2.*', [['>=1.2.0-0', '<1.3.0-0']]], | ||
['1.2.* || 2.*', [['>=1.2.0-0', '<1.3.0-0'], ['>=2.0.0-0', '<3.0.0-0']]], | ||
['1.2.* || 2.*', [['>=1.2.0-0', '<1.3.0-0'], ['>=2.0.0-0', '<3.0.0-0']]], | ||
['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-0', '<3.0.0-0']]], | ||
['2.3', [['>=2.3.0-0', '<2.4.0-0']]], | ||
['~2.4', [['>=2.4.0-0', '<2.5.0-0']]], | ||
['~2.4', [['>=2.4.0-0', '<2.5.0-0']]], | ||
['~>3.2.1', [['>=3.2.1-0', '<3.3.0-0']]], | ||
['~1', [['>=1.0.0-0', '<2.0.0-0']]], | ||
['~>1', [['>=1.0.0-0', '<2.0.0-0']]], | ||
['~> 1', [['>=1.0.0-0', '<2.0.0-0']]], | ||
['~1.0', [['>=1.0.0-0', '<1.1.0-0']]], | ||
['~ 1.0', [['>=1.0.0-0', '<1.1.0-0']]], | ||
['~ 1.0.3', [['>=1.0.3-0', '<1.1.0-0']]], | ||
['~> 1.0.3', [['>=1.0.3-0', '<1.1.0-0']]], | ||
['<1', [['<1.0.0-0']]], | ||
['< 1', [['<1.0.0-0']]], | ||
['>=1', [['>=1.0.0-0']]], | ||
['>= 1', [['>=1.0.0-0']]], | ||
['<1.2', [['<1.2.0-0']]], | ||
['< 1.2', [['<1.2.0-0']]], | ||
['1', [['>=1.0.0-0', '<2.0.0-0']]], | ||
['1 2', [['>=1.0.0-0', '<2.0.0-0', '>=2.0.0-0', '<3.0.0-0']]], | ||
['1.2 - 3.4.5', [['>=1.2.0-0', '<=3.4.5']]], | ||
['1.2.3 - 3.4', [['>=1.2.3', '<3.5.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.0.3', [['>=1.0.3', '<1.1.0']]], | ||
['~> 1.0.3', [['>=1.0.3', '<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']]], | ||
['1 2', [['>=1.0.0', '<2.0.0', '>=2.0.0', '<3.0.0']]], | ||
['1.2 - 3.4.5', [['>=1.2.0', '<=3.4.5']]], | ||
['1.2.3 - 3.4', [['>=1.2.3', '<3.5.0']]], | ||
['1.2.3 - 3', [['>=1.2.3', '<4.0.0']]], | ||
['>*', [['<0.0.0']]], | ||
['<*', [['<0.0.0']]] | ||
].forEach(function(v) { | ||
@@ -577,3 +642,3 @@ var pre = v[0]; | ||
[['>=01.02.03', '>=1.2.3'], | ||
['~1.02.03beta', '>=1.2.3-beta <1.3.0-0'] | ||
['~1.02.03beta', '>=1.2.3-beta <1.3.0'] | ||
].forEach(function(v) { | ||
@@ -580,0 +645,0 @@ var loose = v[0]; |
@@ -69,2 +69,6 @@ var tap = require('tap'); | ||
['=0.7.x', '0.6.2'], | ||
['=0.7.x', '0.7.0-asdf'], | ||
['^1', '1.0.0-0'], | ||
['>=0.7.x', '0.7.0-asdf'], | ||
['1', '1.0.0beta', true], | ||
['>=0.7.x', '0.6.2'] | ||
@@ -149,3 +153,2 @@ ].forEach(function(tuple) { | ||
['< 1.2', '1.1.1'], | ||
['1', '1.0.0beta', true], | ||
['~v0.5.4-pre', '0.5.5'], | ||
@@ -155,4 +158,2 @@ ['~v0.5.4-pre', '0.5.4'], | ||
['>=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'], | ||
@@ -162,3 +163,2 @@ ['>0.2.3 >0.2.4 <=0.2.5', '0.2.5'], | ||
['1.0.0 - 2.0.0', '2.0.0'], | ||
['^1', '1.0.0-0'], | ||
['^3.0.0', '4.0.0'], | ||
@@ -170,2 +170,8 @@ ['^1.0.0 || ~2.0.1', '2.0.0'], | ||
['^0.1.0 || ~3.0.1 || >4 <=5.0.0', '3.5.0'], | ||
['^1.0.0alpha', '1.0.0beta', true], | ||
['~1.0.0alpha', '1.0.0beta', true], | ||
['^1.0.0-alpha', '1.0.0beta', true], | ||
['~1.0.0-alpha', '1.0.0beta', true], | ||
['^1.0.0-alpha', '1.0.0-beta'], | ||
['~1.0.0-alpha', '1.0.0-beta'], | ||
['=0.1.0', '1.0.0'] | ||
@@ -172,0 +178,0 @@ ].forEach(function(tuple) { |
@@ -7,5 +7,5 @@ var tap = require('tap'); | ||
var vm = require('vm'); | ||
var head = fs.readFileSync(require.resolve('../head.js'), 'utf8'); | ||
var head = fs.readFileSync(require.resolve('../head.js.txt'), 'utf8'); | ||
var src = fs.readFileSync(require.resolve('../'), 'utf8'); | ||
var foot = fs.readFileSync(require.resolve('../foot.js'), 'utf8'); | ||
var foot = fs.readFileSync(require.resolve('../foot.js.txt'), 'utf8'); | ||
vm.runInThisContext(head + src + foot, 'semver.js'); | ||
@@ -12,0 +12,0 @@ |
@@ -61,3 +61,4 @@ { | ||
"_shasum": "06e1ea8082c2cb14e39806e22e2f6f757f92af39", | ||
"_resolved": "https://registry.npmjs.org/debug/-/debug-0.7.4.tgz" | ||
"_resolved": "https://registry.npmjs.org/debug/-/debug-0.7.4.tgz", | ||
"readme": "ERROR: No README data found!" | ||
} |
@@ -51,3 +51,5 @@ { | ||
"_shasum": "eea3033f0c3728139de7b57ab1b0d6d89c353c63", | ||
"_resolved": "https://registry.npmjs.org/fstream-ignore/-/fstream-ignore-0.0.7.tgz" | ||
"_resolved": "https://registry.npmjs.org/fstream-ignore/-/fstream-ignore-0.0.7.tgz", | ||
"readme": "ERROR: No README data found!", | ||
"homepage": "https://github.com/isaacs/fstream-ignore" | ||
} |
@@ -55,3 +55,4 @@ { | ||
"directories": {}, | ||
"_resolved": "https://registry.npmjs.org/fstream/-/fstream-0.1.31.tgz" | ||
"_resolved": "https://registry.npmjs.org/fstream/-/fstream-0.1.31.tgz", | ||
"readme": "ERROR: No README data found!" | ||
} |
@@ -62,3 +62,5 @@ { | ||
"_shasum": "15a4806a57547cb2d2dbf27f42e89a8c3451b364", | ||
"_resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-1.2.3.tgz" | ||
"_resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-1.2.3.tgz", | ||
"readme": "ERROR: No README data found!", | ||
"homepage": "https://github.com/isaacs/node-graceful-fs" | ||
} |
@@ -50,3 +50,8 @@ { | ||
"_from": "once@~1.1.1", | ||
"_resolved": "https://registry.npmjs.org/once/-/once-1.1.1.tgz" | ||
"_resolved": "https://registry.npmjs.org/once/-/once-1.1.1.tgz", | ||
"bugs": { | ||
"url": "https://github.com/isaacs/once/issues" | ||
}, | ||
"readme": "ERROR: No README data found!", | ||
"homepage": "https://github.com/isaacs/once" | ||
} |
@@ -52,3 +52,4 @@ { | ||
"_shasum": "6b07085aef9a3ccac6ee53bf9d3df0c1521a5538", | ||
"_resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.1.tgz" | ||
"_resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.1.tgz", | ||
"scripts": {} | ||
} |
@@ -52,3 +52,4 @@ { | ||
"directories": {}, | ||
"_resolved": "https://registry.npmjs.org/tar/-/tar-0.1.20.tgz" | ||
"_resolved": "https://registry.npmjs.org/tar/-/tar-0.1.20.tgz", | ||
"readme": "ERROR: No README data found!" | ||
} |
@@ -44,3 +44,8 @@ { | ||
"_from": "uid-number@0.0.3", | ||
"_resolved": "https://registry.npmjs.org/uid-number/-/uid-number-0.0.3.tgz" | ||
"_resolved": "https://registry.npmjs.org/uid-number/-/uid-number-0.0.3.tgz", | ||
"bugs": { | ||
"url": "https://github.com/isaacs/uid-number/issues" | ||
}, | ||
"readme": "ERROR: No README data found!", | ||
"homepage": "https://github.com/isaacs/uid-number" | ||
} |
@@ -53,3 +53,7 @@ { | ||
"_shasum": "c2c401c02dd366138645e917b3a6baa256a9dcab", | ||
"_resolved": "https://registry.npmjs.org/tar-pack/-/tar-pack-2.0.0.tgz" | ||
"_resolved": "https://registry.npmjs.org/tar-pack/-/tar-pack-2.0.0.tgz", | ||
"bugs": { | ||
"url": "https://github.com/ForbesLindesay/tar-pack/issues" | ||
}, | ||
"homepage": "https://github.com/ForbesLindesay/tar-pack" | ||
} |
@@ -69,3 +69,4 @@ { | ||
}, | ||
"_resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-3.0.4.tgz" | ||
"_resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-3.0.4.tgz", | ||
"readme": "ERROR: No README data found!" | ||
} |
@@ -36,3 +36,3 @@ { | ||
"_shasum": "6075b5a1f236defe0c7e3756d3d9b3ebdad0f19a", | ||
"_from": "tar@~1.0.0", | ||
"_from": "tar@~1.0.1", | ||
"_npmVersion": "1.4.23", | ||
@@ -39,0 +39,0 @@ "_npmUser": { |
{ | ||
"name": "node-pre-gyp", | ||
"description": "Node.js native addon binary install tool", | ||
"version" : "0.5.28", | ||
"version" : "0.5.29", | ||
"keywords": [ | ||
@@ -26,7 +26,7 @@ "native", | ||
"request": "2.x", | ||
"semver": "~3.0.1", | ||
"tar": "~1.0.0", | ||
"semver": "~4.1.0", | ||
"tar": "~1.0.1", | ||
"tar-pack":"~2.0.0", | ||
"mkdirp":"~0.5.0", | ||
"rc":"~0.5.0", | ||
"rc":"~0.5.1", | ||
"rimraf":"~2.2.8" | ||
@@ -33,0 +33,0 @@ }, |
@@ -5,3 +5,3 @@ # node-pre-gyp | ||
[![NPM](https://nodei.co/npm/node-pre-gyp.png)](https://nodei.co/npm/node-pre-gyp/) | ||
[![NPM](https://nodei.co/npm/node-pre-gyp.png?downloads=true&downloadRank=true)](https://nodei.co/npm/node-pre-gyp/) | ||
@@ -28,2 +28,6 @@ [![Build Status](https://api.travis-ci.org/mapbox/node-pre-gyp.svg)](https://travis-ci.org/mapbox/node-pre-gyp) | ||
## FAQ | ||
See the [Frequently Ask Questions](https://github.com/mapbox/node-pre-gyp/wiki/FAQ). | ||
## Depends | ||
@@ -411,3 +415,3 @@ | ||
- Ubuntu Precise and OS X | ||
- Ubuntu Precise and OS X (64 bit) | ||
- Multiple Node.js versions | ||
@@ -417,2 +421,4 @@ | ||
Note: if you need 32 bit binaries, this can be done from a 64 bit travis machine. See [the node-sqlite3 scripts for an example of doing this](https://github.com/mapbox/node-sqlite3/blob/bae122aa6a2b8a45f6b717fab24e207740e32b5d/scripts/build_against_node.sh#L54-L74). | ||
Below is a guide to getting set up: | ||
@@ -494,3 +500,3 @@ | ||
COMMIT_MESSAGE=$(git show -s --format=%B $TRAVIS_COMMIT | tr -d '\n') | ||
if test "${COMMIT_MESSAGE#*'[publish binary]'}" != "$COMMIT_MESSAGE"; then node-pre-gyp publish; fi; | ||
if [[ ${COMMIT_MESSAGE} =~ "[publish binary]" ]]; then node-pre-gyp publish; fi; | ||
@@ -511,11 +517,13 @@ Then you can trigger new binaries to be built like: | ||
- `node_abi`: The node C++ `ABI` number. This value is available in javascript as `process.versions.modules` as of [`>= v0.10.4 >= v0.11.7`](https://github.com/joyent/node/commit/ccabd4a6fa8a6eb79d29bc3bbe9fe2b6531c2d8e) and in C++ as the `NODE_MODULE_VERSION` define much earlier. For versions of Node before this was available we fallback to the V8 major and minor version. | ||
- `platform` matches node's `process.platform` like `linux`, `darwin`, and `win32` unless the user passed the `--target_platform` option to override. | ||
- `arch` matches node's `process.arch` like `x64` or `ia32` unless the user passes the `--target_arch` option to override. | ||
- `configuration` - Either 'Release' or 'Debug' depending on if `--debug` is passed during the build. | ||
- `module_name` - the `binary.module_name` attribute from `package.json`. | ||
- `version` - the semver `version` value for your module from `package.json`. | ||
- `version` - the semver `version` value for your module from `package.json` (NOTE: ignores the `semver.build` property). | ||
- `major`, `minor`, `patch`, and `prelease` match the individual semver values for your module's `version` | ||
- `node_abi`: The node C++ `ABI` number. This value is available in javascript as `process.versions.modules` as of [`>= v0.10.4 >= v0.11.7`](https://github.com/joyent/node/commit/ccabd4a6fa8a6eb79d29bc3bbe9fe2b6531c2d8e) and in C++ as the `NODE_MODULE_VERSION` define much earlier. For versions of Node before this was available we fallback to the V8 major and minor version. | ||
- `platform` matches node's `process.platform` like `linux`, `darwin`, and `win32` unless the user passed the `--target_platform` option to override. | ||
- `arch` matches node's `process.arch` like `x64` or `ia32` unless the user passes the `--target_arch` option to override. | ||
- `build` - the sevmer `build` value. For example it would be `this.that` if your package.json `version` was `v1.0.0+this.that` | ||
- `prerelease` - the semver `prerelease` value. For example it would be `alpha.beta` if your package.json `version` was `v1.0.0-alpha.beta` | ||
The options are visible in the code at <https://github.com/mapbox/node-pre-gyp/blob/612b7bca2604508d881e1187614870ba19a7f0c5/lib/util/versioning.js#L114-L127> |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
3132768
58384
524
Updatedrc@~0.5.1
Updatedsemver@~4.1.0
Updatedtar@~1.0.1