@vercel/next 4.0.1 → 4.0.3

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 CHANGED
@@ -770,7 +770,7 @@ module.exports.get_mockS3Http = function() {
770
770
  module.exports = exports;
771
771
 
772
772
  const path = __webpack_require__(5622);
773
- const semver = __webpack_require__(7013);
773
+ const semver = __webpack_require__(6377);
774
774
  const url = __webpack_require__(8835);
775
775
  const detect_libc = __webpack_require__(3200);
776
776
  const napi = __webpack_require__(7469);
@@ -15753,7 +15753,7 @@ module.exports = {
15753
15753
 
15754
15754
  const fs = __webpack_require__(1317)
15755
15755
  const path = __webpack_require__(5622)
15756
- const invalidWin32Path = __webpack_require__(3126).invalidWin32Path
15756
+ const invalidWin32Path = __webpack_require__(9054).invalidWin32Path
15757
15757
 
15758
15758
  const o777 = parseInt('0777', 8)
15759
15759
 
@@ -15815,7 +15815,7 @@ module.exports = mkdirsSync
15815
15815
 
15816
15816
  const fs = __webpack_require__(1317)
15817
15817
  const path = __webpack_require__(5622)
15818
- const invalidWin32Path = __webpack_require__(3126).invalidWin32Path
15818
+ const invalidWin32Path = __webpack_require__(9054).invalidWin32Path
15819
15819
 
15820
15820
  const o777 = parseInt('0777', 8)
15821
15821
 
@@ -15878,7 +15878,7 @@ module.exports = mkdirs
15878
15878
 
15879
15879
  /***/ }),
15880
15880
 
15881
- /***/ 3126:
15881
+ /***/ 9054:
15882
15882
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
15883
15883
 
15884
15884
  "use strict";
@@ -31226,7 +31226,7 @@ SafeBuffer.allocUnsafeSlow = function (size) {
31226
31226
 
31227
31227
  /***/ }),
31228
31228
 
