@vercel/ruby 1.3.76 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +300 -159
- package/package.json +10 -10
- package/vc_init.rb +0 -0
package/dist/index.js
CHANGED
|
@@ -127,7 +127,7 @@ const niceTry = __webpack_require__(1354);
|
|
|
127
127
|
const resolveCommand = __webpack_require__(8345);
|
|
128
128
|
const escape = __webpack_require__(2054);
|
|
129
129
|
const readShebang = __webpack_require__(8141);
|
|
130
|
-
const semver = __webpack_require__(
|
|
130
|
+
const semver = __webpack_require__(5686);
|
|
131
131
|
|
|
132
132
|
const isWin = process.platform === 'win32';
|
|
133
133
|
const isExecutableRegExp = /\.(?:com|exe)$/i;
|
|
@@ -6135,7 +6135,7 @@ module.exports = pump
|
|
|
6135
6135
|
|
|
6136
6136
|
/***/ }),
|
|
6137
6137
|
|
|
6138
|
-
/***/
|
|
6138
|
+
/***/ 5686:
|
|
6139
6139
|
/***/ ((module, exports) => {
|
|
6140
6140
|
|
|
6141
6141
|
exports = module.exports = SemVer
|
|
@@ -6166,11 +6166,39 @@ var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||
|
|
|
6166
6166
|
// Max safe segment length for coercion.
|
|
6167
6167
|
var MAX_SAFE_COMPONENT_LENGTH = 16
|
|
6168
6168
|
|
|
6169
|
+
var MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6
|
|
6170
|
+
|
|
6169
6171
|
// The actual regexps go on exports.re
|
|
6170
6172
|
var re = exports.re = []
|
|
6173
|
+
var safeRe = exports.safeRe = []
|
|
6171
6174
|
var src = exports.src = []
|
|
6172
6175
|
var R = 0
|
|
6173
6176
|
|
|
6177
|
+
var LETTERDASHNUMBER = '[a-zA-Z0-9-]'
|
|
6178
|
+
|
|
6179
|
+
// Replace some greedy regex tokens to prevent regex dos issues. These regex are
|
|
6180
|
+
// used internally via the safeRe object since all inputs in this library get
|
|
6181
|
+
// normalized first to trim and collapse all extra whitespace. The original
|
|
6182
|
+
// regexes are exported for userland consumption and lower level usage. A
|
|
6183
|
+
// future breaking change could export the safer regex only with a note that
|
|
6184
|
+
// all input should have extra whitespace removed.
|
|
6185
|
+
var safeRegexReplacements = [
|
|
6186
|
+
['\\s', 1],
|
|
6187
|
+
['\\d', MAX_LENGTH],
|
|
6188
|
+
[LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH],
|
|
6189
|
+
]
|
|
6190
|
+
|
|
6191
|
+
function makeSafeRe (value) {
|
|
6192
|
+
for (var i = 0; i < safeRegexReplacements.length; i++) {
|
|
6193
|
+
var token = safeRegexReplacements[i][0]
|
|
6194
|
+
var max = safeRegexReplacements[i][1]
|
|
6195
|
+
value = value
|
|
6196
|
+
.split(token + '*').join(token + '{0,' + max + '}')
|
|
6197
|
+
.split(token + '+').join(token + '{1,' + max + '}')
|
|
6198
|
+
}
|
|
6199
|
+
return value
|
|
6200
|
+
}
|
|
6201
|
+
|
|
6174
6202
|
// The following Regular Expressions can be used for tokenizing,
|
|
6175
6203
|
// validating, and parsing SemVer version strings.
|
|
6176
6204
|
|
|
@@ -6180,14 +6208,14 @@ var R = 0
|
|
|
6180
6208
|
var NUMERICIDENTIFIER = R++
|
|
6181
6209
|
src[NUMERICIDENTIFIER] = '0|[1-9]\\d*'
|
|
6182
6210
|
var NUMERICIDENTIFIERLOOSE = R++
|
|
6183
|
-
src[NUMERICIDENTIFIERLOOSE] = '
|
|
6211
|
+
src[NUMERICIDENTIFIERLOOSE] = '\\d+'
|
|
6184
6212
|
|
|
6185
6213
|
// ## Non-numeric Identifier
|
|
6186
6214
|
// Zero or more digits, followed by a letter or hyphen, and then zero or
|
|
6187
6215
|
// more letters, digits, or hyphens.
|
|
6188
6216
|
|
|
6189
6217
|
var NONNUMERICIDENTIFIER = R++
|
|
6190
|
-
src[NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-]
|
|
6218
|
+
src[NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-]' + LETTERDASHNUMBER + '*'
|
|
6191
6219
|
|
|
6192
6220
|
// ## Main Version
|
|
6193
6221
|
// Three dot-separated numeric identifiers.
|
|
@@ -6229,7 +6257,7 @@ src[PRERELEASELOOSE] = '(?:-?(' + src[PRERELEASEIDENTIFIERLOOSE] +
|
|
|
6229
6257
|
// Any combination of digits, letters, or hyphens.
|
|
6230
6258
|
|
|
6231
6259
|
var BUILDIDENTIFIER = R++
|
|
6232
|
-
src[BUILDIDENTIFIER] = '
|
|
6260
|
+
src[BUILDIDENTIFIER] = LETTERDASHNUMBER + '+'
|
|
6233
6261
|
|
|
6234
6262
|
// ## Build Metadata
|
|
6235
6263
|
// Plus sign, followed by one or more period-separated build metadata
|
|
@@ -6314,6 +6342,7 @@ src[LONETILDE] = '(?:~>?)'
|
|
|
6314
6342
|
var TILDETRIM = R++
|
|
6315
6343
|
src[TILDETRIM] = '(\\s*)' + src[LONETILDE] + '\\s+'
|
|
6316
6344
|
re[TILDETRIM] = new RegExp(src[TILDETRIM], 'g')
|
|
6345
|
+
safeRe[TILDETRIM] = new RegExp(makeSafeRe(src[TILDETRIM]), 'g')
|
|
6317
6346
|
var tildeTrimReplace = '$1~'
|
|
6318
6347
|
|
|
6319
6348
|
var TILDE = R++
|
|
@@ -6329,6 +6358,7 @@ src[LONECARET] = '(?:\\^)'
|
|
|
6329
6358
|
var CARETTRIM = R++
|
|
6330
6359
|
src[CARETTRIM] = '(\\s*)' + src[LONECARET] + '\\s+'
|
|
6331
6360
|
re[CARETTRIM] = new RegExp(src[CARETTRIM], 'g')
|
|
6361
|
+
safeRe[CARETTRIM] = new RegExp(makeSafeRe(src[CARETTRIM]), 'g')
|
|
6332
6362
|
var caretTrimReplace = '$1^'
|
|
6333
6363
|
|
|
6334
6364
|
var CARET = R++
|
|
@@ -6350,6 +6380,7 @@ src[COMPARATORTRIM] = '(\\s*)' + src[GTLT] +
|
|
|
6350
6380
|
|
|
6351
6381
|
// this one has to use the /g flag
|
|
6352
6382
|
re[COMPARATORTRIM] = new RegExp(src[COMPARATORTRIM], 'g')
|
|
6383
|
+
safeRe[COMPARATORTRIM] = new RegExp(makeSafeRe(src[COMPARATORTRIM]), 'g')
|
|
6353
6384
|
var comparatorTrimReplace = '$1$2$3'
|
|
6354
6385
|
|
|
6355
6386
|
// Something like `1.2.3 - 1.2.4`
|
|
@@ -6378,6 +6409,14 @@ for (var i = 0; i < R; i++) {
|
|
|
6378
6409
|
debug(i, src[i])
|
|
6379
6410
|
if (!re[i]) {
|
|
6380
6411
|
re[i] = new RegExp(src[i])
|
|
6412
|
+
|
|
6413
|
+
// Replace all greedy whitespace to prevent regex dos issues. These regex are
|
|
6414
|
+
// used internally via the safeRe object since all inputs in this library get
|
|
6415
|
+
// normalized first to trim and collapse all extra whitespace. The original
|
|
6416
|
+
// regexes are exported for userland consumption and lower level usage. A
|
|
6417
|
+
// future breaking change could export the safer regex only with a note that
|
|
6418
|
+
// all input should have extra whitespace removed.
|
|
6419
|
+
safeRe[i] = new RegExp(makeSafeRe(src[i]))
|
|
6381
6420
|
}
|
|
6382
6421
|
}
|
|
6383
6422
|
|
|
@@ -6402,7 +6441,7 @@ function parse (version, options) {
|
|
|
6402
6441
|
return null
|
|
6403
6442
|
}
|
|
6404
6443
|
|
|
6405
|
-
var r = options.loose ?
|
|
6444
|
+
var r = options.loose ? safeRe[LOOSE] : safeRe[FULL]
|
|
6406
6445
|
if (!r.test(version)) {
|
|
6407
6446
|
return null
|
|
6408
6447
|
}
|
|
@@ -6457,7 +6496,7 @@ function SemVer (version, options) {
|
|
|
6457
6496
|
this.options = options
|
|
6458
6497
|
this.loose = !!options.loose
|
|
6459
6498
|
|
|
6460
|
-
var m = version.trim().match(options.loose ?
|
|
6499
|
+
var m = version.trim().match(options.loose ? safeRe[LOOSE] : safeRe[FULL])
|
|
6461
6500
|
|
|
6462
6501
|
if (!m) {
|
|
6463
6502
|
throw new TypeError('Invalid Version: ' + version)
|
|
@@ -6871,6 +6910,7 @@ function Comparator (comp, options) {
|
|
|
6871
6910
|
return new Comparator(comp, options)
|
|
6872
6911
|
}
|
|
6873
6912
|
|
|
6913
|
+
comp = comp.trim().split(/\s+/).join(' ')
|
|
6874
6914
|
debug('comparator', comp, options)
|
|
6875
6915
|
this.options = options
|
|
6876
6916
|
this.loose = !!options.loose
|
|
@@ -6887,7 +6927,7 @@ function Comparator (comp, options) {
|
|
|
6887
6927
|
|
|
6888
6928
|
var ANY = {}
|
|
6889
6929
|
Comparator.prototype.parse = function (comp) {
|
|
6890
|
-
var r = this.options.loose ?
|
|
6930
|
+
var r = this.options.loose ? safeRe[COMPARATORLOOSE] : safeRe[COMPARATOR]
|
|
6891
6931
|
var m = comp.match(r)
|
|
6892
6932
|
|
|
6893
6933
|
if (!m) {
|
|
@@ -7001,9 +7041,16 @@ function Range (range, options) {
|
|
|
7001
7041
|
this.loose = !!options.loose
|
|
7002
7042
|
this.includePrerelease = !!options.includePrerelease
|
|
7003
7043
|
|
|
7004
|
-
// First
|
|
7044
|
+
// First reduce all whitespace as much as possible so we do not have to rely
|
|
7045
|
+
// on potentially slow regexes like \s*. This is then stored and used for
|
|
7046
|
+
// future error messages as well.
|
|
7005
7047
|
this.raw = range
|
|
7006
|
-
|
|
7048
|
+
.trim()
|
|
7049
|
+
.split(/\s+/)
|
|
7050
|
+
.join(' ')
|
|
7051
|
+
|
|
7052
|
+
// First, split based on boolean or ||
|
|
7053
|
+
this.set = this.raw.split('||').map(function (range) {
|
|
7007
7054
|
return this.parseRange(range.trim())
|
|
7008
7055
|
}, this).filter(function (c) {
|
|
7009
7056
|
// throw out any that are not relevant for whatever reason
|
|
@@ -7011,7 +7058,7 @@ function Range (range, options) {
|
|
|
7011
7058
|
})
|
|
7012
7059
|
|
|
7013
7060
|
if (!this.set.length) {
|
|
7014
|
-
throw new TypeError('Invalid SemVer Range: ' +
|
|
7061
|
+
throw new TypeError('Invalid SemVer Range: ' + this.raw)
|
|
7015
7062
|
}
|
|
7016
7063
|
|
|
7017
7064
|
this.format()
|
|
@@ -7030,28 +7077,23 @@ Range.prototype.toString = function () {
|
|
|
7030
7077
|
|
|
7031
7078
|
Range.prototype.parseRange = function (range) {
|
|
7032
7079
|
var loose = this.options.loose
|
|
7033
|
-
range = range.trim()
|
|
7034
7080
|
// `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`
|
|
7035
|
-
var hr = loose ?
|
|
7081
|
+
var hr = loose ? safeRe[HYPHENRANGELOOSE] : safeRe[HYPHENRANGE]
|
|
7036
7082
|
range = range.replace(hr, hyphenReplace)
|
|
7037
7083
|
debug('hyphen replace', range)
|
|
7038
7084
|
// `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`
|
|
7039
|
-
range = range.replace(
|
|
7040
|
-
debug('comparator trim', range,
|
|
7085
|
+
range = range.replace(safeRe[COMPARATORTRIM], comparatorTrimReplace)
|
|
7086
|
+
debug('comparator trim', range, safeRe[COMPARATORTRIM])
|
|
7041
7087
|
|
|
7042
7088
|
// `~ 1.2.3` => `~1.2.3`
|
|
7043
|
-
range = range.replace(
|
|
7089
|
+
range = range.replace(safeRe[TILDETRIM], tildeTrimReplace)
|
|
7044
7090
|
|
|
7045
7091
|
// `^ 1.2.3` => `^1.2.3`
|
|
7046
|
-
range = range.replace(
|
|
7047
|
-
|
|
7048
|
-
// normalize spaces
|
|
7049
|
-
range = range.split(/\s+/).join(' ')
|
|
7092
|
+
range = range.replace(safeRe[CARETTRIM], caretTrimReplace)
|
|
7050
7093
|
|
|
7051
7094
|
// At this point, the range is completely trimmed and
|
|
7052
7095
|
// ready to be split into comparators.
|
|
7053
|
-
|
|
7054
|
-
var compRe = loose ? re[COMPARATORLOOSE] : re[COMPARATOR]
|
|
7096
|
+
var compRe = loose ? safeRe[COMPARATORLOOSE] : safeRe[COMPARATOR]
|
|
7055
7097
|
var set = range.split(' ').map(function (comp) {
|
|
7056
7098
|
return parseComparator(comp, this.options)
|
|
7057
7099
|
}, this).join(' ').split(/\s+/)
|
|
@@ -7127,7 +7169,7 @@ function replaceTildes (comp, options) {
|
|
|
7127
7169
|
}
|
|
7128
7170
|
|
|
7129
7171
|
function replaceTilde (comp, options) {
|
|
7130
|
-
var r = options.loose ?
|
|
7172
|
+
var r = options.loose ? safeRe[TILDELOOSE] : safeRe[TILDE]
|
|
7131
7173
|
return comp.replace(r, function (_, M, m, p, pr) {
|
|
7132
7174
|
debug('tilde', comp, _, M, m, p, pr)
|
|
7133
7175
|
var ret
|
|
@@ -7168,7 +7210,7 @@ function replaceCarets (comp, options) {
|
|
|
7168
7210
|
|
|
7169
7211
|
function replaceCaret (comp, options) {
|
|
7170
7212
|
debug('caret', comp, options)
|
|
7171
|
-
var r = options.loose ?
|
|
7213
|
+
var r = options.loose ? safeRe[CARETLOOSE] : safeRe[CARET]
|
|
7172
7214
|
return comp.replace(r, function (_, M, m, p, pr) {
|
|
7173
7215
|
debug('caret', comp, _, M, m, p, pr)
|
|
7174
7216
|
var ret
|
|
@@ -7227,7 +7269,7 @@ function replaceXRanges (comp, options) {
|
|
|
7227
7269
|
|
|
7228
7270
|
function replaceXRange (comp, options) {
|
|
7229
7271
|
comp = comp.trim()
|
|
7230
|
-
var r = options.loose ?
|
|
7272
|
+
var r = options.loose ? safeRe[XRANGELOOSE] : safeRe[XRANGE]
|
|
7231
7273
|
return comp.replace(r, function (ret, gtlt, M, m, p, pr) {
|
|
7232
7274
|
debug('xRange', comp, ret, gtlt, M, m, p, pr)
|
|
7233
7275
|
var xM = isX(M)
|
|
@@ -7297,10 +7339,10 @@ function replaceXRange (comp, options) {
|
|
|
7297
7339
|
function replaceStars (comp, options) {
|
|
7298
7340
|
debug('replaceStars', comp, options)
|
|
7299
7341
|
// Looseness is ignored here. star is always as loose as it gets!
|
|
7300
|
-
return comp.trim().replace(
|
|
7342
|
+
return comp.trim().replace(safeRe[STAR], '')
|
|
7301
7343
|
}
|
|
7302
7344
|
|
|
7303
|
-
// This function is passed to string.replace(
|
|
7345
|
+
// This function is passed to string.replace(safeRe[HYPHENRANGE])
|
|
7304
7346
|
// M, m, patch, prerelease, build
|
|
7305
7347
|
// 1.2 - 3.4.5 => >=1.2.0 <=3.4.5
|
|
7306
7348
|
// 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do
|
|
@@ -7611,7 +7653,7 @@ function coerce (version) {
|
|
|
7611
7653
|
return null
|
|
7612
7654
|
}
|
|
7613
7655
|
|
|
7614
|
-
var match = version.match(
|
|
7656
|
+
var match = version.match(safeRe[COERCE])
|
|
7615
7657
|
|
|
7616
7658
|
if (match == null) {
|
|
7617
7659
|
return null
|
|
@@ -7625,7 +7667,7 @@ function coerce (version) {
|
|
|
7625
7667
|
|
|
7626
7668
|
/***/ }),
|
|
7627
7669
|
|
|
7628
|
-
/***/
|
|
7670
|
+
/***/ 7846:
|
|
7629
7671
|
/***/ ((module, exports) => {
|
|
7630
7672
|
|
|
7631
7673
|
exports = module.exports = SemVer
|
|
@@ -7656,78 +7698,111 @@ var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||
|
|
|
7656
7698
|
// Max safe segment length for coercion.
|
|
7657
7699
|
var MAX_SAFE_COMPONENT_LENGTH = 16
|
|
7658
7700
|
|
|
7701
|
+
var MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6
|
|
7702
|
+
|
|
7659
7703
|
// The actual regexps go on exports.re
|
|
7660
7704
|
var re = exports.re = []
|
|
7705
|
+
var safeRe = exports.safeRe = []
|
|
7661
7706
|
var src = exports.src = []
|
|
7707
|
+
var t = exports.tokens = {}
|
|
7662
7708
|
var R = 0
|
|
7663
7709
|
|
|
7710
|
+
function tok (n) {
|
|
7711
|
+
t[n] = R++
|
|
7712
|
+
}
|
|
7713
|
+
|
|
7714
|
+
var LETTERDASHNUMBER = '[a-zA-Z0-9-]'
|
|
7715
|
+
|
|
7716
|
+
// Replace some greedy regex tokens to prevent regex dos issues. These regex are
|
|
7717
|
+
// used internally via the safeRe object since all inputs in this library get
|
|
7718
|
+
// normalized first to trim and collapse all extra whitespace. The original
|
|
7719
|
+
// regexes are exported for userland consumption and lower level usage. A
|
|
7720
|
+
// future breaking change could export the safer regex only with a note that
|
|
7721
|
+
// all input should have extra whitespace removed.
|
|
7722
|
+
var safeRegexReplacements = [
|
|
7723
|
+
['\\s', 1],
|
|
7724
|
+
['\\d', MAX_LENGTH],
|
|
7725
|
+
[LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH],
|
|
7726
|
+
]
|
|
7727
|
+
|
|
7728
|
+
function makeSafeRe (value) {
|
|
7729
|
+
for (var i = 0; i < safeRegexReplacements.length; i++) {
|
|
7730
|
+
var token = safeRegexReplacements[i][0]
|
|
7731
|
+
var max = safeRegexReplacements[i][1]
|
|
7732
|
+
value = value
|
|
7733
|
+
.split(token + '*').join(token + '{0,' + max + '}')
|
|
7734
|
+
.split(token + '+').join(token + '{1,' + max + '}')
|
|
7735
|
+
}
|
|
7736
|
+
return value
|
|
7737
|
+
}
|
|
7738
|
+
|
|
7664
7739
|
// The following Regular Expressions can be used for tokenizing,
|
|
7665
7740
|
// validating, and parsing SemVer version strings.
|
|
7666
7741
|
|
|
7667
7742
|
// ## Numeric Identifier
|
|
7668
7743
|
// A single `0`, or a non-zero digit followed by zero or more digits.
|
|
7669
7744
|
|
|
7670
|
-
|
|
7671
|
-
src[NUMERICIDENTIFIER] = '0|[1-9]\\d*'
|
|
7672
|
-
|
|
7673
|
-
src[NUMERICIDENTIFIERLOOSE] = '
|
|
7745
|
+
tok('NUMERICIDENTIFIER')
|
|
7746
|
+
src[t.NUMERICIDENTIFIER] = '0|[1-9]\\d*'
|
|
7747
|
+
tok('NUMERICIDENTIFIERLOOSE')
|
|
7748
|
+
src[t.NUMERICIDENTIFIERLOOSE] = '\\d+'
|
|
7674
7749
|
|
|
7675
7750
|
// ## Non-numeric Identifier
|
|
7676
7751
|
// Zero or more digits, followed by a letter or hyphen, and then zero or
|
|
7677
7752
|
// more letters, digits, or hyphens.
|
|
7678
7753
|
|
|
7679
|
-
|
|
7680
|
-
src[NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-]
|
|
7754
|
+
tok('NONNUMERICIDENTIFIER')
|
|
7755
|
+
src[t.NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-]' + LETTERDASHNUMBER + '*'
|
|
7681
7756
|
|
|
7682
7757
|
// ## Main Version
|
|
7683
7758
|
// Three dot-separated numeric identifiers.
|
|
7684
7759
|
|
|
7685
|
-
|
|
7686
|
-
src[MAINVERSION] = '(' + src[NUMERICIDENTIFIER] + ')\\.' +
|
|
7687
|
-
'(' + src[NUMERICIDENTIFIER] + ')\\.' +
|
|
7688
|
-
'(' + src[NUMERICIDENTIFIER] + ')'
|
|
7760
|
+
tok('MAINVERSION')
|
|
7761
|
+
src[t.MAINVERSION] = '(' + src[t.NUMERICIDENTIFIER] + ')\\.' +
|
|
7762
|
+
'(' + src[t.NUMERICIDENTIFIER] + ')\\.' +
|
|
7763
|
+
'(' + src[t.NUMERICIDENTIFIER] + ')'
|
|
7689
7764
|
|
|
7690
|
-
|
|
7691
|
-
src[MAINVERSIONLOOSE] = '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' +
|
|
7692
|
-
'(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' +
|
|
7693
|
-
'(' + src[NUMERICIDENTIFIERLOOSE] + ')'
|
|
7765
|
+
tok('MAINVERSIONLOOSE')
|
|
7766
|
+
src[t.MAINVERSIONLOOSE] = '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' +
|
|
7767
|
+
'(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' +
|
|
7768
|
+
'(' + src[t.NUMERICIDENTIFIERLOOSE] + ')'
|
|
7694
7769
|
|
|
7695
7770
|
// ## Pre-release Version Identifier
|
|
7696
7771
|
// A numeric identifier, or a non-numeric identifier.
|
|
7697
7772
|
|
|
7698
|
-
|
|
7699
|
-
src[PRERELEASEIDENTIFIER] = '(?:' + src[NUMERICIDENTIFIER] +
|
|
7700
|
-
'|' + src[NONNUMERICIDENTIFIER] + ')'
|
|
7773
|
+
tok('PRERELEASEIDENTIFIER')
|
|
7774
|
+
src[t.PRERELEASEIDENTIFIER] = '(?:' + src[t.NUMERICIDENTIFIER] +
|
|
7775
|
+
'|' + src[t.NONNUMERICIDENTIFIER] + ')'
|
|
7701
7776
|
|
|
7702
|
-
|
|
7703
|
-
src[PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[NUMERICIDENTIFIERLOOSE] +
|
|
7704
|
-
'|' + src[NONNUMERICIDENTIFIER] + ')'
|
|
7777
|
+
tok('PRERELEASEIDENTIFIERLOOSE')
|
|
7778
|
+
src[t.PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[t.NUMERICIDENTIFIERLOOSE] +
|
|
7779
|
+
'|' + src[t.NONNUMERICIDENTIFIER] + ')'
|
|
7705
7780
|
|
|
7706
7781
|
// ## Pre-release Version
|
|
7707
7782
|
// Hyphen, followed by one or more dot-separated pre-release version
|
|
7708
7783
|
// identifiers.
|
|
7709
7784
|
|
|
7710
|
-
|
|
7711
|
-
src[PRERELEASE] = '(?:-(' + src[PRERELEASEIDENTIFIER] +
|
|
7712
|
-
'(?:\\.' + src[PRERELEASEIDENTIFIER] + ')*))'
|
|
7785
|
+
tok('PRERELEASE')
|
|
7786
|
+
src[t.PRERELEASE] = '(?:-(' + src[t.PRERELEASEIDENTIFIER] +
|
|
7787
|
+
'(?:\\.' + src[t.PRERELEASEIDENTIFIER] + ')*))'
|
|
7713
7788
|
|
|
7714
|
-
|
|
7715
|
-
src[PRERELEASELOOSE] = '(?:-?(' + src[PRERELEASEIDENTIFIERLOOSE] +
|
|
7716
|
-
'(?:\\.' + src[PRERELEASEIDENTIFIERLOOSE] + ')*))'
|
|
7789
|
+
tok('PRERELEASELOOSE')
|
|
7790
|
+
src[t.PRERELEASELOOSE] = '(?:-?(' + src[t.PRERELEASEIDENTIFIERLOOSE] +
|
|
7791
|
+
'(?:\\.' + src[t.PRERELEASEIDENTIFIERLOOSE] + ')*))'
|
|
7717
7792
|
|
|
7718
7793
|
// ## Build Metadata Identifier
|
|
7719
7794
|
// Any combination of digits, letters, or hyphens.
|
|
7720
7795
|
|
|
7721
|
-
|
|
7722
|
-
src[BUILDIDENTIFIER] = '
|
|
7796
|
+
tok('BUILDIDENTIFIER')
|
|
7797
|
+
src[t.BUILDIDENTIFIER] = LETTERDASHNUMBER + '+'
|
|
7723
7798
|
|
|
7724
7799
|
// ## Build Metadata
|
|
7725
7800
|
// Plus sign, followed by one or more period-separated build metadata
|
|
7726
7801
|
// identifiers.
|
|
7727
7802
|
|
|
7728
|
-
|
|
7729
|
-
src[BUILD] = '(?:\\+(' + src[BUILDIDENTIFIER] +
|
|
7730
|
-
'(?:\\.' + src[BUILDIDENTIFIER] + ')*))'
|
|
7803
|
+
tok('BUILD')
|
|
7804
|
+
src[t.BUILD] = '(?:\\+(' + src[t.BUILDIDENTIFIER] +
|
|
7805
|
+
'(?:\\.' + src[t.BUILDIDENTIFIER] + ')*))'
|
|
7731
7806
|
|
|
7732
7807
|
// ## Full Version String
|
|
7733
7808
|
// A main version, followed optionally by a pre-release version and
|
|
@@ -7738,129 +7813,137 @@ src[BUILD] = '(?:\\+(' + src[BUILDIDENTIFIER] +
|
|
|
7738
7813
|
// capturing group, because it should not ever be used in version
|
|
7739
7814
|
// comparison.
|
|
7740
7815
|
|
|
7741
|
-
|
|
7742
|
-
|
|
7743
|
-
|
|
7744
|
-
|
|
7816
|
+
tok('FULL')
|
|
7817
|
+
tok('FULLPLAIN')
|
|
7818
|
+
src[t.FULLPLAIN] = 'v?' + src[t.MAINVERSION] +
|
|
7819
|
+
src[t.PRERELEASE] + '?' +
|
|
7820
|
+
src[t.BUILD] + '?'
|
|
7745
7821
|
|
|
7746
|
-
src[FULL] = '^' + FULLPLAIN + '$'
|
|
7822
|
+
src[t.FULL] = '^' + src[t.FULLPLAIN] + '$'
|
|
7747
7823
|
|
|
7748
7824
|
// like full, but allows v1.2.3 and =1.2.3, which people do sometimes.
|
|
7749
7825
|
// also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty
|
|
7750
7826
|
// common in the npm registry.
|
|
7751
|
-
|
|
7752
|
-
|
|
7753
|
-
|
|
7827
|
+
tok('LOOSEPLAIN')
|
|
7828
|
+
src[t.LOOSEPLAIN] = '[v=\\s]*' + src[t.MAINVERSIONLOOSE] +
|
|
7829
|
+
src[t.PRERELEASELOOSE] + '?' +
|
|
7830
|
+
src[t.BUILD] + '?'
|
|
7754
7831
|
|
|
7755
|
-
|
|
7756
|
-
src[LOOSE] = '^' + LOOSEPLAIN + '$'
|
|
7832
|
+
tok('LOOSE')
|
|
7833
|
+
src[t.LOOSE] = '^' + src[t.LOOSEPLAIN] + '$'
|
|
7757
7834
|
|
|
7758
|
-
|
|
7759
|
-
src[GTLT] = '((?:<|>)?=?)'
|
|
7835
|
+
tok('GTLT')
|
|
7836
|
+
src[t.GTLT] = '((?:<|>)?=?)'
|
|
7760
7837
|
|
|
7761
7838
|
// Something like "2.*" or "1.2.x".
|
|
7762
7839
|
// Note that "x.x" is a valid xRange identifer, meaning "any version"
|
|
7763
7840
|
// Only the first item is strictly required.
|
|
7764
|
-
|
|
7765
|
-
src[XRANGEIDENTIFIERLOOSE] = src[NUMERICIDENTIFIERLOOSE] + '|x|X|\\*'
|
|
7766
|
-
|
|
7767
|
-
src[XRANGEIDENTIFIER] = src[NUMERICIDENTIFIER] + '|x|X|\\*'
|
|
7768
|
-
|
|
7769
|
-
|
|
7770
|
-
src[XRANGEPLAIN] = '[v=\\s]*(' + src[XRANGEIDENTIFIER] + ')' +
|
|
7771
|
-
'(?:\\.(' + src[XRANGEIDENTIFIER] + ')' +
|
|
7772
|
-
'(?:\\.(' + src[XRANGEIDENTIFIER] + ')' +
|
|
7773
|
-
'(?:' + src[PRERELEASE] + ')?' +
|
|
7774
|
-
src[BUILD] + '?' +
|
|
7841
|
+
tok('XRANGEIDENTIFIERLOOSE')
|
|
7842
|
+
src[t.XRANGEIDENTIFIERLOOSE] = src[t.NUMERICIDENTIFIERLOOSE] + '|x|X|\\*'
|
|
7843
|
+
tok('XRANGEIDENTIFIER')
|
|
7844
|
+
src[t.XRANGEIDENTIFIER] = src[t.NUMERICIDENTIFIER] + '|x|X|\\*'
|
|
7845
|
+
|
|
7846
|
+
tok('XRANGEPLAIN')
|
|
7847
|
+
src[t.XRANGEPLAIN] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIER] + ')' +
|
|
7848
|
+
'(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' +
|
|
7849
|
+
'(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' +
|
|
7850
|
+
'(?:' + src[t.PRERELEASE] + ')?' +
|
|
7851
|
+
src[t.BUILD] + '?' +
|
|
7775
7852
|
')?)?'
|
|
7776
7853
|
|
|
7777
|
-
|
|
7778
|
-
src[XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
|
|
7779
|
-
'(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
|
|
7780
|
-
'(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
|
|
7781
|
-
'(?:' + src[PRERELEASELOOSE] + ')?' +
|
|
7782
|
-
src[BUILD] + '?' +
|
|
7854
|
+
tok('XRANGEPLAINLOOSE')
|
|
7855
|
+
src[t.XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
|
|
7856
|
+
'(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
|
|
7857
|
+
'(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
|
|
7858
|
+
'(?:' + src[t.PRERELEASELOOSE] + ')?' +
|
|
7859
|
+
src[t.BUILD] + '?' +
|
|
7783
7860
|
')?)?'
|
|
7784
7861
|
|
|
7785
|
-
|
|
7786
|
-
src[XRANGE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAIN] + '$'
|
|
7787
|
-
|
|
7788
|
-
src[XRANGELOOSE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAINLOOSE] + '$'
|
|
7862
|
+
tok('XRANGE')
|
|
7863
|
+
src[t.XRANGE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAIN] + '$'
|
|
7864
|
+
tok('XRANGELOOSE')
|
|
7865
|
+
src[t.XRANGELOOSE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAINLOOSE] + '$'
|
|
7789
7866
|
|
|
7790
7867
|
// Coercion.
|
|
7791
7868
|
// Extract anything that could conceivably be a part of a valid semver
|
|
7792
|
-
|
|
7793
|
-
src[COERCE] = '(
|
|
7869
|
+
tok('COERCE')
|
|
7870
|
+
src[t.COERCE] = '(^|[^\\d])' +
|
|
7794
7871
|
'(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' +
|
|
7795
7872
|
'(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
|
|
7796
7873
|
'(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
|
|
7797
7874
|
'(?:$|[^\\d])'
|
|
7875
|
+
tok('COERCERTL')
|
|
7876
|
+
re[t.COERCERTL] = new RegExp(src[t.COERCE], 'g')
|
|
7877
|
+
safeRe[t.COERCERTL] = new RegExp(makeSafeRe(src[t.COERCE]), 'g')
|
|
7798
7878
|
|
|
7799
7879
|
// Tilde ranges.
|
|
7800
7880
|
// Meaning is "reasonably at or greater than"
|
|
7801
|
-
|
|
7802
|
-
src[LONETILDE] = '(?:~>?)'
|
|
7881
|
+
tok('LONETILDE')
|
|
7882
|
+
src[t.LONETILDE] = '(?:~>?)'
|
|
7803
7883
|
|
|
7804
|
-
|
|
7805
|
-
src[TILDETRIM] = '(\\s*)' + src[LONETILDE] + '\\s+'
|
|
7806
|
-
re[TILDETRIM] = new RegExp(src[TILDETRIM], 'g')
|
|
7884
|
+
tok('TILDETRIM')
|
|
7885
|
+
src[t.TILDETRIM] = '(\\s*)' + src[t.LONETILDE] + '\\s+'
|
|
7886
|
+
re[t.TILDETRIM] = new RegExp(src[t.TILDETRIM], 'g')
|
|
7887
|
+
safeRe[t.TILDETRIM] = new RegExp(makeSafeRe(src[t.TILDETRIM]), 'g')
|
|
7807
7888
|
var tildeTrimReplace = '$1~'
|
|
7808
7889
|
|
|
7809
|
-
|
|
7810
|
-
src[TILDE] = '^' + src[LONETILDE] + src[XRANGEPLAIN] + '$'
|
|
7811
|
-
|
|
7812
|
-
src[TILDELOOSE] = '^' + src[LONETILDE] + src[XRANGEPLAINLOOSE] + '$'
|
|
7890
|
+
tok('TILDE')
|
|
7891
|
+
src[t.TILDE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAIN] + '$'
|
|
7892
|
+
tok('TILDELOOSE')
|
|
7893
|
+
src[t.TILDELOOSE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAINLOOSE] + '$'
|
|
7813
7894
|
|
|
7814
7895
|
// Caret ranges.
|
|
7815
7896
|
// Meaning is "at least and backwards compatible with"
|
|
7816
|
-
|
|
7817
|
-
src[LONECARET] = '(?:\\^)'
|
|
7897
|
+
tok('LONECARET')
|
|
7898
|
+
src[t.LONECARET] = '(?:\\^)'
|
|
7818
7899
|
|
|
7819
|
-
|
|
7820
|
-
src[CARETTRIM] = '(\\s*)' + src[LONECARET] + '\\s+'
|
|
7821
|
-
re[CARETTRIM] = new RegExp(src[CARETTRIM], 'g')
|
|
7900
|
+
tok('CARETTRIM')
|
|
7901
|
+
src[t.CARETTRIM] = '(\\s*)' + src[t.LONECARET] + '\\s+'
|
|
7902
|
+
re[t.CARETTRIM] = new RegExp(src[t.CARETTRIM], 'g')
|
|
7903
|
+
safeRe[t.CARETTRIM] = new RegExp(makeSafeRe(src[t.CARETTRIM]), 'g')
|
|
7822
7904
|
var caretTrimReplace = '$1^'
|
|
7823
7905
|
|
|
7824
|
-
|
|
7825
|
-
src[CARET] = '^' + src[LONECARET] + src[XRANGEPLAIN] + '$'
|
|
7826
|
-
|
|
7827
|
-
src[CARETLOOSE] = '^' + src[LONECARET] + src[XRANGEPLAINLOOSE] + '$'
|
|
7906
|
+
tok('CARET')
|
|
7907
|
+
src[t.CARET] = '^' + src[t.LONECARET] + src[t.XRANGEPLAIN] + '$'
|
|
7908
|
+
tok('CARETLOOSE')
|
|
7909
|
+
src[t.CARETLOOSE] = '^' + src[t.LONECARET] + src[t.XRANGEPLAINLOOSE] + '$'
|
|
7828
7910
|
|
|
7829
7911
|
// A simple gt/lt/eq thing, or just "" to indicate "any version"
|
|
7830
|
-
|
|
7831
|
-
src[COMPARATORLOOSE] = '^' + src[GTLT] + '\\s*(' + LOOSEPLAIN + ')$|^$'
|
|
7832
|
-
|
|
7833
|
-
src[COMPARATOR] = '^' + src[GTLT] + '\\s*(' + FULLPLAIN + ')$|^$'
|
|
7912
|
+
tok('COMPARATORLOOSE')
|
|
7913
|
+
src[t.COMPARATORLOOSE] = '^' + src[t.GTLT] + '\\s*(' + src[t.LOOSEPLAIN] + ')$|^$'
|
|
7914
|
+
tok('COMPARATOR')
|
|
7915
|
+
src[t.COMPARATOR] = '^' + src[t.GTLT] + '\\s*(' + src[t.FULLPLAIN] + ')$|^$'
|
|
7834
7916
|
|
|
7835
7917
|
// An expression to strip any whitespace between the gtlt and the thing
|
|
7836
7918
|
// it modifies, so that `> 1.2.3` ==> `>1.2.3`
|
|
7837
|
-
|
|
7838
|
-
src[COMPARATORTRIM] = '(\\s*)' + src[GTLT] +
|
|
7839
|
-
'\\s*(' + LOOSEPLAIN + '|' + src[XRANGEPLAIN] + ')'
|
|
7919
|
+
tok('COMPARATORTRIM')
|
|
7920
|
+
src[t.COMPARATORTRIM] = '(\\s*)' + src[t.GTLT] +
|
|
7921
|
+
'\\s*(' + src[t.LOOSEPLAIN] + '|' + src[t.XRANGEPLAIN] + ')'
|
|
7840
7922
|
|
|
7841
7923
|
// this one has to use the /g flag
|
|
7842
|
-
re[COMPARATORTRIM] = new RegExp(src[COMPARATORTRIM], 'g')
|
|
7924
|
+
re[t.COMPARATORTRIM] = new RegExp(src[t.COMPARATORTRIM], 'g')
|
|
7925
|
+
safeRe[t.COMPARATORTRIM] = new RegExp(makeSafeRe(src[t.COMPARATORTRIM]), 'g')
|
|
7843
7926
|
var comparatorTrimReplace = '$1$2$3'
|
|
7844
7927
|
|
|
7845
7928
|
// Something like `1.2.3 - 1.2.4`
|
|
7846
7929
|
// Note that these all use the loose form, because they'll be
|
|
7847
7930
|
// checked against either the strict or loose comparator form
|
|
7848
7931
|
// later.
|
|
7849
|
-
|
|
7850
|
-
src[HYPHENRANGE] = '^\\s*(' + src[XRANGEPLAIN] + ')' +
|
|
7932
|
+
tok('HYPHENRANGE')
|
|
7933
|
+
src[t.HYPHENRANGE] = '^\\s*(' + src[t.XRANGEPLAIN] + ')' +
|
|
7851
7934
|
'\\s+-\\s+' +
|
|
7852
|
-
'(' + src[XRANGEPLAIN] + ')' +
|
|
7935
|
+
'(' + src[t.XRANGEPLAIN] + ')' +
|
|
7853
7936
|
'\\s*$'
|
|
7854
7937
|
|
|
7855
|
-
|
|
7856
|
-
src[HYPHENRANGELOOSE] = '^\\s*(' + src[XRANGEPLAINLOOSE] + ')' +
|
|
7938
|
+
tok('HYPHENRANGELOOSE')
|
|
7939
|
+
src[t.HYPHENRANGELOOSE] = '^\\s*(' + src[t.XRANGEPLAINLOOSE] + ')' +
|
|
7857
7940
|
'\\s+-\\s+' +
|
|
7858
|
-
'(' + src[XRANGEPLAINLOOSE] + ')' +
|
|
7941
|
+
'(' + src[t.XRANGEPLAINLOOSE] + ')' +
|
|
7859
7942
|
'\\s*$'
|
|
7860
7943
|
|
|
7861
7944
|
// Star ranges basically just allow anything at all.
|
|
7862
|
-
|
|
7863
|
-
src[STAR] = '(<|>)?=?\\s*\\*'
|
|
7945
|
+
tok('STAR')
|
|
7946
|
+
src[t.STAR] = '(<|>)?=?\\s*\\*'
|
|
7864
7947
|
|
|
7865
7948
|
// Compile to actual regexp objects.
|
|
7866
7949
|
// All are flag-free, unless they were created above with a flag.
|
|
@@ -7868,6 +7951,14 @@ for (var i = 0; i < R; i++) {
|
|
|
7868
7951
|
debug(i, src[i])
|
|
7869
7952
|
if (!re[i]) {
|
|
7870
7953
|
re[i] = new RegExp(src[i])
|
|
7954
|
+
|
|
7955
|
+
// Replace all greedy whitespace to prevent regex dos issues. These regex are
|
|
7956
|
+
// used internally via the safeRe object since all inputs in this library get
|
|
7957
|
+
// normalized first to trim and collapse all extra whitespace. The original
|
|
7958
|
+
// regexes are exported for userland consumption and lower level usage. A
|
|
7959
|
+
// future breaking change could export the safer regex only with a note that
|
|
7960
|
+
// all input should have extra whitespace removed.
|
|
7961
|
+
safeRe[i] = new RegExp(makeSafeRe(src[i]))
|
|
7871
7962
|
}
|
|
7872
7963
|
}
|
|
7873
7964
|
|
|
@@ -7892,7 +7983,7 @@ function parse (version, options) {
|
|
|
7892
7983
|
return null
|
|
7893
7984
|
}
|
|
7894
7985
|
|
|
7895
|
-
var r = options.loose ?
|
|
7986
|
+
var r = options.loose ? safeRe[t.LOOSE] : safeRe[t.FULL]
|
|
7896
7987
|
if (!r.test(version)) {
|
|
7897
7988
|
return null
|
|
7898
7989
|
}
|
|
@@ -7947,7 +8038,7 @@ function SemVer (version, options) {
|
|
|
7947
8038
|
this.options = options
|
|
7948
8039
|
this.loose = !!options.loose
|
|
7949
8040
|
|
|
7950
|
-
var m = version.trim().match(options.loose ?
|
|
8041
|
+
var m = version.trim().match(options.loose ? safeRe[t.LOOSE] : safeRe[t.FULL])
|
|
7951
8042
|
|
|
7952
8043
|
if (!m) {
|
|
7953
8044
|
throw new TypeError('Invalid Version: ' + version)
|
|
@@ -8392,6 +8483,7 @@ function Comparator (comp, options) {
|
|
|
8392
8483
|
return new Comparator(comp, options)
|
|
8393
8484
|
}
|
|
8394
8485
|
|
|
8486
|
+
comp = comp.trim().split(/\s+/).join(' ')
|
|
8395
8487
|
debug('comparator', comp, options)
|
|
8396
8488
|
this.options = options
|
|
8397
8489
|
this.loose = !!options.loose
|
|
@@ -8408,7 +8500,7 @@ function Comparator (comp, options) {
|
|
|
8408
8500
|
|
|
8409
8501
|
var ANY = {}
|
|
8410
8502
|
Comparator.prototype.parse = function (comp) {
|
|
8411
|
-
var r = this.options.loose ?
|
|
8503
|
+
var r = this.options.loose ? safeRe[t.COMPARATORLOOSE] : safeRe[t.COMPARATOR]
|
|
8412
8504
|
var m = comp.match(r)
|
|
8413
8505
|
|
|
8414
8506
|
if (!m) {
|
|
@@ -8440,7 +8532,11 @@ Comparator.prototype.test = function (version) {
|
|
|
8440
8532
|
}
|
|
8441
8533
|
|
|
8442
8534
|
if (typeof version === 'string') {
|
|
8443
|
-
|
|
8535
|
+
try {
|
|
8536
|
+
version = new SemVer(version, this.options)
|
|
8537
|
+
} catch (er) {
|
|
8538
|
+
return false
|
|
8539
|
+
}
|
|
8444
8540
|
}
|
|
8445
8541
|
|
|
8446
8542
|
return cmp(version, this.operator, this.semver, this.options)
|
|
@@ -8528,9 +8624,16 @@ function Range (range, options) {
|
|
|
8528
8624
|
this.loose = !!options.loose
|
|
8529
8625
|
this.includePrerelease = !!options.includePrerelease
|
|
8530
8626
|
|
|
8531
|
-
// First
|
|
8627
|
+
// First reduce all whitespace as much as possible so we do not have to rely
|
|
8628
|
+
// on potentially slow regexes like \s*. This is then stored and used for
|
|
8629
|
+
// future error messages as well.
|
|
8532
8630
|
this.raw = range
|
|
8533
|
-
|
|
8631
|
+
.trim()
|
|
8632
|
+
.split(/\s+/)
|
|
8633
|
+
.join(' ')
|
|
8634
|
+
|
|
8635
|
+
// First, split based on boolean or ||
|
|
8636
|
+
this.set = this.raw.split('||').map(function (range) {
|
|
8534
8637
|
return this.parseRange(range.trim())
|
|
8535
8638
|
}, this).filter(function (c) {
|
|
8536
8639
|
// throw out any that are not relevant for whatever reason
|
|
@@ -8538,7 +8641,7 @@ function Range (range, options) {
|
|
|
8538
8641
|
})
|
|
8539
8642
|
|
|
8540
8643
|
if (!this.set.length) {
|
|
8541
|
-
throw new TypeError('Invalid SemVer Range: ' +
|
|
8644
|
+
throw new TypeError('Invalid SemVer Range: ' + this.raw)
|
|
8542
8645
|
}
|
|
8543
8646
|
|
|
8544
8647
|
this.format()
|
|
@@ -8557,20 +8660,19 @@ Range.prototype.toString = function () {
|
|
|
8557
8660
|
|
|
8558
8661
|
Range.prototype.parseRange = function (range) {
|
|
8559
8662
|
var loose = this.options.loose
|
|
8560
|
-
range = range.trim()
|
|
8561
8663
|
// `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`
|
|
8562
|
-
var hr = loose ?
|
|
8664
|
+
var hr = loose ? safeRe[t.HYPHENRANGELOOSE] : safeRe[t.HYPHENRANGE]
|
|
8563
8665
|
range = range.replace(hr, hyphenReplace)
|
|
8564
8666
|
debug('hyphen replace', range)
|
|
8565
8667
|
// `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`
|
|
8566
|
-
range = range.replace(
|
|
8567
|
-
debug('comparator trim', range,
|
|
8668
|
+
range = range.replace(safeRe[t.COMPARATORTRIM], comparatorTrimReplace)
|
|
8669
|
+
debug('comparator trim', range, safeRe[t.COMPARATORTRIM])
|
|
8568
8670
|
|
|
8569
8671
|
// `~ 1.2.3` => `~1.2.3`
|
|
8570
|
-
range = range.replace(
|
|
8672
|
+
range = range.replace(safeRe[t.TILDETRIM], tildeTrimReplace)
|
|
8571
8673
|
|
|
8572
8674
|
// `^ 1.2.3` => `^1.2.3`
|
|
8573
|
-
range = range.replace(
|
|
8675
|
+
range = range.replace(safeRe[t.CARETTRIM], caretTrimReplace)
|
|
8574
8676
|
|
|
8575
8677
|
// normalize spaces
|
|
8576
8678
|
range = range.split(/\s+/).join(' ')
|
|
@@ -8578,7 +8680,7 @@ Range.prototype.parseRange = function (range) {
|
|
|
8578
8680
|
// At this point, the range is completely trimmed and
|
|
8579
8681
|
// ready to be split into comparators.
|
|
8580
8682
|
|
|
8581
|
-
var compRe = loose ?
|
|
8683
|
+
var compRe = loose ? safeRe[t.COMPARATORLOOSE] : safeRe[t.COMPARATOR]
|
|
8582
8684
|
var set = range.split(' ').map(function (comp) {
|
|
8583
8685
|
return parseComparator(comp, this.options)
|
|
8584
8686
|
}, this).join(' ').split(/\s+/)
|
|
@@ -8678,7 +8780,7 @@ function replaceTildes (comp, options) {
|
|
|
8678
8780
|
}
|
|
8679
8781
|
|
|
8680
8782
|
function replaceTilde (comp, options) {
|
|
8681
|
-
var r = options.loose ?
|
|
8783
|
+
var r = options.loose ? safeRe[t.TILDELOOSE] : safeRe[t.TILDE]
|
|
8682
8784
|
return comp.replace(r, function (_, M, m, p, pr) {
|
|
8683
8785
|
debug('tilde', comp, _, M, m, p, pr)
|
|
8684
8786
|
var ret
|
|
@@ -8719,7 +8821,7 @@ function replaceCarets (comp, options) {
|
|
|
8719
8821
|
|
|
8720
8822
|
function replaceCaret (comp, options) {
|
|
8721
8823
|
debug('caret', comp, options)
|
|
8722
|
-
var r = options.loose ?
|
|
8824
|
+
var r = options.loose ? safeRe[t.CARETLOOSE] : safeRe[t.CARET]
|
|
8723
8825
|
return comp.replace(r, function (_, M, m, p, pr) {
|
|
8724
8826
|
debug('caret', comp, _, M, m, p, pr)
|
|
8725
8827
|
var ret
|
|
@@ -8778,7 +8880,7 @@ function replaceXRanges (comp, options) {
|
|
|
8778
8880
|
|
|
8779
8881
|
function replaceXRange (comp, options) {
|
|
8780
8882
|
comp = comp.trim()
|
|
8781
|
-
var r = options.loose ?
|
|
8883
|
+
var r = options.loose ? safeRe[t.XRANGELOOSE] : safeRe[t.XRANGE]
|
|
8782
8884
|
return comp.replace(r, function (ret, gtlt, M, m, p, pr) {
|
|
8783
8885
|
debug('xRange', comp, ret, gtlt, M, m, p, pr)
|
|
8784
8886
|
var xM = isX(M)
|
|
@@ -8790,10 +8892,14 @@ function replaceXRange (comp, options) {
|
|
|
8790
8892
|
gtlt = ''
|
|
8791
8893
|
}
|
|
8792
8894
|
|
|
8895
|
+
// if we're including prereleases in the match, then we need
|
|
8896
|
+
// to fix this to -0, the lowest possible prerelease value
|
|
8897
|
+
pr = options.includePrerelease ? '-0' : ''
|
|
8898
|
+
|
|
8793
8899
|
if (xM) {
|
|
8794
8900
|
if (gtlt === '>' || gtlt === '<') {
|
|
8795
8901
|
// nothing is allowed
|
|
8796
|
-
ret = '<0.0.0'
|
|
8902
|
+
ret = '<0.0.0-0'
|
|
8797
8903
|
} else {
|
|
8798
8904
|
// nothing is forbidden
|
|
8799
8905
|
ret = '*'
|
|
@@ -8830,11 +8936,12 @@ function replaceXRange (comp, options) {
|
|
|
8830
8936
|
}
|
|
8831
8937
|
}
|
|
8832
8938
|
|
|
8833
|
-
ret = gtlt + M + '.' + m + '.' + p
|
|
8939
|
+
ret = gtlt + M + '.' + m + '.' + p + pr
|
|
8834
8940
|
} else if (xm) {
|
|
8835
|
-
ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
|
|
8941
|
+
ret = '>=' + M + '.0.0' + pr + ' <' + (+M + 1) + '.0.0' + pr
|
|
8836
8942
|
} else if (xp) {
|
|
8837
|
-
ret = '>=' + M + '.' + m + '.0
|
|
8943
|
+
ret = '>=' + M + '.' + m + '.0' + pr +
|
|
8944
|
+
' <' + M + '.' + (+m + 1) + '.0' + pr
|
|
8838
8945
|
}
|
|
8839
8946
|
|
|
8840
8947
|
debug('xRange return', ret)
|
|
@@ -8848,10 +8955,10 @@ function replaceXRange (comp, options) {
|
|
|
8848
8955
|
function replaceStars (comp, options) {
|
|
8849
8956
|
debug('replaceStars', comp, options)
|
|
8850
8957
|
// Looseness is ignored here. star is always as loose as it gets!
|
|
8851
|
-
return comp.trim().replace(
|
|
8958
|
+
return comp.trim().replace(safeRe[t.STAR], '')
|
|
8852
8959
|
}
|
|
8853
8960
|
|
|
8854
|
-
// This function is passed to string.replace(re[HYPHENRANGE])
|
|
8961
|
+
// This function is passed to string.replace(re[t.HYPHENRANGE])
|
|
8855
8962
|
// M, m, patch, prerelease, build
|
|
8856
8963
|
// 1.2 - 3.4.5 => >=1.2.0 <=3.4.5
|
|
8857
8964
|
// 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do
|
|
@@ -8891,7 +8998,11 @@ Range.prototype.test = function (version) {
|
|
|
8891
8998
|
}
|
|
8892
8999
|
|
|
8893
9000
|
if (typeof version === 'string') {
|
|
8894
|
-
|
|
9001
|
+
try {
|
|
9002
|
+
version = new SemVer(version, this.options)
|
|
9003
|
+
} catch (er) {
|
|
9004
|
+
return false
|
|
9005
|
+
}
|
|
8895
9006
|
}
|
|
8896
9007
|
|
|
8897
9008
|
for (var i = 0; i < this.set.length; i++) {
|
|
@@ -9158,19 +9269,49 @@ function coerce (version, options) {
|
|
|
9158
9269
|
return version
|
|
9159
9270
|
}
|
|
9160
9271
|
|
|
9272
|
+
if (typeof version === 'number') {
|
|
9273
|
+
version = String(version)
|
|
9274
|
+
}
|
|
9275
|
+
|
|
9161
9276
|
if (typeof version !== 'string') {
|
|
9162
9277
|
return null
|
|
9163
9278
|
}
|
|
9164
9279
|
|
|
9165
|
-
|
|
9280
|
+
options = options || {}
|
|
9166
9281
|
|
|
9167
|
-
|
|
9282
|
+
var match = null
|
|
9283
|
+
if (!options.rtl) {
|
|
9284
|
+
match = version.match(safeRe[t.COERCE])
|
|
9285
|
+
} else {
|
|
9286
|
+
// Find the right-most coercible string that does not share
|
|
9287
|
+
// a terminus with a more left-ward coercible string.
|
|
9288
|
+
// Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4'
|
|
9289
|
+
//
|
|
9290
|
+
// Walk through the string checking with a /g regexp
|
|
9291
|
+
// Manually set the index so as to pick up overlapping matches.
|
|
9292
|
+
// Stop when we get a match that ends at the string end, since no
|
|
9293
|
+
// coercible string can be more right-ward without the same terminus.
|
|
9294
|
+
var next
|
|
9295
|
+
while ((next = safeRe[t.COERCERTL].exec(version)) &&
|
|
9296
|
+
(!match || match.index + match[0].length !== version.length)
|
|
9297
|
+
) {
|
|
9298
|
+
if (!match ||
|
|
9299
|
+
next.index + next[0].length !== match.index + match[0].length) {
|
|
9300
|
+
match = next
|
|
9301
|
+
}
|
|
9302
|
+
safeRe[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length
|
|
9303
|
+
}
|
|
9304
|
+
// leave it in a clean state
|
|
9305
|
+
safeRe[t.COERCERTL].lastIndex = -1
|
|
9306
|
+
}
|
|
9307
|
+
|
|
9308
|
+
if (match === null) {
|
|
9168
9309
|
return null
|
|
9169
9310
|
}
|
|
9170
9311
|
|
|
9171
|
-
return parse(match[
|
|
9172
|
-
'.' + (match[
|
|
9173
|
-
'.' + (match[
|
|
9312
|
+
return parse(match[2] +
|
|
9313
|
+
'.' + (match[3] || '0') +
|
|
9314
|
+
'.' + (match[4] || '0'), options)
|
|
9174
9315
|
}
|
|
9175
9316
|
|
|
9176
9317
|
|
|
@@ -9888,7 +10029,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
9888
10029
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
9889
10030
|
exports.installBundler = void 0;
|
|
9890
10031
|
const path_1 = __webpack_require__(5622);
|
|
9891
|
-
const semver_1 = __webpack_require__(
|
|
10032
|
+
const semver_1 = __webpack_require__(7846);
|
|
9892
10033
|
const execa_1 = __importDefault(__webpack_require__(4806));
|
|
9893
10034
|
const build_utils_1 = __webpack_require__(3445);
|
|
9894
10035
|
const allOptions = [
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vercel/ruby",
|
|
3
3
|
"author": "Nathan Cahill <nathan@nathancahill.com>",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "2.0.1",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "./dist/index",
|
|
7
7
|
"homepage": "https://vercel.com/docs/runtimes#official-runtimes/ruby",
|
|
@@ -14,19 +14,19 @@
|
|
|
14
14
|
"url": "https://github.com/vercel/vercel.git",
|
|
15
15
|
"directory": "packages/ruby"
|
|
16
16
|
},
|
|
17
|
-
"scripts": {
|
|
18
|
-
"build": "node build",
|
|
19
|
-
"test": "jest --env node --verbose --runInBand --bail",
|
|
20
|
-
"test-e2e": "pnpm test"
|
|
21
|
-
},
|
|
22
17
|
"devDependencies": {
|
|
23
18
|
"@types/fs-extra": "8.0.0",
|
|
24
19
|
"@types/semver": "6.0.0",
|
|
25
|
-
"@vercel/build-utils": "
|
|
20
|
+
"@vercel/build-utils": "7.1.1",
|
|
26
21
|
"@vercel/ncc": "0.24.0",
|
|
27
22
|
"execa": "2.0.4",
|
|
28
23
|
"fs-extra": "^7.0.1",
|
|
29
|
-
"
|
|
24
|
+
"jest-junit": "16.0.0",
|
|
25
|
+
"semver": "6.3.1"
|
|
30
26
|
},
|
|
31
|
-
"
|
|
32
|
-
|
|
27
|
+
"scripts": {
|
|
28
|
+
"build": "node build",
|
|
29
|
+
"test": "jest --reporters=default --reporters=jest-junit --env node --verbose --runInBand --bail",
|
|
30
|
+
"test-e2e": "pnpm test"
|
|
31
|
+
}
|
|
32
|
+
}
|
package/vc_init.rb
CHANGED
|
File without changes
|