31229
- /***/ 1039:
31229
+ /***/ 7846:
31230
31230
  /***/ ((module, exports) => {
31231
31231
 
31232
31232
  exports = module.exports = SemVer
@@ -31257,78 +31257,111 @@ var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||
31257
31257
  // Max safe segment length for coercion.
31258
31258
  var MAX_SAFE_COMPONENT_LENGTH = 16
31259
31259
 
31260
+ var MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6
31261
+
31260
31262
  // The actual regexps go on exports.re
31261
31263
  var re = exports.re = []
31264
+ var safeRe = exports.safeRe = []
31262
31265
  var src = exports.src = []
31266
+ var t = exports.tokens = {}
31263
31267
  var R = 0
31264
31268
 
31269
+ function tok (n) {
31270
+ t[n] = R++
31271
+ }
31272
+
31273
+ var LETTERDASHNUMBER = '[a-zA-Z0-9-]'
31274
+
31275
+ // Replace some greedy regex tokens to prevent regex dos issues. These regex are
31276
+ // used internally via the safeRe object since all inputs in this library get
31277
+ // normalized first to trim and collapse all extra whitespace. The original
31278
+ // regexes are exported for userland consumption and lower level usage. A
31279
+ // future breaking change could export the safer regex only with a note that
31280
+ // all input should have extra whitespace removed.
31281
+ var safeRegexReplacements = [
31282
+ ['\\s', 1],
31283
+ ['\\d', MAX_LENGTH],
31284
+ [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH],
31285
+ ]
31286
+
31287
+ function makeSafeRe (value) {
31288
+ for (var i = 0; i < safeRegexReplacements.length; i++) {
31289
+ var token = safeRegexReplacements[i][0]
31290
+ var max = safeRegexReplacements[i][1]
31291
+ value = value
31292
+ .split(token + '*').join(token + '{0,' + max + '}')
31293
+ .split(token + '+').join(token + '{1,' + max + '}')
31294
+ }
31295
+ return value
31296
+ }
31297
+
31265
31298
  // The following Regular Expressions can be used for tokenizing,
31266
31299
  // validating, and parsing SemVer version strings.
31267
31300
 
31268
31301
  // ## Numeric Identifier
31269
31302
  // A single `0`, or a non-zero digit followed by zero or more digits.
31270
31303
 
31271
- var NUMERICIDENTIFIER = R++
31272
- src[NUMERICIDENTIFIER] = '0|[1-9]\\d*'
31273
- var NUMERICIDENTIFIERLOOSE = R++
31274
- src[NUMERICIDENTIFIERLOOSE] = '[0-9]+'
31304
+ tok('NUMERICIDENTIFIER')
31305
+ src[t.NUMERICIDENTIFIER] = '0|[1-9]\\d*'
31306
+ tok('NUMERICIDENTIFIERLOOSE')
31307
+ src[t.NUMERICIDENTIFIERLOOSE] = '\\d+'
31275
31308
 
31276
31309
  // ## Non-numeric Identifier
31277
31310
  // Zero or more digits, followed by a letter or hyphen, and then zero or
31278
31311
  // more letters, digits, or hyphens.
31279
31312
 
31280
- var NONNUMERICIDENTIFIER = R++
31281
- src[NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*'
31313
+ tok('NONNUMERICIDENTIFIER')
31314
+ src[t.NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-]' + LETTERDASHNUMBER + '*'
31282
31315
 
31283
31316
  // ## Main Version
31284
31317
  // Three dot-separated numeric identifiers.
31285
31318
 
31286
- var MAINVERSION = R++
31287
- src[MAINVERSION] = '(' + src[NUMERICIDENTIFIER] + ')\\.' +
31288
- '(' + src[NUMERICIDENTIFIER] + ')\\.' +
31289
- '(' + src[NUMERICIDENTIFIER] + ')'
31319
+ tok('MAINVERSION')
31320
+ src[t.MAINVERSION] = '(' + src[t.NUMERICIDENTIFIER] + ')\\.' +
31321
+ '(' + src[t.NUMERICIDENTIFIER] + ')\\.' +
31322
+ '(' + src[t.NUMERICIDENTIFIER] + ')'
31290
31323
 
31291
- var MAINVERSIONLOOSE = R++
31292
- src[MAINVERSIONLOOSE] = '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' +
31293
- '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' +
31294
- '(' + src[NUMERICIDENTIFIERLOOSE] + ')'
31324
+ tok('MAINVERSIONLOOSE')
31325
+ src[t.MAINVERSIONLOOSE] = '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' +
31326
+ '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' +
31327
+ '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')'
31295
31328
 
31296
31329
  // ## Pre-release Version Identifier
31297
31330
  // A numeric identifier, or a non-numeric identifier.
31298
31331
 
31299
- var PRERELEASEIDENTIFIER = R++
31300
- src[PRERELEASEIDENTIFIER] = '(?:' + src[NUMERICIDENTIFIER] +
31301
- '|' + src[NONNUMERICIDENTIFIER] + ')'
31332
+ tok('PRERELEASEIDENTIFIER')
31333
+ src[t.PRERELEASEIDENTIFIER] = '(?:' + src[t.NUMERICIDENTIFIER] +
31334
+ '|' + src[t.NONNUMERICIDENTIFIER] + ')'
31302
31335
 
31303
- var PRERELEASEIDENTIFIERLOOSE = R++
31304
- src[PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[NUMERICIDENTIFIERLOOSE] +
31305
- '|' + src[NONNUMERICIDENTIFIER] + ')'
31336
+ tok('PRERELEASEIDENTIFIERLOOSE')
31337
+ src[t.PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[t.NUMERICIDENTIFIERLOOSE] +
31338
+ '|' + src[t.NONNUMERICIDENTIFIER] + ')'
31306
31339
 
31307
31340
  // ## Pre-release Version
31308
31341
  // Hyphen, followed by one or more dot-separated pre-release version
31309
31342
  // identifiers.
31310
31343
 
31311
- var PRERELEASE = R++
31312
- src[PRERELEASE] = '(?:-(' + src[PRERELEASEIDENTIFIER] +
31313
- '(?:\\.' + src[PRERELEASEIDENTIFIER] + ')*))'
31344
+ tok('PRERELEASE')
31345
+ src[t.PRERELEASE] = '(?:-(' + src[t.PRERELEASEIDENTIFIER] +
31346
+ '(?:\\.' + src[t.PRERELEASEIDENTIFIER] + ')*))'
31314
31347
 
31315
- var PRERELEASELOOSE = R++
31316
- src[PRERELEASELOOSE] = '(?:-?(' + src[PRERELEASEIDENTIFIERLOOSE] +
31317
- '(?:\\.' + src[PRERELEASEIDENTIFIERLOOSE] + ')*))'
31348
+ tok('PRERELEASELOOSE')
31349
+ src[t.PRERELEASELOOSE] = '(?:-?(' + src[t.PRERELEASEIDENTIFIERLOOSE] +
31350
+ '(?:\\.' + src[t.PRERELEASEIDENTIFIERLOOSE] + ')*))'
31318
31351
 
31319
31352
  // ## Build Metadata Identifier
31320
31353
  // Any combination of digits, letters, or hyphens.
31321
31354
 
31322
- var BUILDIDENTIFIER = R++
31323
- src[BUILDIDENTIFIER] = '[0-9A-Za-z-]+'
31355
+ tok('BUILDIDENTIFIER')
31356
+ src[t.BUILDIDENTIFIER] = LETTERDASHNUMBER + '+'
31324
31357
 
31325
31358
  // ## Build Metadata
31326
31359
  // Plus sign, followed by one or more period-separated build metadata
31327
31360
  // identifiers.
31328
31361
 
31329
- var BUILD = R++
31330
- src[BUILD] = '(?:\\+(' + src[BUILDIDENTIFIER] +
31331
- '(?:\\.' + src[BUILDIDENTIFIER] + ')*))'
31362
+ tok('BUILD')
31363
+ src[t.BUILD] = '(?:\\+(' + src[t.BUILDIDENTIFIER] +
31364
+ '(?:\\.' + src[t.BUILDIDENTIFIER] + ')*))'
31332
31365
 
31333
31366
  // ## Full Version String
31334
31367
  // A main version, followed optionally by a pre-release version and
@@ -31339,129 +31372,137 @@ src[BUILD] = '(?:\\+(' + src[BUILDIDENTIFIER] +
31339
31372
  // capturing group, because it should not ever be used in version
31340
31373
  // comparison.
31341
31374
 
31342
- var FULL = R++
31343
- var FULLPLAIN = 'v?' + src[MAINVERSION] +
31344
- src[PRERELEASE] + '?' +
31345
- src[BUILD] + '?'
31375
+ tok('FULL')
31376
+ tok('FULLPLAIN')
31377
+ src[t.FULLPLAIN] = 'v?' + src[t.MAINVERSION] +
31378
+ src[t.PRERELEASE] + '?' +
31379
+ src[t.BUILD] + '?'
31346
31380
 
31347
- src[FULL] = '^' + FULLPLAIN + '$'
31381
+ src[t.FULL] = '^' + src[t.FULLPLAIN] + '$'
31348
31382
 
31349
31383
  // like full, but allows v1.2.3 and =1.2.3, which people do sometimes.
31350
31384
  // also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty
31351
31385
  // common in the npm registry.
31352
- var LOOSEPLAIN = '[v=\\s]*' + src[MAINVERSIONLOOSE] +
31353
- src[PRERELEASELOOSE] + '?' +
31354
- src[BUILD] + '?'
31386
+ tok('LOOSEPLAIN')
31387
+ src[t.LOOSEPLAIN] = '[v=\\s]*' + src[t.MAINVERSIONLOOSE] +
31388
+ src[t.PRERELEASELOOSE] + '?' +
31389
+ src[t.BUILD] + '?'
31355
31390
 
31356
- var LOOSE = R++
31357
- src[LOOSE] = '^' + LOOSEPLAIN + '$'
31391
+ tok('LOOSE')
31392
+ src[t.LOOSE] = '^' + src[t.LOOSEPLAIN] + '$'
31358
31393
 
31359
- var GTLT = R++
31360
- src[GTLT] = '((?:<|>)?=?)'
31394
+ tok('GTLT')
31395
+ src[t.GTLT] = '((?:<|>)?=?)'
31361
31396
 
31362
31397
  // Something like "2.*" or "1.2.x".
31363
31398
  // Note that "x.x" is a valid xRange identifer, meaning "any version"
31364
31399
  // Only the first item is strictly required.
31365
- var XRANGEIDENTIFIERLOOSE = R++
31366
- src[XRANGEIDENTIFIERLOOSE] = src[NUMERICIDENTIFIERLOOSE] + '|x|X|\\*'
31367
- var XRANGEIDENTIFIER = R++
31368
- src[XRANGEIDENTIFIER] = src[NUMERICIDENTIFIER] + '|x|X|\\*'
31369
-
31370
- var XRANGEPLAIN = R++
31371
- src[XRANGEPLAIN] = '[v=\\s]*(' + src[XRANGEIDENTIFIER] + ')' +
31372
- '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' +
31373
- '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' +
31374
- '(?:' + src[PRERELEASE] + ')?' +
31375
- src[BUILD] + '?' +
31400
+ tok('XRANGEIDENTIFIERLOOSE')
31401
+ src[t.XRANGEIDENTIFIERLOOSE] = src[t.NUMERICIDENTIFIERLOOSE] + '|x|X|\\*'
31402
+ tok('XRANGEIDENTIFIER')
31403
+ src[t.XRANGEIDENTIFIER] = src[t.NUMERICIDENTIFIER] + '|x|X|\\*'
31404
+
31405
+ tok('XRANGEPLAIN')
31406
+ src[t.XRANGEPLAIN] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIER] + ')' +
31407
+ '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' +
31408
+ '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' +
31409
+ '(?:' + src[t.PRERELEASE] + ')?' +
31410
+ src[t.BUILD] + '?' +
31376
31411
  ')?)?'
31377
31412
 
31378
- var XRANGEPLAINLOOSE = R++
31379
- src[XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
31380
- '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
31381
- '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
31382
- '(?:' + src[PRERELEASELOOSE] + ')?' +
31383
- src[BUILD] + '?' +
31413
+ tok('XRANGEPLAINLOOSE')
31414
+ src[t.XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
31415
+ '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
31416
+ '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
31417
+ '(?:' + src[t.PRERELEASELOOSE] + ')?' +
31418
+ src[t.BUILD] + '?' +
31384
31419
  ')?)?'
31385
31420
 
31386
- var XRANGE = R++
31387
- src[XRANGE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAIN] + '$'
31388
- var XRANGELOOSE = R++
31389
- src[XRANGELOOSE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAINLOOSE] + '$'
31421
+ tok('XRANGE')
31422
+ src[t.XRANGE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAIN] + '$'
31423
+ tok('XRANGELOOSE')
31424
+ src[t.XRANGELOOSE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAINLOOSE] + '$'
31390
31425
 
31391
31426
  // Coercion.
31392
31427
  // Extract anything that could conceivably be a part of a valid semver
31393
- var COERCE = R++
31394
- src[COERCE] = '(?:^|[^\\d])' +
31428
+ tok('COERCE')
31429
+ src[t.COERCE] = '(^|[^\\d])' +
31395
31430
  '(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' +
31396
31431
  '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
31397
31432
  '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
31398
31433
  '(?:$|[^\\d])'
31434
+ tok('COERCERTL')
31435
+ re[t.COERCERTL] = new RegExp(src[t.COERCE], 'g')
31436
+ safeRe[t.COERCERTL] = new RegExp(makeSafeRe(src[t.COERCE]), 'g')
31399
31437
 
31400
31438
  // Tilde ranges.
31401
31439
  // Meaning is "reasonably at or greater than"
31402
- var LONETILDE = R++
31403
- src[LONETILDE] = '(?:~>?)'
31440
+ tok('LONETILDE')
31441
+ src[t.LONETILDE] = '(?:~>?)'
31404
31442
 
31405
- var TILDETRIM = R++
31406
- src[TILDETRIM] = '(\\s*)' + src[LONETILDE] + '\\s+'
31407
- re[TILDETRIM] = new RegExp(src[TILDETRIM], 'g')
31443
+ tok('TILDETRIM')
31444
+ src[t.TILDETRIM] = '(\\s*)' + src[t.LONETILDE] + '\\s+'
31445
+ re[t.TILDETRIM] = new RegExp(src[t.TILDETRIM], 'g')
31446
+ safeRe[t.TILDETRIM] = new RegExp(makeSafeRe(src[t.TILDETRIM]), 'g')
31408
31447
  var tildeTrimReplace = '$1~'
31409
31448
 
31410
- var TILDE = R++
31411
- src[TILDE] = '^' + src[LONETILDE] + src[XRANGEPLAIN] + '$'
31412
- var TILDELOOSE = R++
31413
- src[TILDELOOSE] = '^' + src[LONETILDE] + src[XRANGEPLAINLOOSE] + '$'
31449
+ tok('TILDE')
31450
+ src[t.TILDE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAIN] + '$'
31451
+ tok('TILDELOOSE')
31452
+ src[t.TILDELOOSE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAINLOOSE] + '$'
31414
31453
 
31415
31454
  // Caret ranges.
31416
31455
  // Meaning is "at least and backwards compatible with"
31417
- var LONECARET = R++
31418
- src[LONECARET] = '(?:\\^)'
31456
+ tok('LONECARET')
31457
+ src[t.LONECARET] = '(?:\\^)'
31419
31458
 
31420
- var CARETTRIM = R++
31421
- src[CARETTRIM] = '(\\s*)' + src[LONECARET] + '\\s+'
31422
- re[CARETTRIM] = new RegExp(src[CARETTRIM], 'g')
31459
+ tok('CARETTRIM')
31460
+ src[t.CARETTRIM] = '(\\s*)' + src[t.LONECARET] + '\\s+'
31461
+ re[t.CARETTRIM] = new RegExp(src[t.CARETTRIM], 'g')
31462
+ safeRe[t.CARETTRIM] = new RegExp(makeSafeRe(src[t.CARETTRIM]), 'g')
31423
31463
  var caretTrimReplace = '$1^'
31424
31464
 
31425
- var CARET = R++
31426
- src[CARET] = '^' + src[LONECARET] + src[XRANGEPLAIN] + '$'
31427
- var CARETLOOSE = R++
31428
- src[CARETLOOSE] = '^' + src[LONECARET] + src[XRANGEPLAINLOOSE] + '$'
31465
+ tok('CARET')
31466
+ src[t.CARET] = '^' + src[t.LONECARET] + src[t.XRANGEPLAIN] + '$'
31467
+ tok('CARETLOOSE')
31468
+ src[t.CARETLOOSE] = '^' + src[t.LONECARET] + src[t.XRANGEPLAINLOOSE] + '$'
31429
31469
 
31430
31470
  // A simple gt/lt/eq thing, or just "" to indicate "any version"
31431
- var COMPARATORLOOSE = R++
31432
- src[COMPARATORLOOSE] = '^' + src[GTLT] + '\\s*(' + LOOSEPLAIN + ')$|^$'
31433
- var COMPARATOR = R++
31434
- src[COMPARATOR] = '^' + src[GTLT] + '\\s*(' + FULLPLAIN + ')$|^$'
31471
+ tok('COMPARATORLOOSE')
31472
+ src[t.COMPARATORLOOSE] = '^' + src[t.GTLT] + '\\s*(' + src[t.LOOSEPLAIN] + ')$|^$'
31473
+ tok('COMPARATOR')
31474
+ src[t.COMPARATOR] = '^' + src[t.GTLT] + '\\s*(' + src[t.FULLPLAIN] + ')$|^$'
31435
31475
 
31436
31476
  // An expression to strip any whitespace between the gtlt and the thing
31437
31477
  // it modifies, so that `> 1.2.3` ==> `>1.2.3`
31438
- var COMPARATORTRIM = R++
31439
- src[COMPARATORTRIM] = '(\\s*)' + src[GTLT] +
31440
- '\\s*(' + LOOSEPLAIN + '|' + src[XRANGEPLAIN] + ')'
31478
+ tok('COMPARATORTRIM')
31479
+ src[t.COMPARATORTRIM] = '(\\s*)' + src[t.GTLT] +
31480
+ '\\s*(' + src[t.LOOSEPLAIN] + '|' + src[t.XRANGEPLAIN] + ')'
31441
31481
 
31442
31482
  // this one has to use the /g flag
31443
- re[COMPARATORTRIM] = new RegExp(src[COMPARATORTRIM], 'g')
31483
+ re[t.COMPARATORTRIM] = new RegExp(src[t.COMPARATORTRIM], 'g')
31484
+ safeRe[t.COMPARATORTRIM] = new RegExp(makeSafeRe(src[t.COMPARATORTRIM]), 'g')
31444
31485
  var comparatorTrimReplace = '$1$2$3'
31445
31486
 
31446
31487
  // Something like `1.2.3 - 1.2.4`
31447
31488
  // Note that these all use the loose form, because they'll be
31448
31489
  // checked against either the strict or loose comparator form
31449
31490
  // later.
31450
- var HYPHENRANGE = R++
31451
- src[HYPHENRANGE] = '^\\s*(' + src[XRANGEPLAIN] + ')' +
31491
+ tok('HYPHENRANGE')
31492
+ src[t.HYPHENRANGE] = '^\\s*(' + src[t.XRANGEPLAIN] + ')' +
31452
31493
  '\\s+-\\s+' +
31453
- '(' + src[XRANGEPLAIN] + ')' +
31494
+ '(' + src[t.XRANGEPLAIN] + ')' +
31454
31495
  '\\s*$'
31455
31496
 
31456
- var HYPHENRANGELOOSE = R++
31457
- src[HYPHENRANGELOOSE] = '^\\s*(' + src[XRANGEPLAINLOOSE] + ')' +
31497
+ tok('HYPHENRANGELOOSE')
31498
+ src[t.HYPHENRANGELOOSE] = '^\\s*(' + src[t.XRANGEPLAINLOOSE] + ')' +
31458
31499
  '\\s+-\\s+' +
31459
- '(' + src[XRANGEPLAINLOOSE] + ')' +
31500
+ '(' + src[t.XRANGEPLAINLOOSE] + ')' +
31460
31501
  '\\s*$'
31461
31502
 
31462
31503
  // Star ranges basically just allow anything at all.
31463
- var STAR = R++
31464
- src[STAR] = '(<|>)?=?\\s*\\*'
31504
+ tok('STAR')
31505
+ src[t.STAR] = '(<|>)?=?\\s*\\*'
31465
31506
 
31466
31507
  // Compile to actual regexp objects.
31467
31508
  // All are flag-free, unless they were created above with a flag.
@@ -31469,6 +31510,14 @@ for (var i = 0; i < R; i++) {
31469
31510
  debug(i, src[i])
31470
31511
  if (!re[i]) {
31471
31512
  re[i] = new RegExp(src[i])
31513
+
31514
+ // Replace all greedy whitespace to prevent regex dos issues. These regex are
31515
+ // used internally via the safeRe object since all inputs in this library get
31516
+ // normalized first to trim and collapse all extra whitespace. The original
31517
+ // regexes are exported for userland consumption and lower level usage. A
31518
+ // future breaking change could export the safer regex only with a note that
31519
+ // all input should have extra whitespace removed.
31520
+ safeRe[i] = new RegExp(makeSafeRe(src[i]))
31472
31521
  }
31473
31522
  }
31474
31523
 
@@ -31493,7 +31542,7 @@ function parse (version, options) {
31493
31542
  return null
31494
31543
  }
31495
31544
 
31496
- var r = options.loose ? re[LOOSE] : re[FULL]
31545
+ var r = options.loose ? safeRe[t.LOOSE] : safeRe[t.FULL]
31497
31546
  if (!r.test(version)) {
31498
31547
  return null
31499
31548
  }
@@ -31548,7 +31597,7 @@ function SemVer (version, options) {
31548
31597
  this.options = options
31549
31598
  this.loose = !!options.loose
31550
31599
 
31551
- var m = version.trim().match(options.loose ? re[LOOSE] : re[FULL])
31600
+ var m = version.trim().match(options.loose ? safeRe[t.LOOSE] : safeRe[t.FULL])
31552
31601
 
31553
31602
  if (!m) {
31554
31603
  throw new TypeError('Invalid Version: ' + version)
@@ -31993,6 +32042,7 @@ function Comparator (comp, options) {
31993
32042
  return new Comparator(comp, options)
31994
32043
  }
31995
32044
 
32045
+ comp = comp.trim().split(/\s+/).join(' ')
31996
32046
  debug('comparator', comp, options)
31997
32047
  this.options = options
31998
32048
  this.loose = !!options.loose
@@ -32009,7 +32059,7 @@ function Comparator (comp, options) {
32009
32059
 
32010
32060
  var ANY = {}
32011
32061
  Comparator.prototype.parse = function (comp) {
32012
- var r = this.options.loose ? re[COMPARATORLOOSE] : re[COMPARATOR]
32062
+ var r = this.options.loose ? safeRe[t.COMPARATORLOOSE] : safeRe[t.COMPARATOR]
32013
32063
  var m = comp.match(r)
32014
32064
 
32015
32065
  if (!m) {
@@ -32041,7 +32091,11 @@ Comparator.prototype.test = function (version) {
32041
32091
  }
32042
32092
 
32043
32093
  if (typeof version === 'string') {
32044
- version = new SemVer(version, this.options)
32094
+ try {
32095
+ version = new SemVer(version, this.options)
32096
+ } catch (er) {
32097
+ return false
32098
+ }
32045
32099
  }
32046
32100
 
32047
32101
  return cmp(version, this.operator, this.semver, this.options)
@@ -32129,9 +32183,16 @@ function Range (range, options) {
32129
32183
  this.loose = !!options.loose
32130
32184
  this.includePrerelease = !!options.includePrerelease
32131
32185
 
32132
- // First, split based on boolean or ||
32186
+ // First reduce all whitespace as much as possible so we do not have to rely
32187
+ // on potentially slow regexes like \s*. This is then stored and used for
32188
+ // future error messages as well.
32133
32189
  this.raw = range
32134
- this.set = range.split(/\s*\|\|\s*/).map(function (range) {
32190
+ .trim()
32191
+ .split(/\s+/)
32192
+ .join(' ')
32193
+
32194
+ // First, split based on boolean or ||
32195
+ this.set = this.raw.split('||').map(function (range) {
32135
32196
  return this.parseRange(range.trim())
32136
32197
  }, this).filter(function (c) {
32137
32198
  // throw out any that are not relevant for whatever reason
@@ -32139,7 +32200,7 @@ function Range (range, options) {
32139
32200
  })
32140
32201
 
32141
32202
  if (!this.set.length) {
32142
- throw new TypeError('Invalid SemVer Range: ' + range)
32203
+ throw new TypeError('Invalid SemVer Range: ' + this.raw)
32143
32204
  }
32144
32205
 
32145
32206
  this.format()
@@ -32158,20 +32219,19 @@ Range.prototype.toString = function () {
32158
32219
 
32159
32220
  Range.prototype.parseRange = function (range) {
32160
32221
  var loose = this.options.loose
32161
- range = range.trim()
32162
32222
  // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`
32163
- var hr = loose ? re[HYPHENRANGELOOSE] : re[HYPHENRANGE]
32223
+ var hr = loose ? safeRe[t.HYPHENRANGELOOSE] : safeRe[t.HYPHENRANGE]
32164
32224
  range = range.replace(hr, hyphenReplace)
32165
32225
  debug('hyphen replace', range)
32166
32226
  // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`
32167
- range = range.replace(re[COMPARATORTRIM], comparatorTrimReplace)
32168
- debug('comparator trim', range, re[COMPARATORTRIM])
32227
+ range = range.replace(safeRe[t.COMPARATORTRIM], comparatorTrimReplace)
32228
+ debug('comparator trim', range, safeRe[t.COMPARATORTRIM])
32169
32229
 
32170
32230
  // `~ 1.2.3` => `~1.2.3`
32171
- range = range.replace(re[TILDETRIM], tildeTrimReplace)
32231
+ range = range.replace(safeRe[t.TILDETRIM], tildeTrimReplace)
32172
32232
 
32173
32233
  // `^ 1.2.3` => `^1.2.3`
32174
- range = range.replace(re[CARETTRIM], caretTrimReplace)
32234
+ range = range.replace(safeRe[t.CARETTRIM], caretTrimReplace)
32175
32235
 
32176
32236
  // normalize spaces
32177
32237
  range = range.split(/\s+/).join(' ')
@@ -32179,7 +32239,7 @@ Range.prototype.parseRange = function (range) {
32179
32239
  // At this point, the range is completely trimmed and
32180
32240
  // ready to be split into comparators.
32181
32241
 
32182
- var compRe = loose ? re[COMPARATORLOOSE] : re[COMPARATOR]
32242
+ var compRe = loose ? safeRe[t.COMPARATORLOOSE] : safeRe[t.COMPARATOR]
32183
32243
  var set = range.split(' ').map(function (comp) {
32184
32244
  return parseComparator(comp, this.options)
32185
32245
  }, this).join(' ').split(/\s+/)
@@ -32279,7 +32339,7 @@ function replaceTildes (comp, options) {
32279
32339
  }
32280
32340
 
32281
32341
  function replaceTilde (comp, options) {
32282
- var r = options.loose ? re[TILDELOOSE] : re[TILDE]
32342
+ var r = options.loose ? safeRe[t.TILDELOOSE] : safeRe[t.TILDE]
32283
32343
  return comp.replace(r, function (_, M, m, p, pr) {
32284
32344
  debug('tilde', comp, _, M, m, p, pr)
32285
32345
  var ret
@@ -32320,7 +32380,7 @@ function replaceCarets (comp, options) {
32320
32380
 
32321
32381
  function replaceCaret (comp, options) {
32322
32382
  debug('caret', comp, options)
32323
- var r = options.loose ? re[CARETLOOSE] : re[CARET]
32383
+ var r = options.loose ? safeRe[t.CARETLOOSE] : safeRe[t.CARET]
32324
32384
  return comp.replace(r, function (_, M, m, p, pr) {
32325
32385
  debug('caret', comp, _, M, m, p, pr)
32326
32386
  var ret
@@ -32379,7 +32439,7 @@ function replaceXRanges (comp, options) {
32379
32439
 
32380
32440
  function replaceXRange (comp, options) {
32381
32441
  comp = comp.trim()
32382
- var r = options.loose ? re[XRANGELOOSE] : re[XRANGE]
32442
+ var r = options.loose ? safeRe[t.XRANGELOOSE] : safeRe[t.XRANGE]
32383
32443
  return comp.replace(r, function (ret, gtlt, M, m, p, pr) {
32384
32444
  debug('xRange', comp, ret, gtlt, M, m, p, pr)
32385
32445
  var xM = isX(M)
@@ -32391,10 +32451,14 @@ function replaceXRange (comp, options) {
32391
32451
  gtlt = ''
32392
32452
  }
32393
32453
 
32454
+ // if we're including prereleases in the match, then we need
32455
+ // to fix this to -0, the lowest possible prerelease value
32456
+ pr = options.includePrerelease ? '-0' : ''
32457
+
32394
32458
  if (xM) {
32395
32459
  if (gtlt === '>' || gtlt === '<') {
32396
32460
  // nothing is allowed
32397
- ret = '<0.0.0'
32461
+ ret = '<0.0.0-0'
32398
32462
  } else {
32399
32463
  // nothing is forbidden
32400
32464
  ret = '*'
@@ -32431,11 +32495,12 @@ function replaceXRange (comp, options) {
32431
32495
  }
32432
32496
  }
32433
32497
 
32434
- ret = gtlt + M + '.' + m + '.' + p
32498
+ ret = gtlt + M + '.' + m + '.' + p + pr
32435
32499
  } else if (xm) {
32436
- ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
32500
+ ret = '>=' + M + '.0.0' + pr + ' <' + (+M + 1) + '.0.0' + pr
32437
32501
  } else if (xp) {
32438
- ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
32502
+ ret = '>=' + M + '.' + m + '.0' + pr +
32503
+ ' <' + M + '.' + (+m + 1) + '.0' + pr
32439
32504
  }
32440
32505
 
32441
32506
  debug('xRange return', ret)
@@ -32449,10 +32514,10 @@ function replaceXRange (comp, options) {
32449
32514
  function replaceStars (comp, options) {
32450
32515
  debug('replaceStars', comp, options)
32451
32516
  // Looseness is ignored here. star is always as loose as it gets!
32452
- return comp.trim().replace(re[STAR], '')
32517
+ return comp.trim().replace(safeRe[t.STAR], '')
32453
32518
  }
32454
32519
 
32455
- // This function is passed to string.replace(re[HYPHENRANGE])
32520
+ // This function is passed to string.replace(re[t.HYPHENRANGE])
32456
32521
  // M, m, patch, prerelease, build
32457
32522
  // 1.2 - 3.4.5 => >=1.2.0 <=3.4.5
32458
32523
  // 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do
@@ -32492,7 +32557,11 @@ Range.prototype.test = function (version) {
32492
32557
  }
32493
32558
 
32494
32559
  if (typeof version === 'string') {
32495
- version = new SemVer(version, this.options)
32560
+ try {
32561
+ version = new SemVer(version, this.options)
32562
+ } catch (er) {
32563
+ return false
32564
+ }
32496
32565
  }
32497
32566
 
32498
32567
  for (var i = 0; i < this.set.length; i++) {
@@ -32759,25 +32828,55 @@ function coerce (version, options) {
32759
32828
  return version
32760
32829
  }
32761
32830
 
32831
+ if (typeof version === 'number') {
32832
+ version = String(version)
32833
+ }
32834
+
32762
32835
  if (typeof version !== 'string') {
32763
32836
  return null
32764
32837
  }
32765
32838
 
32766
- var match = version.match(re[COERCE])
32839
+ options = options || {}
32767
32840
 
32768
- if (match == null) {
32841
+ var match = null
32842
+ if (!options.rtl) {
32843
+ match = version.match(safeRe[t.COERCE])
32844
+ } else {
32845
+ // Find the right-most coercible string that does not share
32846
+ // a terminus with a more left-ward coercible string.
32847
+ // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4'
32848
+ //
32849
+ // Walk through the string checking with a /g regexp
32850
+ // Manually set the index so as to pick up overlapping matches.
32851
+ // Stop when we get a match that ends at the string end, since no
32852
+ // coercible string can be more right-ward without the same terminus.
32853
+ var next
32854
+ while ((next = safeRe[t.COERCERTL].exec(version)) &&
32855
+ (!match || match.index + match[0].length !== version.length)
32856
+ ) {
32857
+ if (!match ||
32858
+ next.index + next[0].length !== match.index + match[0].length) {
32859
+ match = next
32860
+ }
32861
+ safeRe[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length
32862
+ }
32863
+ // leave it in a clean state
32864
+ safeRe[t.COERCERTL].lastIndex = -1
32865
+ }
32866
+
32867
+ if (match === null) {
32769
32868
  return null
32770
32869
  }
32771
32870
 
32772
- return parse(match[1] +
32773
- '.' + (match[2] || '0') +
32774
- '.' + (match[3] || '0'), options)
32871
+ return parse(match[2] +
32872
+ '.' + (match[3] || '0') +
32873
+ '.' + (match[4] || '0'), options)
32775
32874
  }
32776
32875
 
32777
32876
 
32778
32877
  /***/ }),
32779
32878
 
32780
- /***/ 2816:
32879
+ /***/ 9449:
32781
32880
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
32782
32881
 
32783
32882
  const ANY = Symbol('SemVer ANY')
@@ -32798,6 +32897,7 @@ class Comparator {
32798
32897
  }
32799
32898
  }
32800
32899
 
32900
+ comp = comp.trim().split(/\s+/).join(' ')
32801
32901
  debug('comparator', comp, options)
32802
32902
  this.options = options
32803
32903
  this.loose = !!options.loose
@@ -32860,13 +32960,6 @@ class Comparator {
32860
32960
  throw new TypeError('a Comparator is required')
32861
32961
  }
32862
32962
 
32863
- if (!options || typeof options !== 'object') {
32864
- options = {
32865
- loose: !!options,
32866
- includePrerelease: false,
32867
- }
32868
- }
32869
-
32870
32963
  if (this.operator === '') {
32871
32964
  if (this.value === '') {
32872
32965
  return true
@@ -32879,48 +32972,59 @@ class Comparator {
32879
32972
  return new Range(this.value, options).test(comp.semver)
32880
32973
  }
32881
32974
 
32882
- const sameDirectionIncreasing =
32883
- (this.operator === '>=' || this.operator === '>') &&
32884
- (comp.operator === '>=' || comp.operator === '>')
32885
- const sameDirectionDecreasing =
32886
- (this.operator === '<=' || this.operator === '<') &&
32887
- (comp.operator === '<=' || comp.operator === '<')
32888
- const sameSemVer = this.semver.version === comp.semver.version
32889
- const differentDirectionsInclusive =
32890
- (this.operator === '>=' || this.operator === '<=') &&
32891
- (comp.operator === '>=' || comp.operator === '<=')
32892
- const oppositeDirectionsLessThan =
32893
- cmp(this.semver, '<', comp.semver, options) &&
32894
- (this.operator === '>=' || this.operator === '>') &&
32895
- (comp.operator === '<=' || comp.operator === '<')
32896
- const oppositeDirectionsGreaterThan =
32897
- cmp(this.semver, '>', comp.semver, options) &&
32898
- (this.operator === '<=' || this.operator === '<') &&
32899
- (comp.operator === '>=' || comp.operator === '>')
32975
+ options = parseOptions(options)
32900
32976
 
32901
- return (
32902
- sameDirectionIncreasing ||
32903
- sameDirectionDecreasing ||
32904
- (sameSemVer && differentDirectionsInclusive) ||
32905
- oppositeDirectionsLessThan ||
32906
- oppositeDirectionsGreaterThan
32907
- )
32977
+ // Special cases where nothing can possibly be lower
32978
+ if (options.includePrerelease &&
32979
+ (this.value === '<0.0.0-0' || comp.value === '<0.0.0-0')) {
32980
+ return false
32981
+ }
32982
+ if (!options.includePrerelease &&
32983
+ (this.value.startsWith('<0.0.0') || comp.value.startsWith('<0.0.0'))) {
32984
+ return false
32985
+ }
32986
+
32987
+ // Same direction increasing (> or >=)
32988
+ if (this.operator.startsWith('>') && comp.operator.startsWith('>')) {
32989
+ return true
32990
+ }
32991
+ // Same direction decreasing (< or <=)
32992
+ if (this.operator.startsWith('<') && comp.operator.startsWith('<')) {
32993
+ return true
32994
+ }
32995
+ // same SemVer and both sides are inclusive (<= or >=)
32996
+ if (
32997
+ (this.semver.version === comp.semver.version) &&
32998
+ this.operator.includes('=') && comp.operator.includes('=')) {
32999
+ return true
33000
+ }
33001
+ // opposite directions less than
33002
+ if (cmp(this.semver, '<', comp.semver, options) &&
33003
+ this.operator.startsWith('>') && comp.operator.startsWith('<')) {
33004
+ return true
33005
+ }
33006
+ // opposite directions greater than
33007
+ if (cmp(this.semver, '>', comp.semver, options) &&
33008
+ this.operator.startsWith('<') && comp.operator.startsWith('>')) {
33009
+ return true
33010
+ }
33011
+ return false
32908
33012
  }
32909
33013
  }
32910
33014
 
32911
33015
  module.exports = Comparator
32912
33016
 
32913
- const parseOptions = __webpack_require__(3858)
32914
- const { re, t } = __webpack_require__(1411)
32915
- const cmp = __webpack_require__(1606)
32916
- const debug = __webpack_require__(7202)
32917
- const SemVer = __webpack_require__(6971)
32918
- const Range = __webpack_require__(5872)
33017
+ const parseOptions = __webpack_require__(8166)
33018
+ const { safeRe: re, t } = __webpack_require__(2298)
33019
+ const cmp = __webpack_require__(6696)
33020
+ const debug = __webpack_require__(107)
33021
+ const SemVer = __webpack_require__(7234)
33022
+ const Range = __webpack_require__(2486)
32919
33023
 
32920
33024
 
32921
33025
  /***/ }),
32922
33026
 
32923
- /***/ 5872:
33027
+ /***/ 2486:
32924
33028
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
32925
33029
 
32926
33030
  // hoisted class for cyclic dependency
@@ -32951,19 +33055,26 @@ class Range {
32951
33055
  this.loose = !!options.loose
32952
33056
  this.includePrerelease = !!options.includePrerelease
32953
33057
 
32954
- // First, split based on boolean or ||
33058
+ // First reduce all whitespace as much as possible so we do not have to rely
33059
+ // on potentially slow regexes like \s*. This is then stored and used for
33060
+ // future error messages as well.
32955
33061
  this.raw = range
32956
- this.set = range
33062
+ .trim()
33063
+ .split(/\s+/)
33064
+ .join(' ')
33065
+
33066
+ // First, split on ||
33067
+ this.set = this.raw
32957
33068
  .split('||')
32958
33069
  // map the range to a 2d array of comparators
32959
- .map(r => this.parseRange(r.trim()))
33070
+ .map(r => this.parseRange(r))
32960
33071
  // throw out any comparator lists that are empty
32961
33072
  // this generally means that it was not a valid range, which is allowed
32962
33073
  // in loose mode, but will still throw if the WHOLE range is invalid.
32963
33074
  .filter(c => c.length)
32964
33075
 
32965
33076
  if (!this.set.length) {
32966
- throw new TypeError(`Invalid SemVer Range: ${range}`)
33077
+ throw new TypeError(`Invalid SemVer Range: ${this.raw}`)
32967
33078
  }
32968
33079
 
32969
33080
  // if we have any that are not the null set, throw out null sets.
@@ -32989,9 +33100,7 @@ class Range {
32989
33100
 
32990
33101
  format () {
32991
33102
  this.range = this.set
32992
- .map((comps) => {
32993
- return comps.join(' ').trim()
32994
- })
33103
+ .map((comps) => comps.join(' ').trim())
32995
33104
  .join('||')
32996
33105
  .trim()
32997
33106
  return this.range
@@ -33002,12 +33111,12 @@ class Range {
33002
33111
  }
33003
33112
 
33004
33113
  parseRange (range) {
33005
- range = range.trim()
33006
-
33007
33114
  // memoize range parsing for performance.
33008
33115
  // this is a very hot path, and fully deterministic.
33009
- const memoOpts = Object.keys(this.options).join(',')
33010
- const memoKey = `parseRange:${memoOpts}:${range}`
33116
+ const memoOpts =
33117
+ (this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) |
33118
+ (this.options.loose && FLAG_LOOSE)
33119
+ const memoKey = memoOpts + ':' + range
33011
33120
  const cached = cache.get(memoKey)
33012
33121
  if (cached) {
33013
33122
  return cached
@@ -33028,9 +33137,6 @@ class Range {
33028
33137
  // `^ 1.2.3` => `^1.2.3`
33029
33138
  range = range.replace(re[t.CARETTRIM], caretTrimReplace)
33030
33139
 
33031
- // normalize spaces
33032
- range = range.split(/\s+/).join(' ')
33033
-
33034
33140
  // At this point, the range is completely trimmed and
33035
33141
  // ready to be split into comparators.
33036
33142
 
@@ -33115,22 +33221,24 @@ class Range {
33115
33221
  return false
33116
33222
  }
33117
33223
  }
33224
+
33118
33225
  module.exports = Range
33119
33226
 
33120
33227
  const LRU = __webpack_require__(6472)
33121
33228
  const cache = new LRU({ max: 1000 })
33122
33229
 
33123
- const parseOptions = __webpack_require__(3858)
33124
- const Comparator = __webpack_require__(2816)
33125
- const debug = __webpack_require__(7202)
33126
- const SemVer = __webpack_require__(6971)
33230
+ const parseOptions = __webpack_require__(8166)
33231
+ const Comparator = __webpack_require__(9449)
33232
+ const debug = __webpack_require__(107)
33233
+ const SemVer = __webpack_require__(7234)
33127
33234
  const {
33128
- re,
33235
+ safeRe: re,
33129
33236
  t,
33130
33237
  comparatorTrimReplace,
33131
33238
  tildeTrimReplace,
33132
33239
  caretTrimReplace,
33133
- } = __webpack_require__(1411)
33240
+ } = __webpack_require__(2298)
33241
+ const { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = __webpack_require__(8925)
33134
33242
 
33135
33243
  const isNullSet = c => c.value === '<0.0.0-0'
33136
33244
  const isAny = c => c.value === ''
@@ -33178,10 +33286,13 @@ const isX = id => !id || id.toLowerCase() === 'x' || id === '*'
33178
33286
  // ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0-0
33179
33287
  // ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0-0
33180
33288
  // ~0.0.1 --> >=0.0.1 <0.1.0-0
33181
- const replaceTildes = (comp, options) =>
33182
- comp.trim().split(/\s+/).map((c) => {
33183
- return replaceTilde(c, options)
33184
- }).join(' ')
33289
+ const replaceTildes = (comp, options) => {
33290
+ return comp
33291
+ .trim()
33292
+ .split(/\s+/)
33293
+ .map((c) => replaceTilde(c, options))
33294
+ .join(' ')
33295
+ }
33185
33296
 
33186
33297
  const replaceTilde = (comp, options) => {
33187
33298
  const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE]
@@ -33219,10 +33330,13 @@ const replaceTilde = (comp, options) => {
33219
33330
  // ^1.2.0 --> >=1.2.0 <2.0.0-0
33220
33331
  // ^0.0.1 --> >=0.0.1 <0.0.2-0
33221
33332
  // ^0.1.0 --> >=0.1.0 <0.2.0-0
33222
- const replaceCarets = (comp, options) =>
33223
- comp.trim().split(/\s+/).map((c) => {
33224
- return replaceCaret(c, options)
33225
- }).join(' ')
33333
+ const replaceCarets = (comp, options) => {
33334
+ return comp
33335
+ .trim()
33336
+ .split(/\s+/)
33337
+ .map((c) => replaceCaret(c, options))
33338
+ .join(' ')
33339
+ }
33226
33340
 
33227
33341
  const replaceCaret = (comp, options) => {
33228
33342
  debug('caret', comp, options)
@@ -33279,9 +33393,10 @@ const replaceCaret = (comp, options) => {
33279
33393
 
33280
33394
  const replaceXRanges = (comp, options) => {
33281
33395
  debug('replaceXRanges', comp, options)
33282
- return comp.split(/\s+/).map((c) => {
33283
- return replaceXRange(c, options)
33284
- }).join(' ')
33396
+ return comp
33397
+ .split(/\s+/)
33398
+ .map((c) => replaceXRange(c, options))
33399
+ .join(' ')
33285
33400
  }
33286
33401
 
33287
33402
  const replaceXRange = (comp, options) => {
@@ -33364,12 +33479,15 @@ const replaceXRange = (comp, options) => {
33364
33479
  const replaceStars = (comp, options) => {
33365
33480
  debug('replaceStars', comp, options)
33366
33481
  // Looseness is ignored here. star is always as loose as it gets!
33367
- return comp.trim().replace(re[t.STAR], '')
33482
+ return comp
33483
+ .trim()
33484
+ .replace(re[t.STAR], '')
33368
33485
  }
33369
33486
 
33370
33487
  const replaceGTE0 = (comp, options) => {
33371
33488
  debug('replaceGTE0', comp, options)
33372
- return comp.trim()
33489
+ return comp
33490
+ .trim()
33373
33491
  .replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], '')
33374
33492
  }
33375
33493
 
@@ -33407,7 +33525,7 @@ const hyphenReplace = incPr => ($0,
33407
33525
  to = `<=${to}`
33408
33526
  }
33409
33527
 
33410
- return (`${from} ${to}`).trim()
33528
+ return `${from} ${to}`.trim()
33411
33529
  }
33412
33530
 
33413
33531
  const testSet = (set, version, options) => {
@@ -33449,15 +33567,15 @@ const testSet = (set, version, options) => {
33449
33567
 
33450
33568
  /***/ }),
33451
33569
 
33452
- /***/ 6971:
33570
+ /***/ 7234:
33453
33571
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
33454
33572
 
33455
- const debug = __webpack_require__(7202)
33456
- const { MAX_LENGTH, MAX_SAFE_INTEGER } = __webpack_require__(8241)
33457
- const { re, t } = __webpack_require__(1411)
33573
+ const debug = __webpack_require__(107)
33574
+ const { MAX_LENGTH, MAX_SAFE_INTEGER } = __webpack_require__(8925)
33575
+ const { safeRe: re, t } = __webpack_require__(2298)
33458
33576
 
33459
- const parseOptions = __webpack_require__(3858)
33460
- const { compareIdentifiers } = __webpack_require__(4974)
33577
+ const parseOptions = __webpack_require__(8166)
33578
+ const { compareIdentifiers } = __webpack_require__(1680)
33461
33579
  class SemVer {
33462
33580
  constructor (version, options) {
33463
33581
  options = parseOptions(options)
@@ -33470,7 +33588,7 @@ class SemVer {
33470
33588
  version = version.version
33471
33589
  }
33472
33590
  } else if (typeof version !== 'string') {
33473
- throw new TypeError(`Invalid Version: ${version}`)
33591
+ throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version}".`)
33474
33592
  }
33475
33593
 
33476
33594
  if (version.length > MAX_LENGTH) {
@@ -33629,36 +33747,36 @@ class SemVer {
33629
33747
 
33630
33748
  // preminor will bump the version up to the next minor release, and immediately
33631
33749
  // down to pre-release. premajor and prepatch work the same way.
33632
- inc (release, identifier) {
33750
+ inc (release, identifier, identifierBase) {
33633
33751
  switch (release) {
33634
33752
  case 'premajor':
33635
33753
  this.prerelease.length = 0
33636
33754
  this.patch = 0
33637
33755
  this.minor = 0
33638
33756
  this.major++
33639
- this.inc('pre', identifier)
33757
+ this.inc('pre', identifier, identifierBase)
33640
33758
  break
33641
33759
  case 'preminor':
33642
33760
  this.prerelease.length = 0
33643
33761
  this.patch = 0
33644
33762
  this.minor++
33645
- this.inc('pre', identifier)
33763
+ this.inc('pre', identifier, identifierBase)
33646
33764
  break
33647
33765
  case 'prepatch':
33648
33766
  // If this is already a prerelease, it will bump to the next version
33649
33767
  // drop any prereleases that might already exist, since they are not
33650
33768
  // relevant at this point.
33651
33769
  this.prerelease.length = 0
33652
- this.inc('patch', identifier)
33653
- this.inc('pre', identifier)
33770
+ this.inc('patch', identifier, identifierBase)
33771
+ this.inc('pre', identifier, identifierBase)
33654
33772
  break
33655
33773
  // If the input is a non-prerelease version, this acts the same as
33656
33774
  // prepatch.
33657
33775
  case 'prerelease':
33658
33776
  if (this.prerelease.length === 0) {
33659
- this.inc('patch', identifier)
33777
+ this.inc('patch', identifier, identifierBase)
33660
33778
  }
33661
- this.inc('pre', identifier)
33779
+ this.inc('pre', identifier, identifierBase)
33662
33780
  break
33663
33781
 
33664
33782
  case 'major':
@@ -33700,9 +33818,15 @@ class SemVer {
33700
33818
  break
33701
33819
  // This probably shouldn't be used publicly.
33702
33820
  // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction.
33703
- case 'pre':
33821
+ case 'pre': {
33822
+ const base = Number(identifierBase) ? 1 : 0
33823
+
33824
+ if (!identifier && identifierBase === false) {
33825
+ throw new Error('invalid increment argument: identifier is empty')
33826
+ }
33827
+
33704
33828
  if (this.prerelease.length === 0) {
33705
- this.prerelease = [0]
33829
+ this.prerelease = [base]
33706
33830
  } else {
33707
33831
  let i = this.prerelease.length
33708
33832
  while (--i >= 0) {
@@ -33713,27 +33837,36 @@ class SemVer {
33713
33837
  }
33714
33838
  if (i === -1) {
33715
33839
  // didn't increment anything
33716
- this.prerelease.push(0)
33840
+ if (identifier === this.prerelease.join('.') && identifierBase === false) {
33841
+ throw new Error('invalid increment argument: identifier already exists')
33842
+ }
33843
+ this.prerelease.push(base)
33717
33844
  }
33718
33845
  }
33719
33846
  if (identifier) {
33720
33847
  // 1.2.0-beta.1 bumps to 1.2.0-beta.2,
33721
33848
  // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0
33849
+ let prerelease = [identifier, base]
33850
+ if (identifierBase === false) {
33851
+ prerelease = [identifier]
33852
+ }
33722
33853
  if (compareIdentifiers(this.prerelease[0], identifier) === 0) {
33723
33854
  if (isNaN(this.prerelease[1])) {
33724
- this.prerelease = [identifier, 0]
33855
+ this.prerelease = prerelease
33725
33856
  }
33726
33857
  } else {
33727
- this.prerelease = [identifier, 0]
33858
+ this.prerelease = prerelease
33728
33859
  }
33729
33860
  }
33730
33861
  break
33731
-
33862
+ }
33732
33863
  default:
33733
33864
  throw new Error(`invalid increment argument: ${release}`)
33734
33865
  }
33735
- this.format()
33736
- this.raw = this.version
33866
+ this.raw = this.format()
33867
+ if (this.build.length) {
33868
+ this.raw += `+${this.build.join('.')}`
33869
+ }
33737
33870
  return this
33738
33871
  }
33739
33872
  }
@@ -33743,10 +33876,10 @@ module.exports = SemVer
33743
33876
 
33744
33877
  /***/ }),
33745
33878
 
33746
- /***/ 7322:
33879
+ /***/ 3996:
33747
33880
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
33748
33881
 
33749
- const parse = __webpack_require__(1133)
33882
+ const parse = __webpack_require__(8606)
33750
33883
  const clean = (version, options) => {
33751
33884
  const s = parse(version.trim().replace(/^[=v]+/, ''), options)
33752
33885
  return s ? s.version : null
@@ -33756,15 +33889,15 @@ module.exports = clean
33756
33889
 
33757
33890
  /***/ }),
33758
33891
 
33759
- /***/ 1606:
33892
+ /***/ 6696:
33760
33893
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
33761
33894
 
33762
- const eq = __webpack_require__(1801)
33763
- const neq = __webpack_require__(8432)
33764
- const gt = __webpack_require__(858)
33765
- const gte = __webpack_require__(3013)
33766
- const lt = __webpack_require__(6286)
33767
- const lte = __webpack_require__(1837)
33895
+ const eq = __webpack_require__(625)
33896
+ const neq = __webpack_require__(3325)
33897
+ const gt = __webpack_require__(3370)
33898
+ const gte = __webpack_require__(8622)
33899
+ const lt = __webpack_require__(6071)
33900
+ const lte = __webpack_require__(7696)
33768
33901
 
33769
33902
  const cmp = (a, op, b, loose) => {
33770
33903
  switch (op) {
@@ -33815,12 +33948,12 @@ module.exports = cmp
33815
33948
 
33816
33949
  /***/ }),
33817
33950
 
33818
- /***/ 9106:
33951
+ /***/ 2509:
33819
33952
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
33820
33953
 
33821
- const SemVer = __webpack_require__(6971)
33822
- const parse = __webpack_require__(1133)
33823
- const { re, t } = __webpack_require__(1411)
33954
+ const SemVer = __webpack_require__(7234)
33955
+ const parse = __webpack_require__(8606)
33956
+ const { safeRe: re, t } = __webpack_require__(2298)
33824
33957
 
33825
33958
  const coerce = (version, options) => {
33826
33959
  if (version instanceof SemVer) {
@@ -33874,10 +34007,10 @@ module.exports = coerce
33874
34007
 
33875
34008
  /***/ }),
33876
34009
 
33877
- /***/ 1921:
34010
+ /***/ 1058:
33878
34011
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
33879
34012
 
33880
- const SemVer = __webpack_require__(6971)
34013
+ const SemVer = __webpack_require__(7234)
33881
34014
  const compareBuild = (a, b, loose) => {
33882
34015
  const versionA = new SemVer(a, loose)
33883
34016
  const versionB = new SemVer(b, loose)
@@ -33888,20 +34021,20 @@ module.exports = compareBuild
33888
34021
 
33889
34022
  /***/ }),
33890
34023
 
33891
- /***/ 26:
34024
+ /***/ 4271:
33892
34025
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
33893
34026
 
33894
- const compare = __webpack_require__(2533)
34027
+ const compare = __webpack_require__(9603)
33895
34028
  const compareLoose = (a, b) => compare(a, b, true)
33896
34029
  module.exports = compareLoose
33897
34030
 
33898
34031
 
33899
34032
  /***/ }),
33900
34033
 
33901
- /***/ 2533:
34034
+ /***/ 9603:
33902
34035
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
33903
34036
 
33904
- const SemVer = __webpack_require__(6971)
34037
+ const SemVer = __webpack_require__(7234)
33905
34038
  const compare = (a, b, loose) =>
33906
34039
  new SemVer(a, loose).compare(new SemVer(b, loose))
33907
34040
 
@@ -33910,73 +34043,116 @@ module.exports = compare
33910
34043
 
33911
34044
  /***/ }),
33912
34045
 
33913
- /***/ 9793:
34046
+ /***/ 1937:
33914
34047
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
33915
34048
 
33916
- const parse = __webpack_require__(1133)
33917
- const eq = __webpack_require__(1801)
34049
+ const parse = __webpack_require__(8606)
33918
34050
 
33919
34051
  const diff = (version1, version2) => {
33920
- if (eq(version1, version2)) {
34052
+ const v1 = parse(version1, null, true)
34053
+ const v2 = parse(version2, null, true)
34054
+ const comparison = v1.compare(v2)
34055
+
34056
+ if (comparison === 0) {
33921
34057
  return null
33922
- } else {
33923
- const v1 = parse(version1)
33924
- const v2 = parse(version2)
33925
- const hasPre = v1.prerelease.length || v2.prerelease.length
33926
- const prefix = hasPre ? 'pre' : ''
33927
- const defaultResult = hasPre ? 'prerelease' : ''
33928
- for (const key in v1) {
33929
- if (key === 'major' || key === 'minor' || key === 'patch') {
33930
- if (v1[key] !== v2[key]) {
33931
- return prefix + key
33932
- }
33933
- }
34058
+ }
34059
+
34060
+ const v1Higher = comparison > 0
34061
+ const highVersion = v1Higher ? v1 : v2
34062
+ const lowVersion = v1Higher ? v2 : v1
34063
+ const highHasPre = !!highVersion.prerelease.length
34064
+ const lowHasPre = !!lowVersion.prerelease.length
34065
+
34066
+ if (lowHasPre && !highHasPre) {
34067
+ // Going from prerelease -> no prerelease requires some special casing
34068
+
34069
+ // If the low version has only a major, then it will always be a major
34070
+ // Some examples:
34071
+ // 1.0.0-1 -> 1.0.0
34072
+ // 1.0.0-1 -> 1.1.1
34073
+ // 1.0.0-1 -> 2.0.0
34074
+ if (!lowVersion.patch && !lowVersion.minor) {
34075
+ return 'major'
33934
34076
  }
33935
- return defaultResult // may be undefined
34077
+
34078
+ // Otherwise it can be determined by checking the high version
34079
+
34080
+ if (highVersion.patch) {
34081
+ // anything higher than a patch bump would result in the wrong version
34082
+ return 'patch'
34083
+ }
34084
+
34085
+ if (highVersion.minor) {
34086
+ // anything higher than a minor bump would result in the wrong version
34087
+ return 'minor'
34088
+ }
34089
+
34090
+ // bumping major/minor/patch all have same result
34091
+ return 'major'
33936
34092
  }
34093
+
34094
+ // add the `pre` prefix if we are going to a prerelease version
34095
+ const prefix = highHasPre ? 'pre' : ''
34096
+
34097
+ if (v1.major !== v2.major) {
34098
+ return prefix + 'major'
34099
+ }
34100
+
34101
+ if (v1.minor !== v2.minor) {
34102
+ return prefix + 'minor'
34103
+ }
34104
+
34105
+ if (v1.patch !== v2.patch) {
34106
+ return prefix + 'patch'
34107
+ }
34108
+
34109
+ // high and low are preleases
34110
+ return 'prerelease'
33937
34111
  }
34112
+
33938
34113
  module.exports = diff
33939
34114
 
33940
34115
 
33941
34116
  /***/ }),
33942
34117
 
33943
- /***/ 1801:
34118
+ /***/ 625:
33944
34119
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
33945
34120
 
33946
- const compare = __webpack_require__(2533)
34121
+ const compare = __webpack_require__(9603)
33947
34122
  const eq = (a, b, loose) => compare(a, b, loose) === 0
33948
34123
  module.exports = eq
33949
34124
 
33950
34125
 
33951
34126
  /***/ }),
33952
34127
 
33953
- /***/ 858:
34128
+ /***/ 3370:
33954
34129
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
33955
34130
 
33956
- const compare = __webpack_require__(2533)
34131
+ const compare = __webpack_require__(9603)
33957
34132
  const gt = (a, b, loose) => compare(a, b, loose) > 0
33958
34133
  module.exports = gt
33959
34134
 
33960
34135
 
33961
34136
  /***/ }),
33962
34137
 
33963
- /***/ 3013:
34138
+ /***/ 8622:
33964
34139
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
33965
34140
 
33966
- const compare = __webpack_require__(2533)
34141
+ const compare = __webpack_require__(9603)
33967
34142
  const gte = (a, b, loose) => compare(a, b, loose) >= 0
33968
34143
  module.exports = gte
33969
34144
 
33970
34145
 
33971
34146
  /***/ }),
33972
34147
 
33973
- /***/ 8851:
34148
+ /***/ 6096:
33974
34149
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
33975
34150
 
33976
- const SemVer = __webpack_require__(6971)
34151
+ const SemVer = __webpack_require__(7234)
33977
34152
 
33978
- const inc = (version, release, options, identifier) => {
34153
+ const inc = (version, release, options, identifier, identifierBase) => {
33979
34154
  if (typeof (options) === 'string') {
34155
+ identifierBase = identifier
33980
34156
  identifier = options
33981
34157
  options = undefined
33982
34158
  }
@@ -33985,7 +34161,7 @@ const inc = (version, release, options, identifier) => {
33985
34161
  return new SemVer(
33986
34162
  version instanceof SemVer ? version.version : version,
33987
34163
  options
33988
- ).inc(release, identifier).version
34164
+ ).inc(release, identifier, identifierBase).version
33989
34165
  } catch (er) {
33990
34166
  return null
33991
34167
  }
@@ -33995,88 +34171,71 @@ module.exports = inc
33995
34171
 
33996
34172
  /***/ }),
33997
34173
 
33998
- /***/ 6286:
34174
+ /***/ 6071:
33999
34175
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
34000
34176
 
34001
- const compare = __webpack_require__(2533)
34177
+ const compare = __webpack_require__(9603)
34002
34178
  const lt = (a, b, loose) => compare(a, b, loose) < 0
34003
34179
  module.exports = lt
34004
34180
 
34005
34181
 
34006
34182
  /***/ }),
34007
34183
 
34008
- /***/ 1837:
34184
+ /***/ 7696:
34009
34185
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
34010
34186
 
34011
- const compare = __webpack_require__(2533)
34187
+ const compare = __webpack_require__(9603)
34012
34188
  const lte = (a, b, loose) => compare(a, b, loose) <= 0
34013
34189
  module.exports = lte
34014
34190
 
34015
34191
 
34016
34192
  /***/ }),
34017
34193
 
34018
- /***/ 1985:
34194
+ /***/ 9227:
34019
34195
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
34020
34196
 
34021
- const SemVer = __webpack_require__(6971)
34197
+ const SemVer = __webpack_require__(7234)
34022
34198
  const major = (a, loose) => new SemVer(a, loose).major
34023
34199
  module.exports = major
34024
34200
 
34025
34201
 
34026
34202
  /***/ }),
34027
34203
 
34028
- /***/ 5153:
34204
+ /***/ 706:
34029
34205
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
34030
34206
 
34031
- const SemVer = __webpack_require__(6971)
34207
+ const SemVer = __webpack_require__(7234)
34032
34208
  const minor = (a, loose) => new SemVer(a, loose).minor
34033
34209
  module.exports = minor
34034
34210
 
34035
34211
 
34036
34212
  /***/ }),
34037
34213
 
34038
- /***/ 8432:
34214
+ /***/ 3325:
34039
34215
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
34040
34216
 
34041
- const compare = __webpack_require__(2533)
34217
+ const compare = __webpack_require__(9603)
34042
34218
  const neq = (a, b, loose) => compare(a, b, loose) !== 0
34043
34219
  module.exports = neq
34044
34220
 
34045
34221
 
34046
34222
  /***/ }),
34047
34223
 
34048
- /***/ 1133:
34224
+ /***/ 8606:
34049
34225
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
34050
34226
 
34051
- const { MAX_LENGTH } = __webpack_require__(8241)
34052
- const { re, t } = __webpack_require__(1411)
34053
- const SemVer = __webpack_require__(6971)
34054
-
34055
- const parseOptions = __webpack_require__(3858)
34056
- const parse = (version, options) => {
34057
- options = parseOptions(options)
34058
-
34227
+ const SemVer = __webpack_require__(7234)
34228
+ const parse = (version, options, throwErrors = false) => {
34059
34229
  if (version instanceof SemVer) {
34060
34230
  return version
34061
34231
  }
34062
-
34063
- if (typeof version !== 'string') {
34064
- return null
34065
- }
34066
-
34067
- if (version.length > MAX_LENGTH) {
34068
- return null
34069
- }
34070
-
34071
- const r = options.loose ? re[t.LOOSE] : re[t.FULL]
34072
- if (!r.test(version)) {
34073
- return null
34074
- }
34075
-
34076
34232
  try {
34077
34233
  return new SemVer(version, options)
34078
34234
  } catch (er) {
34079
- return null
34235
+ if (!throwErrors) {
34236
+ return null
34237
+ }
34238
+ throw er
34080
34239
  }
34081
34240
  }
34082
34241
 
@@ -34085,20 +34244,20 @@ module.exports = parse
34085
34244
 
34086
34245
  /***/ }),
34087
34246
 
34088
- /***/ 4990:
34247
+ /***/ 9770:
34089
34248
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
34090
34249
 
34091
- const SemVer = __webpack_require__(6971)
34250
+ const SemVer = __webpack_require__(7234)
34092
34251
  const patch = (a, loose) => new SemVer(a, loose).patch
34093
34252
  module.exports = patch
34094
34253
 
34095
34254
 
34096
34255
  /***/ }),
34097
34256
 
34098
- /***/ 9995:
34257
+ /***/ 9166:
34099
34258
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
34100
34259
 
34101
- const parse = __webpack_require__(1133)
34260
+ const parse = __webpack_require__(8606)
34102
34261
  const prerelease = (version, options) => {
34103
34262
  const parsed = parse(version, options)
34104
34263
  return (parsed && parsed.prerelease.length) ? parsed.prerelease : null
@@ -34108,30 +34267,30 @@ module.exports = prerelease
34108
34267
 
34109
34268
  /***/ }),
34110
34269
 
34111
- /***/ 3355:
34270
+ /***/ 9773:
34112
34271
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
34113
34272
 
34114
- const compare = __webpack_require__(2533)
34273
+ const compare = __webpack_require__(9603)
34115
34274
  const rcompare = (a, b, loose) => compare(b, a, loose)
34116
34275
  module.exports = rcompare
34117
34276
 
34118
34277
 
34119
34278
  /***/ }),
34120
34279
 
34121
- /***/ 7402:
34280
+ /***/ 158:
34122
34281
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
34123
34282
 
34124
- const compareBuild = __webpack_require__(1921)
34283
+ const compareBuild = __webpack_require__(1058)
34125
34284
  const rsort = (list, loose) => list.sort((a, b) => compareBuild(b, a, loose))
34126
34285
  module.exports = rsort
34127
34286
 
34128
34287
 
34129
34288
  /***/ }),
34130
34289
 
34131
- /***/ 319:
34290
+ /***/ 3513:
34132
34291
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
34133
34292
 
34134
- const Range = __webpack_require__(5872)
34293
+ const Range = __webpack_require__(2486)
34135
34294
  const satisfies = (version, range, options) => {
34136
34295
  try {
34137
34296
  range = new Range(range, options)
@@ -34145,20 +34304,20 @@ module.exports = satisfies
34145
34304
 
34146
34305
  /***/ }),
34147
34306
 
34148
- /***/ 5627:
34307
+ /***/ 5247:
34149
34308
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
34150
34309
 
34151
- const compareBuild = __webpack_require__(1921)
34310
+ const compareBuild = __webpack_require__(1058)
34152
34311
  const sort = (list, loose) => list.sort((a, b) => compareBuild(a, b, loose))
34153
34312
  module.exports = sort
34154
34313
 
34155
34314
 
34156
34315
  /***/ }),
34157
34316
 
34158
- /***/ 8731:
34317
+ /***/ 1294:
34159
34318
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
34160
34319
 
34161
- const parse = __webpack_require__(1133)
34320
+ const parse = __webpack_require__(8606)
34162
34321
  const valid = (version, options) => {
34163
34322
  const v = parse(version, options)
34164
34323
  return v ? v.version : null
@@ -34168,51 +34327,51 @@ module.exports = valid
34168
34327
 
34169
34328
  /***/ }),
34170
34329
 
34171
- /***/ 7013:
34330
+ /***/ 6377:
34172
34331
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
34173
34332
 
34174
34333
  // just pre-load all the stuff that index.js lazily exports
34175
- const internalRe = __webpack_require__(1411)
34176
- const constants = __webpack_require__(8241)
34177
- const SemVer = __webpack_require__(6971)
34178
- const identifiers = __webpack_require__(4974)
34179
- const parse = __webpack_require__(1133)
34180
- const valid = __webpack_require__(8731)
34181
- const clean = __webpack_require__(7322)
34182
- const inc = __webpack_require__(8851)
34183
- const diff = __webpack_require__(9793)
34184
- const major = __webpack_require__(1985)
34185
- const minor = __webpack_require__(5153)
34186
- const patch = __webpack_require__(4990)
34187
- const prerelease = __webpack_require__(9995)
34188
- const compare = __webpack_require__(2533)
34189
- const rcompare = __webpack_require__(3355)
34190
- const compareLoose = __webpack_require__(26)
34191
- const compareBuild = __webpack_require__(1921)
34192
- const sort = __webpack_require__(5627)
34193
- const rsort = __webpack_require__(7402)
34194
- const gt = __webpack_require__(858)
34195
- const lt = __webpack_require__(6286)
34196
- const eq = __webpack_require__(1801)
34197
- const neq = __webpack_require__(8432)
34198
- const gte = __webpack_require__(3013)
34199
- const lte = __webpack_require__(1837)
34200
- const cmp = __webpack_require__(1606)
34201
- const coerce = __webpack_require__(9106)
34202
- const Comparator = __webpack_require__(2816)
34203
- const Range = __webpack_require__(5872)
34204
- const satisfies = __webpack_require__(319)
34205
- const toComparators = __webpack_require__(2025)
34206
- const maxSatisfying = __webpack_require__(469)
34207
- const minSatisfying = __webpack_require__(4101)
34208
- const minVersion = __webpack_require__(4452)
34209
- const validRange = __webpack_require__(6747)
34210
- const outside = __webpack_require__(9054)
34211
- const gtr = __webpack_require__(4369)
34212
- const ltr = __webpack_require__(5595)
34213
- const intersects = __webpack_require__(6330)
34214
- const simplifyRange = __webpack_require__(6849)
34215
- const subset = __webpack_require__(5640)
34334
+ const internalRe = __webpack_require__(2298)
34335
+ const constants = __webpack_require__(8925)
34336
+ const SemVer = __webpack_require__(7234)
34337
+ const identifiers = __webpack_require__(1680)
34338
+ const parse = __webpack_require__(8606)
34339
+ const valid = __webpack_require__(1294)
34340
+ const clean = __webpack_require__(3996)
34341
+ const inc = __webpack_require__(6096)
34342
+ const diff = __webpack_require__(1937)
34343
+ const major = __webpack_require__(9227)
34344
+ const minor = __webpack_require__(706)
34345
+ const patch = __webpack_require__(9770)
34346
+ const prerelease = __webpack_require__(9166)
34347
+ const compare = __webpack_require__(9603)
34348
+ const rcompare = __webpack_require__(9773)
34349
+ const compareLoose = __webpack_require__(4271)
34350
+ const compareBuild = __webpack_require__(1058)
34351
+ const sort = __webpack_require__(5247)
34352
+ const rsort = __webpack_require__(158)
34353
+ const gt = __webpack_require__(3370)
34354
+ const lt = __webpack_require__(6071)
34355
+ const eq = __webpack_require__(625)
34356
+ const neq = __webpack_require__(3325)
34357
+ const gte = __webpack_require__(8622)
34358
+ const lte = __webpack_require__(7696)
34359
+ const cmp = __webpack_require__(6696)
34360
+ const coerce = __webpack_require__(2509)
34361
+ const Comparator = __webpack_require__(9449)
34362
+ const Range = __webpack_require__(2486)
34363
+ const satisfies = __webpack_require__(3513)
34364
+ const toComparators = __webpack_require__(1046)
34365
+ const maxSatisfying = __webpack_require__(2649)
34366
+ const minSatisfying = __webpack_require__(40)
34367
+ const minVersion = __webpack_require__(6077)
34368
+ const validRange = __webpack_require__(8218)
34369
+ const outside = __webpack_require__(4005)
34370
+ const gtr = __webpack_require__(6565)
34371
+ const ltr = __webpack_require__(38)
34372
+ const intersects = __webpack_require__(3024)
34373
+ const simplifyRange = __webpack_require__(9115)
34374
+ const subset = __webpack_require__(2544)
34216
34375
  module.exports = {
34217
34376
  parse,
34218
34377
  valid,
@@ -34256,6 +34415,7 @@ module.exports = {
34256
34415
  src: internalRe.src,
34257
34416
  tokens: internalRe.t,
34258
34417
  SEMVER_SPEC_VERSION: constants.SEMVER_SPEC_VERSION,
34418
+ RELEASE_TYPES: constants.RELEASE_TYPES,
34259
34419
  compareIdentifiers: identifiers.compareIdentifiers,
34260
34420
  rcompareIdentifiers: identifiers.rcompareIdentifiers,
34261
34421
  }
@@ -34263,7 +34423,7 @@ module.exports = {
34263
34423
 
34264
34424
  /***/ }),
34265
34425
 
34266
- /***/ 8241:
34426
+ /***/ 8925:
34267
34427
  /***/ ((module) => {
34268
34428
 
34269
34429
  // Note: this is the semver.org version of the spec that it implements
@@ -34277,17 +34437,30 @@ const MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||
34277
34437
  // Max safe segment length for coercion.
34278
34438
  const MAX_SAFE_COMPONENT_LENGTH = 16
34279
34439
 
34440
+ const RELEASE_TYPES = [
34441
+ 'major',
34442
+ 'premajor',
34443
+ 'minor',
34444
+ 'preminor',
34445
+ 'patch',
34446
+ 'prepatch',
34447
+ 'prerelease',
34448
+ ]
34449
+
34280
34450
  module.exports = {
34281
- SEMVER_SPEC_VERSION,
34282
34451
  MAX_LENGTH,
34283
- MAX_SAFE_INTEGER,
34284
34452
  MAX_SAFE_COMPONENT_LENGTH,
34453
+ MAX_SAFE_INTEGER,
34454
+ RELEASE_TYPES,
34455
+ SEMVER_SPEC_VERSION,
34456
+ FLAG_INCLUDE_PRERELEASE: 0b001,
34457
+ FLAG_LOOSE: 0b010,
34285
34458
  }
34286
34459
 
34287
34460
 
34288
34461
  /***/ }),
34289
34462
 
34290
- /***/ 7202:
34463
+ /***/ 107:
34291
34464
  /***/ ((module) => {
34292
34465
 
34293
34466
  const debug = (
@@ -34303,7 +34476,7 @@ module.exports = debug
34303
34476
 
34304
34477
  /***/ }),
34305
34478
 
34306
- /***/ 4974:
34479
+ /***/ 1680:
34307
34480
  /***/ ((module) => {
34308
34481
 
34309
34482
  const numeric = /^[0-9]+$/
@@ -34333,43 +34506,58 @@ module.exports = {
34333
34506
 
34334
34507
  /***/ }),
34335
34508
 
34336
- /***/ 3858:
34509
+ /***/ 8166:
34337
34510
  /***/ ((module) => {
34338
34511
 
34339
- // parse out just the options we care about so we always get a consistent
34340
- // obj with keys in a consistent order.
34341
- const opts = ['includePrerelease', 'loose', 'rtl']
34342
- const parseOptions = options =>
34343
- !options ? {}
34344
- : typeof options !== 'object' ? { loose: true }
34345
- : opts.filter(k => options[k]).reduce((o, k) => {
34346
- o[k] = true
34347
- return o
34348
- }, {})
34512
+ // parse out just the options we care about
34513
+ const looseOption = Object.freeze({ loose: true })
34514
+ const emptyOpts = Object.freeze({ })
34515
+ const parseOptions = options => {
34516
+ if (!options) {
34517
+ return emptyOpts
34518
+ }
34519
+
34520
+ if (typeof options !== 'object') {
34521
+ return looseOption
34522
+ }
34523
+
34524
+ return options
34525
+ }
34349
34526
  module.exports = parseOptions
34350
34527
 
34351
34528
 
34352
34529
  /***/ }),
34353
34530
 
34354
- /***/ 1411:
34531
+ /***/ 2298:
34355
34532
  /***/ ((module, exports, __webpack_require__) => {
34356
34533
 
34357
- const { MAX_SAFE_COMPONENT_LENGTH } = __webpack_require__(8241)
34358
- const debug = __webpack_require__(7202)
34534
+ const { MAX_SAFE_COMPONENT_LENGTH } = __webpack_require__(8925)
34535
+ const debug = __webpack_require__(107)
34359
34536
  exports = module.exports = {}
34360
34537
 
34361
34538
  // The actual regexps go on exports.re
34362
34539
  const re = exports.re = []
34540
+ const safeRe = exports.safeRe = []
34363
34541
  const src = exports.src = []
34364
34542
  const t = exports.t = {}
34365
34543
  let R = 0
34366
34544
 
34367
34545
  const createToken = (name, value, isGlobal) => {
34546
+ // Replace all greedy whitespace to prevent regex dos issues. These regex are
34547
+ // used internally via the safeRe object since all inputs in this library get
34548
+ // normalized first to trim and collapse all extra whitespace. The original
34549
+ // regexes are exported for userland consumption and lower level usage. A
34550
+ // future breaking change could export the safer regex only with a note that
34551
+ // all input should have extra whitespace removed.
34552
+ const safe = value
34553
+ .split('\\s*').join('\\s{0,1}')
34554
+ .split('\\s+').join('\\s')
34368
34555
  const index = R++
34369
34556
  debug(name, index, value)
34370
34557
  t[name] = index
34371
34558
  src[index] = value
34372
34559
  re[index] = new RegExp(value, isGlobal ? 'g' : undefined)
34560
+ safeRe[index] = new RegExp(safe, isGlobal ? 'g' : undefined)
34373
34561
  }
34374
34562
 
34375
34563
  // The following Regular Expressions can be used for tokenizing,
@@ -34540,35 +34728,35 @@ createToken('GTE0PRE', '^\\s*>=\\s*0\\.0\\.0-0\\s*$')
34540
34728
 
34541
34729
  /***/ }),
34542
34730
 
34543
- /***/ 4369:
34731
+ /***/ 6565:
34544
34732
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
34545
34733
 
34546
34734
  // Determine if version is greater than all the versions possible in the range.
34547
- const outside = __webpack_require__(9054)
34735
+ const outside = __webpack_require__(4005)
34548
34736
  const gtr = (version, range, options) => outside(version, range, '>', options)
34549
34737
  module.exports = gtr
34550
34738
 
34551
34739
 
34552
34740
  /***/ }),
34553
34741
 
34554
- /***/ 6330:
34742
+ /***/ 3024:
34555
34743
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
34556
34744
 
34557
- const Range = __webpack_require__(5872)
34745
+ const Range = __webpack_require__(2486)
34558
34746
  const intersects = (r1, r2, options) => {
34559
34747
  r1 = new Range(r1, options)
34560
34748
  r2 = new Range(r2, options)
34561
- return r1.intersects(r2)
34749
+ return r1.intersects(r2, options)
34562
34750
  }
34563
34751
  module.exports = intersects
34564
34752
 
34565
34753
 
34566
34754
  /***/ }),
34567
34755
 
34568
- /***/ 5595:
34756
+ /***/ 38:
34569
34757
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
34570
34758
 
34571
- const outside = __webpack_require__(9054)
34759
+ const outside = __webpack_require__(4005)
34572
34760
  // Determine if version is less than all the versions possible in the range
34573
34761
  const ltr = (version, range, options) => outside(version, range, '<', options)
34574
34762
  module.exports = ltr
@@ -34576,11 +34764,11 @@ module.exports = ltr
34576
34764
 
34577
34765
  /***/ }),
34578
34766
 
34579
- /***/ 469:
34767
+ /***/ 2649:
34580
34768
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
34581
34769
 
34582
- const SemVer = __webpack_require__(6971)
34583
- const Range = __webpack_require__(5872)
34770
+ const SemVer = __webpack_require__(7234)
34771
+ const Range = __webpack_require__(2486)
34584
34772
 
34585
34773
  const maxSatisfying = (versions, range, options) => {
34586
34774
  let max = null
@@ -34608,11 +34796,11 @@ module.exports = maxSatisfying
34608
34796
 
34609
34797
  /***/ }),
34610
34798
 
34611
- /***/ 4101:
34799
+ /***/ 40:
34612
34800
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
34613
34801
 
34614
- const SemVer = __webpack_require__(6971)
34615
- const Range = __webpack_require__(5872)
34802
+ const SemVer = __webpack_require__(7234)
34803
+ const Range = __webpack_require__(2486)
34616
34804
  const minSatisfying = (versions, range, options) => {
34617
34805
  let min = null
34618
34806
  let minSV = null
@@ -34639,12 +34827,12 @@ module.exports = minSatisfying
34639
34827
 
34640
34828
  /***/ }),
34641
34829
 
34642
- /***/ 4452:
34830
+ /***/ 6077:
34643
34831
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
34644
34832
 
34645
- const SemVer = __webpack_require__(6971)
34646
- const Range = __webpack_require__(5872)
34647
- const gt = __webpack_require__(858)
34833
+ const SemVer = __webpack_require__(7234)
34834
+ const Range = __webpack_require__(2486)
34835
+ const gt = __webpack_require__(3370)
34648
34836
 
34649
34837
  const minVersion = (range, loose) => {
34650
34838
  range = new Range(range, loose)
@@ -34707,18 +34895,18 @@ module.exports = minVersion
34707
34895
 
34708
34896
  /***/ }),
34709
34897
 
34710
- /***/ 9054:
34898
+ /***/ 4005:
34711
34899
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
34712
34900
 
34713
- const SemVer = __webpack_require__(6971)
34714
- const Comparator = __webpack_require__(2816)
34901
+ const SemVer = __webpack_require__(7234)
34902
+ const Comparator = __webpack_require__(9449)
34715
34903
  const { ANY } = Comparator
34716
- const Range = __webpack_require__(5872)
34717
- const satisfies = __webpack_require__(319)
34718
- const gt = __webpack_require__(858)
34719
- const lt = __webpack_require__(6286)
34720
- const lte = __webpack_require__(1837)
34721
- const gte = __webpack_require__(3013)
34904
+ const Range = __webpack_require__(2486)
34905
+ const satisfies = __webpack_require__(3513)
34906
+ const gt = __webpack_require__(3370)
34907
+ const lt = __webpack_require__(6071)
34908
+ const lte = __webpack_require__(7696)
34909
+ const gte = __webpack_require__(8622)
34722
34910
 
34723
34911
  const outside = (version, range, hilo, options) => {
34724
34912
  version = new SemVer(version, options)
@@ -34794,14 +34982,14 @@ module.exports = outside
34794
34982
 
34795
34983
  /***/ }),
34796
34984
 
34797
- /***/ 6849:
34985
+ /***/ 9115:
34798
34986
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
34799
34987
 
34800
34988
  // given a set of versions and a range, create a "simplified" range
34801
34989
  // that includes the same versions that the original range does
34802
34990
  // If the original range is shorter than the simplified one, return that.
34803
- const satisfies = __webpack_require__(319)
34804
- const compare = __webpack_require__(2533)
34991
+ const satisfies = __webpack_require__(3513)
34992
+ const compare = __webpack_require__(9603)
34805
34993
  module.exports = (versions, range, options) => {
34806
34994
  const set = []
34807
34995
  let first = null
@@ -34848,14 +35036,14 @@ module.exports = (versions, range, options) => {
34848
35036
 
34849
35037
  /***/ }),
34850
35038
 
34851
- /***/ 5640:
35039
+ /***/ 2544:
34852
35040
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
34853
35041
 
34854
- const Range = __webpack_require__(5872)
34855
- const Comparator = __webpack_require__(2816)
35042
+ const Range = __webpack_require__(2486)
35043
+ const Comparator = __webpack_require__(9449)
34856
35044
  const { ANY } = Comparator
34857
- const satisfies = __webpack_require__(319)
34858
- const compare = __webpack_require__(2533)
35045
+ const satisfies = __webpack_require__(3513)
35046
+ const compare = __webpack_require__(9603)
34859
35047
 
34860
35048
  // Complex range `r1 || r2 || ...` is a subset of `R1 || R2 || ...` iff:
34861
35049
  // - Every simple range `r1, r2, ...` is a null set, OR
@@ -34921,6 +35109,9 @@ const subset = (sub, dom, options = {}) => {
34921
35109
  return true
34922
35110
  }
34923
35111
 
35112
+ const minimumVersionWithPreRelease = [new Comparator('>=0.0.0-0')]
35113
+ const minimumVersion = [new Comparator('>=0.0.0')]
35114
+
34924
35115
  const simpleSubset = (sub, dom, options) => {
34925
35116
  if (sub === dom) {
34926
35117
  return true
@@ -34930,9 +35121,9 @@ const simpleSubset = (sub, dom, options) => {
34930
35121
  if (dom.length === 1 && dom[0].semver === ANY) {
34931
35122
  return true
34932
35123
  } else if (options.includePrerelease) {
34933
- sub = [new Comparator('>=0.0.0-0')]
35124
+ sub = minimumVersionWithPreRelease
34934
35125
  } else {
34935
- sub = [new Comparator('>=0.0.0')]
35126
+ sub = minimumVersion
34936
35127
  }
34937
35128
  }
34938
35129
 
@@ -34940,7 +35131,7 @@ const simpleSubset = (sub, dom, options) => {
34940
35131
  if (options.includePrerelease) {
34941
35132
  return true
34942
35133
  } else {
34943
- dom = [new Comparator('>=0.0.0')]
35134
+ dom = minimumVersion
34944
35135
  }
34945
35136
  }
34946
35137
 
@@ -35099,10 +35290,10 @@ module.exports = subset
35099
35290
 
35100
35291
  /***/ }),
35101
35292
 
35102
- /***/ 2025:
35293
+ /***/ 1046:
35103
35294
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
35104
35295
 
35105
- const Range = __webpack_require__(5872)
35296
+ const Range = __webpack_require__(2486)
35106
35297
 
35107
35298
  // Mostly just for testing and legacy API reasons
35108
35299
  const toComparators = (range, options) =>
@@ -35114,10 +35305,10 @@ module.exports = toComparators
35114
35305
 
35115
35306
  /***/ }),
35116
35307
 
35117
- /***/ 6747:
35308
+ /***/ 8218:
35118
35309
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
35119
35310
 
35120
- const Range = __webpack_require__(5872)
35311
+ const Range = __webpack_require__(2486)
35121
35312
  const validRange = (range, options) => {
35122
35313
  try {
35123
35314
  // Return '*' instead of '' so that truthiness works.
@@ -40261,349 +40452,349 @@ module.exports = "var d=Object.defineProperty;var m=e=>d(e,\"__esModule\",{value
40261
40452
  /***/ }),
40262
40453
 
40263
40454
  /***/ 3097:
40264
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
40455
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
40265
40456
 
40266
40457
  "use strict";
40267
40458
 
40268
- Object.defineProperty(exports, "__esModule", ({ value: true }));
40269
- exports.collectHasSegments = exports.sourceToRegex = exports.convertTrailingSlash = exports.convertHeaders = exports.convertRewrites = exports.convertRedirects = exports.convertCleanUrls = exports.getCleanUrls = void 0;
40270
- /**
40271
- * This converts Superstatic configuration to vercel.json Routes
40272
- * See https://github.com/firebase/superstatic#configuration
40273
- */
40274
- const url_1 = __webpack_require__(8835);
40275
- const path_to_regexp_1 = __webpack_require__(4462);
40276
- const UN_NAMED_SEGMENT = '__UN_NAMED_SEGMENT__';
40459
+ var __defProp = Object.defineProperty;
40460
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
40461
+ var __getOwnPropNames = Object.getOwnPropertyNames;
40462
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
40463
+ var __export = (target, all) => {
40464
+ for (var name in all)
40465
+ __defProp(target, name, { get: all[name], enumerable: true });
40466
+ };
40467
+ var __copyProps = (to, from, except, desc) => {
40468
+ if (from && typeof from === "object" || typeof from === "function") {
40469
+ for (let key of __getOwnPropNames(from))
40470
+ if (!__hasOwnProp.call(to, key) && key !== except)
40471
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
40472
+ }
40473
+ return to;
40474
+ };
40475
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
40476
+ var superstatic_exports = {};
40477
+ __export(superstatic_exports, {
40478
+ collectHasSegments: () => collectHasSegments,
40479
+ convertCleanUrls: () => convertCleanUrls,
40480
+ convertHeaders: () => convertHeaders,
40481
+ convertRedirects: () => convertRedirects,
40482
+ convertRewrites: () => convertRewrites,
40483
+ convertTrailingSlash: () => convertTrailingSlash,
40484
+ getCleanUrls: () => getCleanUrls,
40485
+ sourceToRegex: () => sourceToRegex
40486
+ });
40487
+ module.exports = __toCommonJS(superstatic_exports);
40488
+ var import_url = __webpack_require__(8835);
40489
+ var import_path_to_regexp = __webpack_require__(4462);
40490
+ const UN_NAMED_SEGMENT = "__UN_NAMED_SEGMENT__";
40277
40491
  function getCleanUrls(filePaths) {
40278
- const htmlFiles = filePaths
40279
- .map(toRoute)
40280
- .filter(f => f.endsWith('.html'))
40281
- .map(f => ({
40282
- html: f,
40283
- clean: f.slice(0, -5),
40284
- }));
40285
- return htmlFiles;
40492
+ const htmlFiles = filePaths.map(toRoute).filter((f) => f.endsWith(".html")).map((f) => ({
40493
+ html: f,
40494
+ clean: f.slice(0, -5)
40495
+ }));
40496
+ return htmlFiles;
40286
40497
  }
40287
- exports.getCleanUrls = getCleanUrls;
40288
40498
  function convertCleanUrls(cleanUrls, trailingSlash, status = 308) {
40289
- const routes = [];
40290
- if (cleanUrls) {
40291
- const loc = trailingSlash ? '/$1/' : '/$1';
40292
- routes.push({
40293
- src: '^/(?:(.+)/)?index(?:\\.html)?/?$',
40294
- headers: { Location: loc },
40295
- status,
40296
- });
40297
- routes.push({
40298
- src: '^/(.*)\\.html/?$',
40299
- headers: { Location: loc },
40300
- status,
40301
- });
40302
- }
40303
- return routes;
40499
+ const routes = [];
40500
+ if (cleanUrls) {
40501
+ const loc = trailingSlash ? "/$1/" : "/$1";
40502
+ routes.push({
40503
+ src: "^/(?:(.+)/)?index(?:\\.html)?/?$",
40504
+ headers: { Location: loc },
40505
+ status
40506
+ });
40507
+ routes.push({
40508
+ src: "^/(.*)\\.html/?$",
40509
+ headers: { Location: loc },
40510
+ status
40511
+ });
40512
+ }
40513
+ return routes;
40304
40514
  }
40305
- exports.convertCleanUrls = convertCleanUrls;
40306
40515
  function convertRedirects(redirects, defaultStatus = 308) {
40307
- return redirects.map(r => {
40308
- const { src, segments } = sourceToRegex(r.source);
40309
- const hasSegments = collectHasSegments(r.has);
40310
- normalizeHasKeys(r.has);
40311
- normalizeHasKeys(r.missing);
40312
- try {
40313
- const loc = replaceSegments(segments, hasSegments, r.destination, true);
40314
- let status;
40315
- if (typeof r.permanent === 'boolean') {
40316
- status = r.permanent ? 308 : 307;
40317
- }
40318
- else if (r.statusCode) {
40319
- status = r.statusCode;
40320
- }
40321
- else {
40322
- status = defaultStatus;
40323
- }
40324
- const route = {
40325
- src,
40326
- headers: { Location: loc },
40327
- status,
40328
- };
40329
- if (r.has) {
40330
- route.has = r.has;
40331
- }
40332
- if (r.missing) {
40333
- route.missing = r.missing;
40334
- }
40335
- return route;
40336
- }
40337
- catch (e) {
40338
- throw new Error(`Failed to parse redirect: ${JSON.stringify(r)}`);
40339
- }
40340
- });
40516
+ return redirects.map((r) => {
40517
+ const { src, segments } = sourceToRegex(r.source);
40518
+ const hasSegments = collectHasSegments(r.has);
40519
+ normalizeHasKeys(r.has);
40520
+ normalizeHasKeys(r.missing);
40521
+ try {
40522
+ const loc = replaceSegments(segments, hasSegments, r.destination, true);
40523
+ let status;
40524
+ if (typeof r.permanent === "boolean") {
40525
+ status = r.permanent ? 308 : 307;
40526
+ } else if (r.statusCode) {
40527
+ status = r.statusCode;
40528
+ } else {
40529
+ status = defaultStatus;
40530
+ }
40531
+ const route = {
40532
+ src,
40533
+ headers: { Location: loc },
40534
+ status
40535
+ };
40536
+ if (r.has) {
40537
+ route.has = r.has;
40538
+ }
40539
+ if (r.missing) {
40540
+ route.missing = r.missing;
40541
+ }
40542
+ return route;
40543
+ } catch (e) {
40544
+ throw new Error(`Failed to parse redirect: ${JSON.stringify(r)}`);
40545
+ }
40546
+ });
40341
40547
  }
40342
- exports.convertRedirects = convertRedirects;
40343
40548
  function convertRewrites(rewrites, internalParamNames) {
40344
- return rewrites.map(r => {
40345
- const { src, segments } = sourceToRegex(r.source);
40346
- const hasSegments = collectHasSegments(r.has);
40347
- normalizeHasKeys(r.has);
40348
- normalizeHasKeys(r.missing);
40349
- try {
40350
- const dest = replaceSegments(segments, hasSegments, r.destination, false, internalParamNames);
40351
- const route = { src, dest, check: true };
40352
- if (r.has) {
40353
- route.has = r.has;
40354
- }
40355
- if (r.missing) {
40356
- route.missing = r.missing;
40357
- }
40358
- return route;
40359
- }
40360
- catch (e) {
40361
- throw new Error(`Failed to parse rewrite: ${JSON.stringify(r)}`);
40362
- }
40363
- });
40549
+ return rewrites.map((r) => {
40550
+ const { src, segments } = sourceToRegex(r.source);
40551
+ const hasSegments = collectHasSegments(r.has);
40552
+ normalizeHasKeys(r.has);
40553
+ normalizeHasKeys(r.missing);
40554
+ try {
40555
+ const dest = replaceSegments(
40556
+ segments,
40557
+ hasSegments,
40558
+ r.destination,
40559
+ false,
40560
+ internalParamNames
40561
+ );
40562
+ const route = { src, dest, check: true };
40563
+ if (r.has) {
40564
+ route.has = r.has;
40565
+ }
40566
+ if (r.missing) {
40567
+ route.missing = r.missing;
40568
+ }
40569
+ return route;
40570
+ } catch (e) {
40571
+ throw new Error(`Failed to parse rewrite: ${JSON.stringify(r)}`);
40572
+ }
40573
+ });
40364
40574
  }
40365
- exports.convertRewrites = convertRewrites;
40366
40575
  function convertHeaders(headers) {
40367
- return headers.map(h => {
40368
- const obj = {};
40369
- const { src, segments } = sourceToRegex(h.source);
40370
- const hasSegments = collectHasSegments(h.has);
40371
- normalizeHasKeys(h.has);
40372
- normalizeHasKeys(h.missing);
40373
- const namedSegments = segments.filter(name => name !== UN_NAMED_SEGMENT);
40374
- const indexes = {};
40375
- segments.forEach((name, index) => {
40376
- indexes[name] = toSegmentDest(index);
40377
- });
40378
- hasSegments.forEach(name => {
40379
- indexes[name] = '$' + name;
40380
- });
40381
- h.headers.forEach(({ key, value }) => {
40382
- if (namedSegments.length > 0 || hasSegments.length > 0) {
40383
- if (key.includes(':')) {
40384
- key = safelyCompile(key, indexes);
40385
- }
40386
- if (value.includes(':')) {
40387
- value = safelyCompile(value, indexes);
40388
- }
40389
- }
40390
- obj[key] = value;
40391
- });
40392
- const route = {
40393
- src,
40394
- headers: obj,
40395
- continue: true,
40396
- };
40397
- if (h.has) {
40398
- route.has = h.has;
40576
+ return headers.map((h) => {
40577
+ const obj = {};
40578
+ const { src, segments } = sourceToRegex(h.source);
40579
+ const hasSegments = collectHasSegments(h.has);
40580
+ normalizeHasKeys(h.has);
40581
+ normalizeHasKeys(h.missing);
40582
+ const namedSegments = segments.filter((name) => name !== UN_NAMED_SEGMENT);
40583
+ const indexes = {};
40584
+ segments.forEach((name, index) => {
40585
+ indexes[name] = toSegmentDest(index);
40586
+ });
40587
+ hasSegments.forEach((name) => {
40588
+ indexes[name] = "$" + name;
40589
+ });
40590
+ h.headers.forEach(({ key, value }) => {
40591
+ if (namedSegments.length > 0 || hasSegments.length > 0) {
40592
+ if (key.includes(":")) {
40593
+ key = safelyCompile(key, indexes);
40399
40594
  }
40400
- if (h.missing) {
40401
- route.missing = h.missing;
40595
+ if (value.includes(":")) {
40596
+ value = safelyCompile(value, indexes);
40402
40597
  }
40403
- return route;
40598
+ }
40599
+ obj[key] = value;
40404
40600
  });
40405
- }
40406
- exports.convertHeaders = convertHeaders;
40407
- function convertTrailingSlash(enable, status = 308) {
40408
- const routes = [];
40409
- if (enable) {
40410
- routes.push({
40411
- src: '^/\\.well-known(?:/.*)?$',
40412
- });
40413
- routes.push({
40414
- src: '^/((?:[^/]+/)*[^/\\.]+)$',
40415
- headers: { Location: '/$1/' },
40416
- status,
40417
- });
40418
- routes.push({
40419
- src: '^/((?:[^/]+/)*[^/]+\\.\\w+)/$',
40420
- headers: { Location: '/$1' },
40421
- status,
40422
- });
40601
+ const route = {
40602
+ src,
40603
+ headers: obj,
40604
+ continue: true
40605
+ };
40606
+ if (h.has) {
40607
+ route.has = h.has;
40423
40608
  }
40424
- else {
40425
- routes.push({
40426
- src: '^/(.*)\\/$',
40427
- headers: { Location: '/$1' },
40428
- status,
40429
- });
40609
+ if (h.missing) {
40610
+ route.missing = h.missing;
40430
40611
  }
40431
- return routes;
40612
+ return route;
40613
+ });
40432
40614
  }
40433
- exports.convertTrailingSlash = convertTrailingSlash;
40434
- function sourceToRegex(source) {
40435
- const keys = [];
40436
- const r = (0, path_to_regexp_1.pathToRegexp)(source, keys, {
40437
- strict: true,
40438
- sensitive: true,
40439
- delimiter: '/',
40615
+ function convertTrailingSlash(enable, status = 308) {
40616
+ const routes = [];
40617
+ if (enable) {
40618
+ routes.push({
40619
+ src: "^/\\.well-known(?:/.*)?$"
40440
40620
  });
40441
- const segments = keys
40442
- .map(k => k.name)
40443
- .map(name => {
40444
- if (typeof name !== 'string') {
40445
- return UN_NAMED_SEGMENT;
40446
- }
40447
- return name;
40621
+ routes.push({
40622
+ src: "^/((?:[^/]+/)*[^/\\.]+)$",
40623
+ headers: { Location: "/$1/" },
40624
+ status
40625
+ });
40626
+ routes.push({
40627
+ src: "^/((?:[^/]+/)*[^/]+\\.\\w+)/$",
40628
+ headers: { Location: "/$1" },
40629
+ status
40630
+ });
40631
+ } else {
40632
+ routes.push({
40633
+ src: "^/(.*)\\/$",
40634
+ headers: { Location: "/$1" },
40635
+ status
40448
40636
  });
40449
- return { src: r.source, segments };
40637
+ }
40638
+ return routes;
40639
+ }
40640
+ function sourceToRegex(source) {
40641
+ const keys = [];
40642
+ const r = (0, import_path_to_regexp.pathToRegexp)(source, keys, {
40643
+ strict: true,
40644
+ sensitive: true,
40645
+ delimiter: "/"
40646
+ });
40647
+ const segments = keys.map((k) => k.name).map((name) => {
40648
+ if (typeof name !== "string") {
40649
+ return UN_NAMED_SEGMENT;
40650
+ }
40651
+ return name;
40652
+ });
40653
+ return { src: r.source, segments };
40450
40654
  }
40451
- exports.sourceToRegex = sourceToRegex;
40452
40655
  const namedGroupsRegex = /\(\?<([a-zA-Z][a-zA-Z0-9]*)>/g;
40453
40656
  const normalizeHasKeys = (hasItems = []) => {
40454
- for (const hasItem of hasItems) {
40455
- if ('key' in hasItem && hasItem.type === 'header') {
40456
- hasItem.key = hasItem.key.toLowerCase();
40457
- }
40657
+ for (const hasItem of hasItems) {
40658
+ if ("key" in hasItem && hasItem.type === "header") {
40659
+ hasItem.key = hasItem.key.toLowerCase();
40458
40660
  }
40459
- return hasItems;
40661
+ }
40662
+ return hasItems;
40460
40663
  };
40461
40664
  function collectHasSegments(has) {
40462
- const hasSegments = new Set();
40463
- for (const hasItem of has || []) {
40464
- if (!hasItem.value && 'key' in hasItem) {
40465
- hasSegments.add(hasItem.key);
40466
- }
40467
- if (hasItem.value) {
40468
- for (const match of hasItem.value.matchAll(namedGroupsRegex)) {
40469
- if (match[1]) {
40470
- hasSegments.add(match[1]);
40471
- }
40472
- }
40473
- if (hasItem.type === 'host') {
40474
- hasSegments.add('host');
40475
- }
40665
+ const hasSegments = /* @__PURE__ */ new Set();
40666
+ for (const hasItem of has || []) {
40667
+ if (!hasItem.value && "key" in hasItem) {
40668
+ hasSegments.add(hasItem.key);
40669
+ }
40670
+ if (hasItem.value) {
40671
+ for (const match of hasItem.value.matchAll(namedGroupsRegex)) {
40672
+ if (match[1]) {
40673
+ hasSegments.add(match[1]);
40476
40674
  }
40675
+ }
40676
+ if (hasItem.type === "host") {
40677
+ hasSegments.add("host");
40678
+ }
40477
40679
  }
40478
- return [...hasSegments];
40680
+ }
40681
+ return [...hasSegments];
40479
40682
  }
40480
- exports.collectHasSegments = collectHasSegments;
40481
- const escapeSegment = (str, segmentName) => str.replace(new RegExp(`:${segmentName}`, 'g'), `__ESC_COLON_${segmentName}`);
40482
- const unescapeSegments = (str) => str.replace(/__ESC_COLON_/gi, ':');
40683
+ const escapeSegment = (str, segmentName) => str.replace(new RegExp(`:${segmentName}`, "g"), `__ESC_COLON_${segmentName}`);
40684
+ const unescapeSegments = (str) => str.replace(/__ESC_COLON_/gi, ":");
40483
40685
  function replaceSegments(segments, hasItemSegments, destination, isRedirect, internalParamNames) {
40484
- const namedSegments = segments.filter(name => name !== UN_NAMED_SEGMENT);
40485
- const canNeedReplacing = (destination.includes(':') && namedSegments.length > 0) ||
40486
- hasItemSegments.length > 0 ||
40487
- !isRedirect;
40488
- if (!canNeedReplacing) {
40489
- return destination;
40490
- }
40491
- let escapedDestination = destination;
40492
- const indexes = {};
40493
- segments.forEach((name, index) => {
40494
- indexes[name] = toSegmentDest(index);
40495
- escapedDestination = escapeSegment(escapedDestination, name);
40496
- });
40497
- // 'has' matches override 'source' matches
40498
- hasItemSegments.forEach(name => {
40499
- indexes[name] = '$' + name;
40500
- escapedDestination = escapeSegment(escapedDestination, name);
40501
- });
40502
- const parsedDestination = (0, url_1.parse)(escapedDestination, true);
40503
- delete parsedDestination.href;
40504
- delete parsedDestination.path;
40505
- delete parsedDestination.search;
40506
- delete parsedDestination.host;
40507
- // eslint-disable-next-line prefer-const
40508
- let { pathname, hash, query, hostname, ...rest } = parsedDestination;
40509
- pathname = unescapeSegments(pathname || '');
40510
- hash = unescapeSegments(hash || '');
40511
- hostname = unescapeSegments(hostname || '');
40512
- let destParams = new Set();
40513
- const pathnameKeys = [];
40514
- const hashKeys = [];
40515
- const hostnameKeys = [];
40516
- try {
40517
- (0, path_to_regexp_1.pathToRegexp)(pathname, pathnameKeys);
40518
- (0, path_to_regexp_1.pathToRegexp)(hash || '', hashKeys);
40519
- (0, path_to_regexp_1.pathToRegexp)(hostname || '', hostnameKeys);
40520
- }
40521
- catch (_) {
40522
- // this is not fatal so don't error when failing to parse the
40523
- // params from the destination
40524
- }
40525
- destParams = new Set([...pathnameKeys, ...hashKeys, ...hostnameKeys]
40526
- .map(key => key.name)
40527
- .filter(val => typeof val === 'string'));
40528
- pathname = safelyCompile(pathname, indexes, true);
40529
- hash = hash ? safelyCompile(hash, indexes, true) : null;
40530
- hostname = hostname ? safelyCompile(hostname, indexes, true) : null;
40531
- for (const [key, strOrArray] of Object.entries(query)) {
40532
- if (Array.isArray(strOrArray)) {
40533
- query[key] = strOrArray.map(str => safelyCompile(unescapeSegments(str), indexes, true));
40534
- }
40535
- else {
40536
- // TODO: handle strOrArray is undefined
40537
- query[key] = safelyCompile(unescapeSegments(strOrArray), indexes, true);
40538
- }
40686
+ const namedSegments = segments.filter((name) => name !== UN_NAMED_SEGMENT);
40687
+ const canNeedReplacing = destination.includes(":") && namedSegments.length > 0 || hasItemSegments.length > 0 || !isRedirect;
40688
+ if (!canNeedReplacing) {
40689
+ return destination;
40690
+ }
40691
+ let escapedDestination = destination;
40692
+ const indexes = {};
40693
+ segments.forEach((name, index) => {
40694
+ indexes[name] = toSegmentDest(index);
40695
+ escapedDestination = escapeSegment(escapedDestination, name);
40696
+ });
40697
+ hasItemSegments.forEach((name) => {
40698
+ indexes[name] = "$" + name;
40699
+ escapedDestination = escapeSegment(escapedDestination, name);
40700
+ });
40701
+ const parsedDestination = (0, import_url.parse)(escapedDestination, true);
40702
+ delete parsedDestination.href;
40703
+ delete parsedDestination.path;
40704
+ delete parsedDestination.search;
40705
+ delete parsedDestination.host;
40706
+ let { pathname, hash, query, hostname, ...rest } = parsedDestination;
40707
+ pathname = unescapeSegments(pathname || "");
40708
+ hash = unescapeSegments(hash || "");
40709
+ hostname = unescapeSegments(hostname || "");
40710
+ let destParams = /* @__PURE__ */ new Set();
40711
+ const pathnameKeys = [];
40712
+ const hashKeys = [];
40713
+ const hostnameKeys = [];
40714
+ try {
40715
+ (0, import_path_to_regexp.pathToRegexp)(pathname, pathnameKeys);
40716
+ (0, import_path_to_regexp.pathToRegexp)(hash || "", hashKeys);
40717
+ (0, import_path_to_regexp.pathToRegexp)(hostname || "", hostnameKeys);
40718
+ } catch (_) {
40719
+ }
40720
+ destParams = new Set(
40721
+ [...pathnameKeys, ...hashKeys, ...hostnameKeys].map((key) => key.name).filter((val) => typeof val === "string")
40722
+ );
40723
+ pathname = safelyCompile(pathname, indexes, true);
40724
+ hash = hash ? safelyCompile(hash, indexes, true) : null;
40725
+ hostname = hostname ? safelyCompile(hostname, indexes, true) : null;
40726
+ for (const [key, strOrArray] of Object.entries(query)) {
40727
+ if (Array.isArray(strOrArray)) {
40728
+ query[key] = strOrArray.map(
40729
+ (str) => safelyCompile(unescapeSegments(str), indexes, true)
40730
+ );
40731
+ } else {
40732
+ query[key] = safelyCompile(
40733
+ unescapeSegments(strOrArray),
40734
+ indexes,
40735
+ true
40736
+ );
40539
40737
  }
40540
- // We only add path segments to redirect queries if manually
40541
- // specified and only automatically add them for rewrites if one
40542
- // or more params aren't already used in the destination's path
40543
- const paramKeys = Object.keys(indexes);
40544
- const needsQueryUpdating =
40738
+ }
40739
+ const paramKeys = Object.keys(indexes);
40740
+ const needsQueryUpdating = (
40545
40741
  // we do not consider an internal param since it is added automatically
40546
- !isRedirect &&
40547
- !paramKeys.some(param => !(internalParamNames && internalParamNames.includes(param)) &&
40548
- destParams.has(param));
40549
- if (needsQueryUpdating) {
40550
- for (const param of paramKeys) {
40551
- if (!(param in query) && param !== UN_NAMED_SEGMENT) {
40552
- query[param] = indexes[param];
40553
- }
40554
- }
40742
+ !isRedirect && !paramKeys.some(
40743
+ (param) => !(internalParamNames && internalParamNames.includes(param)) && destParams.has(param)
40744
+ )
40745
+ );
40746
+ if (needsQueryUpdating) {
40747
+ for (const param of paramKeys) {
40748
+ if (!(param in query) && param !== UN_NAMED_SEGMENT) {
40749
+ query[param] = indexes[param];
40750
+ }
40555
40751
  }
40556
- destination = (0, url_1.format)({
40557
- ...rest,
40558
- hostname,
40559
- pathname,
40560
- query,
40561
- hash,
40562
- });
40563
- // url.format() escapes the dollar sign but it must be preserved for now-proxy
40564
- return destination.replace(/%24/g, '$');
40752
+ }
40753
+ destination = (0, import_url.format)({
40754
+ ...rest,
40755
+ hostname,
40756
+ pathname,
40757
+ query,
40758
+ hash
40759
+ });
40760
+ return destination.replace(/%24/g, "$");
40565
40761
  }
40566
40762
  function safelyCompile(value, indexes, attemptDirectCompile) {
40567
- if (!value) {
40568
- return value;
40569
- }
40570
- if (attemptDirectCompile) {
40571
- try {
40572
- // Attempt compiling normally with path-to-regexp first and fall back
40573
- // to safely compiling to handle edge cases if path-to-regexp compile
40574
- // fails
40575
- return (0, path_to_regexp_1.compile)(value, { validate: false })(indexes);
40576
- }
40577
- catch (e) {
40578
- // non-fatal, we continue to safely compile
40579
- }
40763
+ if (!value) {
40764
+ return value;
40765
+ }
40766
+ if (attemptDirectCompile) {
40767
+ try {
40768
+ return (0, import_path_to_regexp.compile)(value, { validate: false })(indexes);
40769
+ } catch (e) {
40580
40770
  }
40581
- for (const key of Object.keys(indexes)) {
40582
- if (value.includes(`:${key}`)) {
40583
- value = value
40584
- .replace(new RegExp(`:${key}\\*`, 'g'), `:${key}--ESCAPED_PARAM_ASTERISK`)
40585
- .replace(new RegExp(`:${key}\\?`, 'g'), `:${key}--ESCAPED_PARAM_QUESTION`)
40586
- .replace(new RegExp(`:${key}\\+`, 'g'), `:${key}--ESCAPED_PARAM_PLUS`)
40587
- .replace(new RegExp(`:${key}(?!\\w)`, 'g'), `--ESCAPED_PARAM_COLON${key}`);
40588
- }
40771
+ }
40772
+ for (const key of Object.keys(indexes)) {
40773
+ if (value.includes(`:${key}`)) {
40774
+ value = value.replace(
40775
+ new RegExp(`:${key}\\*`, "g"),
40776
+ `:${key}--ESCAPED_PARAM_ASTERISK`
40777
+ ).replace(
40778
+ new RegExp(`:${key}\\?`, "g"),
40779
+ `:${key}--ESCAPED_PARAM_QUESTION`
40780
+ ).replace(new RegExp(`:${key}\\+`, "g"), `:${key}--ESCAPED_PARAM_PLUS`).replace(
40781
+ new RegExp(`:${key}(?!\\w)`, "g"),
40782
+ `--ESCAPED_PARAM_COLON${key}`
40783
+ );
40589
40784
  }
40590
- value = value
40591
- .replace(/(:|\*|\?|\+|\(|\)|\{|\})/g, '\\$1')
40592
- .replace(/--ESCAPED_PARAM_PLUS/g, '+')
40593
- .replace(/--ESCAPED_PARAM_COLON/g, ':')
40594
- .replace(/--ESCAPED_PARAM_QUESTION/g, '?')
40595
- .replace(/--ESCAPED_PARAM_ASTERISK/g, '*');
40596
- // the value needs to start with a forward-slash to be compiled
40597
- // correctly
40598
- return (0, path_to_regexp_1.compile)(`/${value}`, { validate: false })(indexes).slice(1);
40785
+ }
40786
+ value = value.replace(/(:|\*|\?|\+|\(|\)|\{|\})/g, "\\$1").replace(/--ESCAPED_PARAM_PLUS/g, "+").replace(/--ESCAPED_PARAM_COLON/g, ":").replace(/--ESCAPED_PARAM_QUESTION/g, "?").replace(/--ESCAPED_PARAM_ASTERISK/g, "*");
40787
+ return (0, import_path_to_regexp.compile)(`/${value}`, { validate: false })(indexes).slice(1);
40599
40788
  }
40600
40789
  function toSegmentDest(index) {
40601
- const i = index + 1; // js is base 0, regex is base 1
40602
- return '$' + i.toString();
40790
+ const i = index + 1;
40791
+ return "$" + i.toString();
40603
40792
  }
40604
40793
  function toRoute(filePath) {
40605
- return filePath.startsWith('/') ? filePath : '/' + filePath;
40794
+ return filePath.startsWith("/") ? filePath : "/" + filePath;
40606
40795
  }
40796
+ // Annotate the CommonJS export names for ESM import in node:
40797
+ 0 && (0);
40607
40798
 
40608
40799
 
40609
40800
  /***/ }),
@@ -40619,7 +40810,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
40619
40810
  Object.defineProperty(exports, "__esModule", ({ value: true }));
40620
40811
  const fs_extra_1 = __importDefault(__webpack_require__(2650));
40621
40812
  const path_1 = __importDefault(__webpack_require__(5622));
40622
- const semver_1 = __importDefault(__webpack_require__(1039));
40813
+ const semver_1 = __importDefault(__webpack_require__(7846));
40623
40814
  const utils_1 = __webpack_require__(6136);
40624
40815
  function getCustomData(importName, target) {
40625
40816
  return `
@@ -40829,7 +41020,7 @@ const find_up_1 = __importDefault(__webpack_require__(7130));
40829
41020
  const fs_extra_1 = __webpack_require__(2650);
40830
41021
  const path_1 = __importDefault(__webpack_require__(5622));
40831
41022
  const resolve_from_1 = __importDefault(__webpack_require__(7472));
40832
- const semver_1 = __importDefault(__webpack_require__(1039));
41023
+ const semver_1 = __importDefault(__webpack_require__(7846));
40833
41024
  const url_1 = __importDefault(__webpack_require__(8835));
40834
41025
  const create_serverless_config_1 = __importDefault(__webpack_require__(8333));
40835
41026
  const legacy_versions_1 = __importDefault(__webpack_require__(3537));
@@ -41710,7 +41901,7 @@ const build = async ({ files, workPath, repoRootPath, entrypoint, config = {}, m
41710
41901
  throw new Error(`A routes-manifest could not be located, please check your outputDirectory and try again.`);
41711
41902
  }
41712
41903
  const localePrefixed404 = !!(routesManifest.i18n &&
41713
- originalStaticPages[path_1.default.posix.join(entryDirectory, routesManifest.i18n.defaultLocale, '404.html')]);
41904
+ originalStaticPages[path_1.default.posix.join('.', routesManifest.i18n.defaultLocale, '404.html')]);
41714
41905
  return (0, server_build_1.serverBuild)({
41715
41906
  config,
41716
41907
  functionsConfigManifest,
@@ -42725,7 +42916,10 @@ async function getServerlessPages(params) {
42725
42916
  }
42726
42917
  // Edge Functions do not consider as Serverless Functions
42727
42918
  for (const edgeFunctionFile of Object.keys(middlewareManifest?.functions ?? {})) {
42728
- const edgePath = (edgeFunctionFile.slice(1) || 'index') + '.js';
42919
+ let edgePath = middlewareManifest?.functions?.[edgeFunctionFile].name ||
42920
+ edgeFunctionFile;
42921
+ edgePath = (0, utils_1.normalizeEdgeFunctionPath)(edgePath, params.appPathRoutesManifest || {});
42922
+ edgePath = (edgePath || 'index') + '.js';
42729
42923
  delete normalizedAppPaths[edgePath];
42730
42924
  delete pages[edgePath];
42731
42925
  }
@@ -43092,7 +43286,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
43092
43286
  Object.defineProperty(exports, "__esModule", ({ value: true }));
43093
43287
  exports.serverBuild = void 0;
43094
43288
  const path_1 = __importDefault(__webpack_require__(5622));
43095
- const semver_1 = __importDefault(__webpack_require__(1039));
43289
+ const semver_1 = __importDefault(__webpack_require__(7846));
43096
43290
  const async_sema_1 = __webpack_require__(7905);
43097
43291
  const build_utils_1 = __webpack_require__(3445);
43098
43292
  const _1 = __webpack_require__(9037);
@@ -43126,14 +43320,21 @@ async function serverBuild({ dynamicPages, pagesDir, config = {}, functionsConfi
43126
43320
  inversedAppPathManifest[appPathRoutesManifest[ogRoute]] = ogRoute;
43127
43321
  }
43128
43322
  }
43129
- const APP_PREFETCH_SUFFIX = '.prefetch.rsc';
43130
43323
  let appRscPrefetches = {};
43131
43324
  let appBuildTraces = {};
43132
43325
  let appDir = null;
43133
43326
  if (appPathRoutesManifest) {
43134
43327
  appDir = path_1.default.join(pagesDir, '../app');
43135
43328
  appBuildTraces = await (0, build_utils_1.glob)('**/*.js.nft.json', appDir);
43136
- appRscPrefetches = await (0, build_utils_1.glob)(`**/*${APP_PREFETCH_SUFFIX}`, appDir);
43329
+ appRscPrefetches = await (0, build_utils_1.glob)(`**/*${utils_1.RSC_PREFETCH_SUFFIX}`, appDir);
43330
+ const rscContentTypeHeader = routesManifest?.rsc?.contentTypeHeader || utils_1.RSC_CONTENT_TYPE;
43331
+ // ensure all appRscPrefetches have a contentType since this is used by Next.js
43332
+ // to determine if it's a valid response
43333
+ for (const value of Object.values(appRscPrefetches)) {
43334
+ if (!value.contentType) {
43335
+ value.contentType = rscContentTypeHeader;
43336
+ }
43337
+ }
43137
43338
  }
43138
43339
  const isCorrectNotFoundRoutes = semver_1.default.gte(nextVersion, CORRECT_NOT_FOUND_ROUTES_VERSION);
43139
43340
  const isCorrectMiddlewareOrder = semver_1.default.gte(nextVersion, CORRECT_MIDDLEWARE_ORDER_VERSION);
@@ -43293,10 +43494,17 @@ async function serverBuild({ dynamicPages, pagesDir, config = {}, functionsConfi
43293
43494
  // for notFound GS(S)P support
43294
43495
  if (i18n) {
43295
43496
  for (const locale of i18n.locales) {
43296
- const static404File = staticPages[path_1.default.posix.join(entryDirectory, locale, '/404')] ||
43297
- new build_utils_1.FileFsRef({
43497
+ let static404File = staticPages[path_1.default.posix.join(entryDirectory, locale, '/404')];
43498
+ if (!static404File) {
43499
+ static404File = new build_utils_1.FileFsRef({
43298
43500
  fsPath: path_1.default.join(pagesDir, locale, '/404.html'),
43299
43501
  });
43502
+ if (!fs_extra_1.default.existsSync(static404File.fsPath)) {
43503
+ static404File = new build_utils_1.FileFsRef({
43504
+ fsPath: path_1.default.join(pagesDir, '/404.html'),
43505
+ });
43506
+ }
43507
+ }
43300
43508
  requiredFiles[path_1.default.relative(baseDir, static404File.fsPath)] =
43301
43509
  static404File;
43302
43510
  }
@@ -43709,7 +43917,25 @@ async function serverBuild({ dynamicPages, pagesDir, config = {}, functionsConfi
43709
43917
  });
43710
43918
  const isNextDataServerResolving = middleware.staticRoutes.length > 0 &&
43711
43919
  semver_1.default.gte(nextVersion, NEXT_DATA_MIDDLEWARE_RESOLVING_VERSION);
43712
- const dynamicRoutes = await (0, utils_1.getDynamicRoutes)(entryPath, entryDirectory, dynamicPages, false, routesManifest, omittedPrerenderRoutes, canUsePreviewMode, prerenderManifest.bypassToken || '', true, middleware.dynamicRouteMap, inversedAppPathManifest).then(arr => (0, utils_1.localizeDynamicRoutes)(arr, dynamicPrefix, entryDirectory, staticPages, prerenderManifest, routesManifest, true, isCorrectLocaleAPIRoutes, inversedAppPathManifest));
43920
+ const dynamicRoutes = await (0, utils_1.getDynamicRoutes)(entryPath, entryDirectory, dynamicPages, false, routesManifest, omittedPrerenderRoutes, canUsePreviewMode, prerenderManifest.bypassToken || '', true, middleware.dynamicRouteMap).then(arr => (0, utils_1.localizeDynamicRoutes)(arr, dynamicPrefix, entryDirectory, staticPages, prerenderManifest, routesManifest, true, isCorrectLocaleAPIRoutes, inversedAppPathManifest));
43921
+ const pagesPlaceholderRscEntries = {};
43922
+ if (appDir) {
43923
+ // since we attempt to rewrite all paths to an .rsc variant,
43924
+ // we need to create dummy rsc outputs for all pages entries
43925
+ // this is so that an RSC request to a `pages` entry will match
43926
+ // rather than falling back to a catchall `app` entry
43927
+ // on the nextjs side, invalid RSC response payloads will correctly trigger an mpa navigation
43928
+ const pagesManifest = path_1.default.join(entryPath, outputDirectory, `server/pages-manifest.json`);
43929
+ const pagesData = await fs_extra_1.default.readJSON(pagesManifest);
43930
+ const pagesEntries = Object.keys(pagesData);
43931
+ for (const page of pagesEntries) {
43932
+ const pathName = page.startsWith('/') ? page.slice(1) : page;
43933
+ pagesPlaceholderRscEntries[`${pathName}.rsc`] = new build_utils_1.FileBlob({
43934
+ data: '{}',
43935
+ contentType: 'application/json',
43936
+ });
43937
+ }
43938
+ }
43713
43939
  const { staticFiles, publicDirectoryFiles, staticDirectoryFiles } = await (0, utils_1.getStaticFiles)(entryPath, entryDirectory, outputDirectory);
43714
43940
  const normalizeNextDataRoute = (isOverride = false) => {
43715
43941
  return isNextDataServerResolving
@@ -43795,7 +44021,7 @@ async function serverBuild({ dynamicPages, pagesDir, config = {}, functionsConfi
43795
44021
  if (ogRoute.endsWith('/route')) {
43796
44022
  continue;
43797
44023
  }
43798
- route = path_1.default.posix.join('./', entryDirectory, route === '/' ? '/index' : route);
44024
+ route = (0, utils_1.normalizeIndexOutput)(path_1.default.posix.join('./', entryDirectory, route === '/' ? '/index' : route), true);
43799
44025
  if (lambdas[route]) {
43800
44026
  lambdas[`${route}.rsc`] = lambdas[route];
43801
44027
  }
@@ -43816,6 +44042,7 @@ async function serverBuild({ dynamicPages, pagesDir, config = {}, functionsConfi
43816
44042
  ...publicDirectoryFiles,
43817
44043
  ...lambdas,
43818
44044
  ...appRscPrefetches,
44045
+ ...pagesPlaceholderRscEntries,
43819
44046
  // Prerenders may override Lambdas -- this is an intentional behavior.
43820
44047
  ...prerenders,
43821
44048
  ...staticPages,
@@ -44007,7 +44234,7 @@ async function serverBuild({ dynamicPages, pagesDir, config = {}, functionsConfi
44007
44234
  key: rscPrefetchHeader,
44008
44235
  },
44009
44236
  ],
44010
- dest: path_1.default.posix.join('/', entryDirectory, '/index.prefetch.rsc'),
44237
+ dest: path_1.default.posix.join('/', entryDirectory, `/index${utils_1.RSC_PREFETCH_SUFFIX}`),
44011
44238
  headers: { vary: rscVaryHeader },
44012
44239
  continue: true,
44013
44240
  override: true,
@@ -44020,7 +44247,7 @@ async function serverBuild({ dynamicPages, pagesDir, config = {}, functionsConfi
44020
44247
  key: rscPrefetchHeader,
44021
44248
  },
44022
44249
  ],
44023
- dest: path_1.default.posix.join('/', entryDirectory, `/$1${APP_PREFETCH_SUFFIX}`),
44250
+ dest: path_1.default.posix.join('/', entryDirectory, `/$1${utils_1.RSC_PREFETCH_SUFFIX}`),
44024
44251
  headers: { vary: rscVaryHeader },
44025
44252
  continue: true,
44026
44253
  override: true,
@@ -44085,7 +44312,7 @@ async function serverBuild({ dynamicPages, pagesDir, config = {}, functionsConfi
44085
44312
  ...(rscPrefetchHeader
44086
44313
  ? [
44087
44314
  {
44088
- src: path_1.default.posix.join('/', entryDirectory, `/index${APP_PREFETCH_SUFFIX}`),
44315
+ src: path_1.default.posix.join('/', entryDirectory, `/index${utils_1.RSC_PREFETCH_SUFFIX}`),
44089
44316
  dest: path_1.default.posix.join('/', entryDirectory, '/index.rsc'),
44090
44317
  has: [
44091
44318
  {
@@ -44097,7 +44324,7 @@ async function serverBuild({ dynamicPages, pagesDir, config = {}, functionsConfi
44097
44324
  override: true,
44098
44325
  },
44099
44326
  {
44100
- src: `^${path_1.default.posix.join('/', entryDirectory, `/(.+?)${APP_PREFETCH_SUFFIX}(?:/)?$`)}`,
44327
+ src: `^${path_1.default.posix.join('/', entryDirectory, `/(.+?)${utils_1.RSC_PREFETCH_SUFFIX}(?:/)?$`)}`,
44101
44328
  dest: path_1.default.posix.join('/', entryDirectory, '/$1.rsc'),
44102
44329
  has: [
44103
44330
  {
@@ -44110,62 +44337,17 @@ async function serverBuild({ dynamicPages, pagesDir, config = {}, functionsConfi
44110
44337
  },
44111
44338
  ]
44112
44339
  : []),
44113
- ...(appDir
44114
- ? [
44115
- // check routes that end in `.rsc` to see if a page with the resulting name (sans-.rsc) exists in the filesystem
44116
- // if so, we want to match that page instead. (This matters when prefetching a pages route while on an appdir route)
44117
- {
44118
- src: `^${path_1.default.posix.join('/', entryDirectory, '/(.*)\\.rsc$')}`,
44119
- dest: path_1.default.posix.join('/', entryDirectory, '/$1'),
44120
- has: [
44121
- {
44122
- type: 'header',
44123
- key: rscHeader,
44124
- },
44125
- ],
44126
- ...(rscPrefetchHeader
44127
- ? {
44128
- missing: [
44129
- {
44130
- type: 'header',
44131
- key: rscPrefetchHeader,
44132
- },
44133
- ],
44134
- }
44135
- : {}),
44136
- check: true,
44137
- },
44138
- ]
44139
- : []),
44140
44340
  // These need to come before handle: miss or else they are grouped
44141
44341
  // with that routing section
44142
44342
  ...afterFilesRewrites,
44143
- ...(appDir
44144
- ? [
44145
- // rewrite route back to `.rsc`, but skip checking fs
44146
- {
44147
- src: `^${path_1.default.posix.join('/', entryDirectory, '/((?!.+\\.rsc).+?)(?:/)?$')}`,
44148
- has: [
44149
- {
44150
- type: 'header',
44151
- key: rscHeader,
44152
- },
44153
- ],
44154
- dest: path_1.default.posix.join('/', entryDirectory, '/$1.rsc'),
44155
- headers: { vary: rscVaryHeader },
44156
- continue: true,
44157
- override: true,
44158
- },
44159
- ]
44160
- : []),
44161
- // make sure 404 page is used when a directory is matched without
44162
- // an index page
44163
44343
  { handle: 'resource' },
44164
44344
  ...fallbackRewrites,
44345
+ // make sure 404 page is used when a directory is matched without
44346
+ // an index page
44165
44347
  { src: path_1.default.posix.join('/', entryDirectory, '.*'), status: 404 },
44348
+ { handle: 'miss' },
44166
44349
  // We need to make sure to 404 for /_next after handle: miss since
44167
44350
  // handle: miss is called before rewrites and to prevent rewriting /_next
44168
- { handle: 'miss' },
44169
44351
  {
44170
44352
  src: path_1.default.posix.join('/', entryDirectory, '_next/static/(?:[^/]+/pages|pages|chunks|runtime|css|image|media)/.+'),
44171
44353
  status: 404,
@@ -44539,14 +44721,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
44539
44721
  return (mod && mod.__esModule) ? mod : { "default": mod };
44540
44722
  };
44541
44723
  Object.defineProperty(exports, "__esModule", ({ value: true }));
44542
- exports.isApiPage = exports.getOperationType = exports.upgradeMiddlewareManifest = exports.getMiddlewareManifest = exports.getFunctionsConfigManifest = exports.getMiddlewareBundle = exports.getSourceFilePathFromPage = exports.isDynamicRoute = exports.normalizePage = exports.getImagesConfig = exports.getNextConfig = exports.normalizePackageJson = exports.validateEntrypoint = exports.excludeFiles = exports.getPrivateOutputs = exports.updateRouteSrc = exports.getNextServerPath = exports.normalizeIndexOutput = exports.getStaticFiles = exports.onPrerenderRoute = exports.onPrerenderRouteInitial = exports.detectLambdaLimitExceeding = exports.outputFunctionFileSizeInfo = exports.getPageLambdaGroups = exports.MAX_UNCOMPRESSED_LAMBDA_SIZE = exports.addLocaleOrDefault = exports.normalizeLocalePath = exports.getPrerenderManifest = exports.getRequiredServerFilesManifest = exports.getExportStatus = exports.getExportIntent = exports.createLambdaFromPseudoLayers = exports.createPseudoLayer = exports.ExperimentalTraceVersion = exports.collectTracedFiles = exports.getFilesMapFromReasons = exports.filterStaticPages = exports.getImagesManifest = exports.localizeDynamicRoutes = exports.getDynamicRoutes = exports.getRoutesManifest = exports.prettyBytes = exports.MIB = exports.KIB = void 0;
44724
+ exports.isApiPage = exports.getOperationType = exports.upgradeMiddlewareManifest = exports.getMiddlewareManifest = exports.getFunctionsConfigManifest = exports.getMiddlewareBundle = exports.normalizeEdgeFunctionPath = exports.getSourceFilePathFromPage = exports.isDynamicRoute = exports.normalizePage = exports.getImagesConfig = exports.getNextConfig = exports.normalizePackageJson = exports.validateEntrypoint = exports.excludeFiles = exports.getPrivateOutputs = exports.updateRouteSrc = exports.getNextServerPath = exports.normalizeIndexOutput = exports.getStaticFiles = exports.onPrerenderRoute = exports.onPrerenderRouteInitial = exports.detectLambdaLimitExceeding = exports.outputFunctionFileSizeInfo = exports.getPageLambdaGroups = exports.MAX_UNCOMPRESSED_LAMBDA_SIZE = exports.addLocaleOrDefault = exports.normalizeLocalePath = exports.getPrerenderManifest = exports.getRequiredServerFilesManifest = exports.getExportStatus = exports.getExportIntent = exports.createLambdaFromPseudoLayers = exports.createPseudoLayer = exports.ExperimentalTraceVersion = exports.collectTracedFiles = exports.getFilesMapFromReasons = exports.filterStaticPages = exports.getImagesManifest = exports.localizeDynamicRoutes = exports.getDynamicRoutes = exports.getRoutesManifest = exports.RSC_PREFETCH_SUFFIX = exports.RSC_CONTENT_TYPE = exports.prettyBytes = exports.MIB = exports.KIB = void 0;
44543
44725
  const build_utils_1 = __webpack_require__(3445);
44544
44726
  const async_sema_1 = __webpack_require__(7905);
44545
44727
  const buffer_crc32_1 = __importDefault(__webpack_require__(2227));
44546
44728
  const fs_extra_1 = __importStar(__webpack_require__(2650));
44547
44729
  const path_1 = __importDefault(__webpack_require__(5622));
44548
44730
  const resolve_from_1 = __importDefault(__webpack_require__(7472));
44549
- const semver_1 = __importDefault(__webpack_require__(1039));
44731
+ const semver_1 = __importDefault(__webpack_require__(7846));
44550
44732
  const zlib_1 = __importDefault(__webpack_require__(8761));
44551
44733
  const url_1 = __importDefault(__webpack_require__(8835));
44552
44734
  const escape_string_regexp_1 = __importDefault(__webpack_require__(3133));
@@ -44559,6 +44741,8 @@ exports.KIB = 1024;
44559
44741
  exports.MIB = 1024 * exports.KIB;
44560
44742
  const prettyBytes = (n) => (0, bytes_1.default)(n, { unitSeparator: ' ' });
44561
44743
  exports.prettyBytes = prettyBytes;
44744
+ exports.RSC_CONTENT_TYPE = 'x-component';
44745
+ exports.RSC_PREFETCH_SUFFIX = '.prefetch.rsc';
44562
44746
  // Identify /[param]/ in route string
44563
44747
  // eslint-disable-next-line no-useless-escape
44564
44748
  const TEST_DYNAMIC_ROUTE = /\/\[[^\/]+?\](?=\/|$)/;
@@ -44707,7 +44891,7 @@ async function getRoutesManifest(entryPath, outputDirectory, nextVersion) {
44707
44891
  return routesManifest;
44708
44892
  }
44709
44893
  exports.getRoutesManifest = getRoutesManifest;
44710
- async function getDynamicRoutes(entryPath, entryDirectory, dynamicPages, isDev, routesManifest, omittedRoutes, canUsePreviewMode, bypassToken, isServerMode, dynamicMiddlewareRouteMap, appPathRoutesManifest) {
44894
+ async function getDynamicRoutes(entryPath, entryDirectory, dynamicPages, isDev, routesManifest, omittedRoutes, canUsePreviewMode, bypassToken, isServerMode, dynamicMiddlewareRouteMap) {
44711
44895
  if (routesManifest) {
44712
44896
  switch (routesManifest.version) {
44713
44897
  case 1:
@@ -44766,13 +44950,11 @@ async function getDynamicRoutes(entryPath, entryDirectory, dynamicPages, isDev,
44766
44950
  },
44767
44951
  ];
44768
44952
  }
44769
- if (appPathRoutesManifest?.[page]) {
44770
- routes.push({
44771
- ...route,
44772
- src: route.src.replace(new RegExp((0, escape_string_regexp_1.default)('(?:/)?$')), '(?:\\.rsc)(?:/)?$'),
44773
- dest: route.dest?.replace(/($|\?)/, '.rsc$1'),
44774
- });
44775
- }
44953
+ routes.push({
44954
+ ...route,
44955
+ src: route.src.replace(new RegExp((0, escape_string_regexp_1.default)('(?:/)?$')), '(?:\\.rsc)(?:/)?$'),
44956
+ dest: route.dest?.replace(/($|\?)/, '.rsc$1'),
44957
+ });
44776
44958
  routes.push(route);
44777
44959
  continue;
44778
44960
  }
@@ -45876,7 +46058,7 @@ const onPrerenderRoute = (prerenderRouteArgs) => (routeKey, { isBlocking, isFall
45876
46058
  const rscEnabled = !!routesManifest?.rsc;
45877
46059
  const rscVaryHeader = routesManifest?.rsc?.varyHeader ||
45878
46060
  'RSC, Next-Router-State-Tree, Next-Router-Prefetch';
45879
- const rscContentTypeHeader = routesManifest?.rsc?.contentTypeHeader || 'text/x-component';
46061
+ const rscContentTypeHeader = routesManifest?.rsc?.contentTypeHeader || exports.RSC_CONTENT_TYPE;
45880
46062
  let sourcePath;
45881
46063
  if (`/${outputPathPage}` !== srcRoute && srcRoute) {
45882
46064
  sourcePath = srcRoute;
@@ -46016,7 +46198,7 @@ async function getStaticFiles(entryPath, entryDirectory, outputDirectory) {
46016
46198
  }
46017
46199
  exports.getStaticFiles = getStaticFiles;
46018
46200
  function normalizeIndexOutput(outputName, isServerMode) {
46019
- if (outputName !== '/index' && isServerMode) {
46201
+ if (outputName !== 'index' && outputName !== '/index' && isServerMode) {
46020
46202
  return outputName.replace(/\/index$/, '');
46021
46203
  }
46022
46204
  return outputName;
@@ -46110,6 +46292,21 @@ function normalizeRegions(regions) {
46110
46292
  }
46111
46293
  return newRegions;
46112
46294
  }
46295
+ function normalizeEdgeFunctionPath(shortPath, appPathRoutesManifest) {
46296
+ if (shortPath.startsWith('app/') &&
46297
+ (shortPath.endsWith('/page') ||
46298
+ shortPath.endsWith('/route') ||
46299
+ shortPath === 'app/_not-found')) {
46300
+ const ogRoute = shortPath.replace(/^app\//, '/');
46301
+ shortPath = (appPathRoutesManifest[ogRoute] ||
46302
+ shortPath.replace(/(^|\/)(page|route)$/, '')).replace(/^\//, '');
46303
+ if (!shortPath || shortPath === '/') {
46304
+ shortPath = 'index';
46305
+ }
46306
+ }
46307
+ return shortPath;
46308
+ }
46309
+ exports.normalizeEdgeFunctionPath = normalizeEdgeFunctionPath;
46113
46310
  async function getMiddlewareBundle({ entryPath, outputDirectory, routesManifest, isCorrectMiddlewareOrder, prerenderBypassToken, nextVersion, appPathRoutesManifest, }) {
46114
46311
  const middlewareManifest = await getMiddlewareManifest(entryPath, outputDirectory);
46115
46312
  const sortedFunctions = [
@@ -46226,21 +46423,11 @@ async function getMiddlewareBundle({ entryPath, outputDirectory, routesManifest,
46226
46423
  if (shortPath.startsWith('pages/')) {
46227
46424
  shortPath = shortPath.replace(/^pages\//, '');
46228
46425
  }
46229
- else if (shortPath.startsWith('app/') &&
46230
- (shortPath.endsWith('/page') ||
46231
- shortPath.endsWith('/route') ||
46232
- shortPath === 'app/_not-found')) {
46233
- const ogRoute = shortPath.replace(/^app\//, '/');
46234
- shortPath = (appPathRoutesManifest[ogRoute] ||
46235
- shortPath.replace(/(^|\/)(page|route)$/, '')).replace(/^\//, '');
46236
- if (!shortPath || shortPath === '/') {
46237
- shortPath = 'index';
46238
- }
46426
+ else {
46427
+ shortPath = normalizeEdgeFunctionPath(shortPath, appPathRoutesManifest);
46239
46428
  }
46240
46429
  if (routesManifest?.basePath) {
46241
- shortPath = path_1.default.posix
46242
- .join(routesManifest.basePath, shortPath)
46243
- .replace(/^\//, '');
46430
+ shortPath = normalizeIndexOutput(path_1.default.posix.join('./', routesManifest?.basePath, shortPath.replace(/^\//, '')), true);
46244
46431
  }
46245
46432
  worker.edgeFunction.name = shortPath;
46246
46433
  source.edgeFunctions[shortPath] = worker.edgeFunction;