@saasmakers/eslint 1.0.2 → 1.0.4

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.
Files changed (62) hide show
  1. package/dist/eslint.config.cjs +10905 -19
  2. package/dist/eslint.config.d.cts +1 -3874
  3. package/dist/eslint.config.d.mts +1 -3874
  4. package/dist/eslint.config.d.ts +1 -3874
  5. package/dist/eslint.config.mjs +10883 -18
  6. package/dist/index.cjs +9 -8
  7. package/dist/index.mjs +9 -8
  8. package/dist/shared/{eslint.C6EaTeQZ.mjs → eslint.CohBuu1-.mjs} +1 -34
  9. package/dist/shared/{eslint.Dxl4X46J.cjs → eslint.DhFjwkxh.cjs} +0 -37
  10. package/package.json +1 -2
  11. package/dist/chunks/formatters.cjs +0 -248
  12. package/dist/chunks/formatters.mjs +0 -246
  13. package/dist/chunks/import.cjs +0 -53
  14. package/dist/chunks/import.mjs +0 -51
  15. package/dist/chunks/index.cjs +0 -120
  16. package/dist/chunks/index.mjs +0 -101
  17. package/dist/chunks/index2.cjs +0 -880
  18. package/dist/chunks/index2.mjs +0 -868
  19. package/dist/chunks/index3.cjs +0 -982
  20. package/dist/chunks/index3.mjs +0 -979
  21. package/dist/chunks/index4.cjs +0 -12099
  22. package/dist/chunks/index4.mjs +0 -12077
  23. package/dist/chunks/jsdoc.cjs +0 -38398
  24. package/dist/chunks/jsdoc.mjs +0 -38391
  25. package/dist/chunks/regexp.cjs +0 -18518
  26. package/dist/chunks/regexp.mjs +0 -18511
  27. package/dist/chunks/stylistic.cjs +0 -23935
  28. package/dist/chunks/stylistic.mjs +0 -23932
  29. package/dist/chunks/typescript.cjs +0 -56168
  30. package/dist/chunks/typescript.mjs +0 -56154
  31. package/dist/chunks/unicorn.cjs +0 -82775
  32. package/dist/chunks/unicorn.mjs +0 -82764
  33. package/dist/chunks/vue.cjs +0 -96233
  34. package/dist/chunks/vue.mjs +0 -96220
  35. package/dist/shared/eslint.05nu4VbT.mjs +0 -9
  36. package/dist/shared/eslint.07qTxm9w.mjs +0 -3352
  37. package/dist/shared/eslint.6MAvpL4q.cjs +0 -2141
  38. package/dist/shared/eslint.7dipMixF.cjs +0 -14
  39. package/dist/shared/eslint.B6FFUbNC.mjs +0 -3814
  40. package/dist/shared/eslint.BGpVg2tt.cjs +0 -13
  41. package/dist/shared/eslint.BL4sYiVQ.cjs +0 -820
  42. package/dist/shared/eslint.BOOP2x9L.cjs +0 -67
  43. package/dist/shared/eslint.BXzpdiiq.mjs +0 -10
  44. package/dist/shared/eslint.Bl69eiyD.cjs +0 -7073
  45. package/dist/shared/eslint.BtkqW7nC.mjs +0 -818
  46. package/dist/shared/eslint.C12_M0Cw.cjs +0 -9
  47. package/dist/shared/eslint.COweQ1RR.mjs +0 -5
  48. package/dist/shared/eslint.CUi9znUC.mjs +0 -13
  49. package/dist/shared/eslint.Cg6Ty7p7.mjs +0 -2699
  50. package/dist/shared/eslint.CxAZpd0w.cjs +0 -3365
  51. package/dist/shared/eslint.DDD2xc4l.cjs +0 -25
  52. package/dist/shared/eslint.DI7QBrVD.mjs +0 -6
  53. package/dist/shared/eslint.DITpUYTO.mjs +0 -36955
  54. package/dist/shared/eslint.DP_6nQqR.cjs +0 -3822
  55. package/dist/shared/eslint.DUamuDzp.cjs +0 -7
  56. package/dist/shared/eslint.Difk5awg.mjs +0 -2139
  57. package/dist/shared/eslint.Dlgr3LGM.mjs +0 -7070
  58. package/dist/shared/eslint.DoYGbUIG.cjs +0 -2724
  59. package/dist/shared/eslint.Dprsk9zl.mjs +0 -65
  60. package/dist/shared/eslint.MfgVmFE7.cjs +0 -3054
  61. package/dist/shared/eslint.W7RM7aEw.mjs +0 -3052
  62. package/dist/shared/eslint.sHyLr4S9.cjs +0 -37003
@@ -1,3822 +0,0 @@
1
- 'use strict';
2
-
3
- const require$$0 = require('tty');
4
- const require$$1 = require('util');
5
- const index = require('./eslint.Dxl4X46J.cjs');
6
-
7
- function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e.default : e; }
8
-
9
- const require$$0__default = /*#__PURE__*/_interopDefaultCompat(require$$0);
10
- const require$$1__default = /*#__PURE__*/_interopDefaultCompat(require$$1);
11
-
12
- var src = {exports: {}};
13
-
14
- var browser$1 = {exports: {}};
15
-
16
- /**
17
- * Helpers.
18
- */
19
-
20
- var ms;
21
- var hasRequiredMs;
22
-
23
- function requireMs () {
24
- if (hasRequiredMs) return ms;
25
- hasRequiredMs = 1;
26
- var s = 1000;
27
- var m = s * 60;
28
- var h = m * 60;
29
- var d = h * 24;
30
- var w = d * 7;
31
- var y = d * 365.25;
32
-
33
- /**
34
- * Parse or format the given `val`.
35
- *
36
- * Options:
37
- *
38
- * - `long` verbose formatting [false]
39
- *
40
- * @param {String|Number} val
41
- * @param {Object} [options]
42
- * @throws {Error} throw an error if val is not a non-empty string or a number
43
- * @return {String|Number}
44
- * @api public
45
- */
46
-
47
- ms = function (val, options) {
48
- options = options || {};
49
- var type = typeof val;
50
- if (type === 'string' && val.length > 0) {
51
- return parse(val);
52
- } else if (type === 'number' && isFinite(val)) {
53
- return options.long ? fmtLong(val) : fmtShort(val);
54
- }
55
- throw new Error(
56
- 'val is not a non-empty string or a valid number. val=' +
57
- JSON.stringify(val)
58
- );
59
- };
60
-
61
- /**
62
- * Parse the given `str` and return milliseconds.
63
- *
64
- * @param {String} str
65
- * @return {Number}
66
- * @api private
67
- */
68
-
69
- function parse(str) {
70
- str = String(str);
71
- if (str.length > 100) {
72
- return;
73
- }
74
- var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(
75
- str
76
- );
77
- if (!match) {
78
- return;
79
- }
80
- var n = parseFloat(match[1]);
81
- var type = (match[2] || 'ms').toLowerCase();
82
- switch (type) {
83
- case 'years':
84
- case 'year':
85
- case 'yrs':
86
- case 'yr':
87
- case 'y':
88
- return n * y;
89
- case 'weeks':
90
- case 'week':
91
- case 'w':
92
- return n * w;
93
- case 'days':
94
- case 'day':
95
- case 'd':
96
- return n * d;
97
- case 'hours':
98
- case 'hour':
99
- case 'hrs':
100
- case 'hr':
101
- case 'h':
102
- return n * h;
103
- case 'minutes':
104
- case 'minute':
105
- case 'mins':
106
- case 'min':
107
- case 'm':
108
- return n * m;
109
- case 'seconds':
110
- case 'second':
111
- case 'secs':
112
- case 'sec':
113
- case 's':
114
- return n * s;
115
- case 'milliseconds':
116
- case 'millisecond':
117
- case 'msecs':
118
- case 'msec':
119
- case 'ms':
120
- return n;
121
- default:
122
- return undefined;
123
- }
124
- }
125
-
126
- /**
127
- * Short format for `ms`.
128
- *
129
- * @param {Number} ms
130
- * @return {String}
131
- * @api private
132
- */
133
-
134
- function fmtShort(ms) {
135
- var msAbs = Math.abs(ms);
136
- if (msAbs >= d) {
137
- return Math.round(ms / d) + 'd';
138
- }
139
- if (msAbs >= h) {
140
- return Math.round(ms / h) + 'h';
141
- }
142
- if (msAbs >= m) {
143
- return Math.round(ms / m) + 'm';
144
- }
145
- if (msAbs >= s) {
146
- return Math.round(ms / s) + 's';
147
- }
148
- return ms + 'ms';
149
- }
150
-
151
- /**
152
- * Long format for `ms`.
153
- *
154
- * @param {Number} ms
155
- * @return {String}
156
- * @api private
157
- */
158
-
159
- function fmtLong(ms) {
160
- var msAbs = Math.abs(ms);
161
- if (msAbs >= d) {
162
- return plural(ms, msAbs, d, 'day');
163
- }
164
- if (msAbs >= h) {
165
- return plural(ms, msAbs, h, 'hour');
166
- }
167
- if (msAbs >= m) {
168
- return plural(ms, msAbs, m, 'minute');
169
- }
170
- if (msAbs >= s) {
171
- return plural(ms, msAbs, s, 'second');
172
- }
173
- return ms + ' ms';
174
- }
175
-
176
- /**
177
- * Pluralization helper.
178
- */
179
-
180
- function plural(ms, msAbs, n, name) {
181
- var isPlural = msAbs >= n * 1.5;
182
- return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');
183
- }
184
- return ms;
185
- }
186
-
187
- var common;
188
- var hasRequiredCommon;
189
-
190
- function requireCommon () {
191
- if (hasRequiredCommon) return common;
192
- hasRequiredCommon = 1;
193
- /**
194
- * This is the common logic for both the Node.js and web browser
195
- * implementations of `debug()`.
196
- */
197
-
198
- function setup(env) {
199
- createDebug.debug = createDebug;
200
- createDebug.default = createDebug;
201
- createDebug.coerce = coerce;
202
- createDebug.disable = disable;
203
- createDebug.enable = enable;
204
- createDebug.enabled = enabled;
205
- createDebug.humanize = requireMs();
206
- createDebug.destroy = destroy;
207
-
208
- Object.keys(env).forEach(key => {
209
- createDebug[key] = env[key];
210
- });
211
-
212
- /**
213
- * The currently active debug mode names, and names to skip.
214
- */
215
-
216
- createDebug.names = [];
217
- createDebug.skips = [];
218
-
219
- /**
220
- * Map of special "%n" handling functions, for the debug "format" argument.
221
- *
222
- * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N".
223
- */
224
- createDebug.formatters = {};
225
-
226
- /**
227
- * Selects a color for a debug namespace
228
- * @param {String} namespace The namespace string for the debug instance to be colored
229
- * @return {Number|String} An ANSI color code for the given namespace
230
- * @api private
231
- */
232
- function selectColor(namespace) {
233
- let hash = 0;
234
-
235
- for (let i = 0; i < namespace.length; i++) {
236
- hash = ((hash << 5) - hash) + namespace.charCodeAt(i);
237
- hash |= 0; // Convert to 32bit integer
238
- }
239
-
240
- return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
241
- }
242
- createDebug.selectColor = selectColor;
243
-
244
- /**
245
- * Create a debugger with the given `namespace`.
246
- *
247
- * @param {String} namespace
248
- * @return {Function}
249
- * @api public
250
- */
251
- function createDebug(namespace) {
252
- let prevTime;
253
- let enableOverride = null;
254
- let namespacesCache;
255
- let enabledCache;
256
-
257
- function debug(...args) {
258
- // Disabled?
259
- if (!debug.enabled) {
260
- return;
261
- }
262
-
263
- const self = debug;
264
-
265
- // Set `diff` timestamp
266
- const curr = Number(new Date());
267
- const ms = curr - (prevTime || curr);
268
- self.diff = ms;
269
- self.prev = prevTime;
270
- self.curr = curr;
271
- prevTime = curr;
272
-
273
- args[0] = createDebug.coerce(args[0]);
274
-
275
- if (typeof args[0] !== 'string') {
276
- // Anything else let's inspect with %O
277
- args.unshift('%O');
278
- }
279
-
280
- // Apply any `formatters` transformations
281
- let index = 0;
282
- args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {
283
- // If we encounter an escaped % then don't increase the array index
284
- if (match === '%%') {
285
- return '%';
286
- }
287
- index++;
288
- const formatter = createDebug.formatters[format];
289
- if (typeof formatter === 'function') {
290
- const val = args[index];
291
- match = formatter.call(self, val);
292
-
293
- // Now we need to remove `args[index]` since it's inlined in the `format`
294
- args.splice(index, 1);
295
- index--;
296
- }
297
- return match;
298
- });
299
-
300
- // Apply env-specific formatting (colors, etc.)
301
- createDebug.formatArgs.call(self, args);
302
-
303
- const logFn = self.log || createDebug.log;
304
- logFn.apply(self, args);
305
- }
306
-
307
- debug.namespace = namespace;
308
- debug.useColors = createDebug.useColors();
309
- debug.color = createDebug.selectColor(namespace);
310
- debug.extend = extend;
311
- debug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release.
312
-
313
- Object.defineProperty(debug, 'enabled', {
314
- enumerable: true,
315
- configurable: false,
316
- get: () => {
317
- if (enableOverride !== null) {
318
- return enableOverride;
319
- }
320
- if (namespacesCache !== createDebug.namespaces) {
321
- namespacesCache = createDebug.namespaces;
322
- enabledCache = createDebug.enabled(namespace);
323
- }
324
-
325
- return enabledCache;
326
- },
327
- set: v => {
328
- enableOverride = v;
329
- }
330
- });
331
-
332
- // Env-specific initialization logic for debug instances
333
- if (typeof createDebug.init === 'function') {
334
- createDebug.init(debug);
335
- }
336
-
337
- return debug;
338
- }
339
-
340
- function extend(namespace, delimiter) {
341
- const newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);
342
- newDebug.log = this.log;
343
- return newDebug;
344
- }
345
-
346
- /**
347
- * Enables a debug mode by namespaces. This can include modes
348
- * separated by a colon and wildcards.
349
- *
350
- * @param {String} namespaces
351
- * @api public
352
- */
353
- function enable(namespaces) {
354
- createDebug.save(namespaces);
355
- createDebug.namespaces = namespaces;
356
-
357
- createDebug.names = [];
358
- createDebug.skips = [];
359
-
360
- const split = (typeof namespaces === 'string' ? namespaces : '')
361
- .trim()
362
- .replace(/\s+/g, ',')
363
- .split(',')
364
- .filter(Boolean);
365
-
366
- for (const ns of split) {
367
- if (ns[0] === '-') {
368
- createDebug.skips.push(ns.slice(1));
369
- } else {
370
- createDebug.names.push(ns);
371
- }
372
- }
373
- }
374
-
375
- /**
376
- * Checks if the given string matches a namespace template, honoring
377
- * asterisks as wildcards.
378
- *
379
- * @param {String} search
380
- * @param {String} template
381
- * @return {Boolean}
382
- */
383
- function matchesTemplate(search, template) {
384
- let searchIndex = 0;
385
- let templateIndex = 0;
386
- let starIndex = -1;
387
- let matchIndex = 0;
388
-
389
- while (searchIndex < search.length) {
390
- if (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === '*')) {
391
- // Match character or proceed with wildcard
392
- if (template[templateIndex] === '*') {
393
- starIndex = templateIndex;
394
- matchIndex = searchIndex;
395
- templateIndex++; // Skip the '*'
396
- } else {
397
- searchIndex++;
398
- templateIndex++;
399
- }
400
- } else if (starIndex !== -1) { // eslint-disable-line no-negated-condition
401
- // Backtrack to the last '*' and try to match more characters
402
- templateIndex = starIndex + 1;
403
- matchIndex++;
404
- searchIndex = matchIndex;
405
- } else {
406
- return false; // No match
407
- }
408
- }
409
-
410
- // Handle trailing '*' in template
411
- while (templateIndex < template.length && template[templateIndex] === '*') {
412
- templateIndex++;
413
- }
414
-
415
- return templateIndex === template.length;
416
- }
417
-
418
- /**
419
- * Disable debug output.
420
- *
421
- * @return {String} namespaces
422
- * @api public
423
- */
424
- function disable() {
425
- const namespaces = [
426
- ...createDebug.names,
427
- ...createDebug.skips.map(namespace => '-' + namespace)
428
- ].join(',');
429
- createDebug.enable('');
430
- return namespaces;
431
- }
432
-
433
- /**
434
- * Returns true if the given mode name is enabled, false otherwise.
435
- *
436
- * @param {String} name
437
- * @return {Boolean}
438
- * @api public
439
- */
440
- function enabled(name) {
441
- for (const skip of createDebug.skips) {
442
- if (matchesTemplate(name, skip)) {
443
- return false;
444
- }
445
- }
446
-
447
- for (const ns of createDebug.names) {
448
- if (matchesTemplate(name, ns)) {
449
- return true;
450
- }
451
- }
452
-
453
- return false;
454
- }
455
-
456
- /**
457
- * Coerce `val`.
458
- *
459
- * @param {Mixed} val
460
- * @return {Mixed}
461
- * @api private
462
- */
463
- function coerce(val) {
464
- if (val instanceof Error) {
465
- return val.stack || val.message;
466
- }
467
- return val;
468
- }
469
-
470
- /**
471
- * XXX DO NOT USE. This is a temporary stub function.
472
- * XXX It WILL be removed in the next major release.
473
- */
474
- function destroy() {
475
- console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');
476
- }
477
-
478
- createDebug.enable(createDebug.load());
479
-
480
- return createDebug;
481
- }
482
-
483
- common = setup;
484
- return common;
485
- }
486
-
487
- /* eslint-env browser */
488
-
489
- var hasRequiredBrowser;
490
-
491
- function requireBrowser () {
492
- if (hasRequiredBrowser) return browser$1.exports;
493
- hasRequiredBrowser = 1;
494
- (function (module, exports$1) {
495
- /**
496
- * This is the web browser implementation of `debug()`.
497
- */
498
-
499
- exports$1.formatArgs = formatArgs;
500
- exports$1.save = save;
501
- exports$1.load = load;
502
- exports$1.useColors = useColors;
503
- exports$1.storage = localstorage();
504
- exports$1.destroy = (() => {
505
- let warned = false;
506
-
507
- return () => {
508
- if (!warned) {
509
- warned = true;
510
- console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');
511
- }
512
- };
513
- })();
514
-
515
- /**
516
- * Colors.
517
- */
518
-
519
- exports$1.colors = [
520
- '#0000CC',
521
- '#0000FF',
522
- '#0033CC',
523
- '#0033FF',
524
- '#0066CC',
525
- '#0066FF',
526
- '#0099CC',
527
- '#0099FF',
528
- '#00CC00',
529
- '#00CC33',
530
- '#00CC66',
531
- '#00CC99',
532
- '#00CCCC',
533
- '#00CCFF',
534
- '#3300CC',
535
- '#3300FF',
536
- '#3333CC',
537
- '#3333FF',
538
- '#3366CC',
539
- '#3366FF',
540
- '#3399CC',
541
- '#3399FF',
542
- '#33CC00',
543
- '#33CC33',
544
- '#33CC66',
545
- '#33CC99',
546
- '#33CCCC',
547
- '#33CCFF',
548
- '#6600CC',
549
- '#6600FF',
550
- '#6633CC',
551
- '#6633FF',
552
- '#66CC00',
553
- '#66CC33',
554
- '#9900CC',
555
- '#9900FF',
556
- '#9933CC',
557
- '#9933FF',
558
- '#99CC00',
559
- '#99CC33',
560
- '#CC0000',
561
- '#CC0033',
562
- '#CC0066',
563
- '#CC0099',
564
- '#CC00CC',
565
- '#CC00FF',
566
- '#CC3300',
567
- '#CC3333',
568
- '#CC3366',
569
- '#CC3399',
570
- '#CC33CC',
571
- '#CC33FF',
572
- '#CC6600',
573
- '#CC6633',
574
- '#CC9900',
575
- '#CC9933',
576
- '#CCCC00',
577
- '#CCCC33',
578
- '#FF0000',
579
- '#FF0033',
580
- '#FF0066',
581
- '#FF0099',
582
- '#FF00CC',
583
- '#FF00FF',
584
- '#FF3300',
585
- '#FF3333',
586
- '#FF3366',
587
- '#FF3399',
588
- '#FF33CC',
589
- '#FF33FF',
590
- '#FF6600',
591
- '#FF6633',
592
- '#FF9900',
593
- '#FF9933',
594
- '#FFCC00',
595
- '#FFCC33'
596
- ];
597
-
598
- /**
599
- * Currently only WebKit-based Web Inspectors, Firefox >= v31,
600
- * and the Firebug extension (any Firefox version) are known
601
- * to support "%c" CSS customizations.
602
- *
603
- * TODO: add a `localStorage` variable to explicitly enable/disable colors
604
- */
605
-
606
- // eslint-disable-next-line complexity
607
- function useColors() {
608
- // NB: In an Electron preload script, document will be defined but not fully
609
- // initialized. Since we know we're in Chrome, we'll just detect this case
610
- // explicitly
611
- if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {
612
- return true;
613
- }
614
-
615
- // Internet Explorer and Edge do not support colors.
616
- if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
617
- return false;
618
- }
619
-
620
- let m;
621
-
622
- // Is webkit? http://stackoverflow.com/a/16459606/376773
623
- // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
624
- // eslint-disable-next-line no-return-assign
625
- return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||
626
- // Is firebug? http://stackoverflow.com/a/398120/376773
627
- (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||
628
- // Is firefox >= v31?
629
- // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
630
- (typeof navigator !== 'undefined' && navigator.userAgent && (m = navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)) && parseInt(m[1], 10) >= 31) ||
631
- // Double check webkit in userAgent just in case we are in a worker
632
- (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/));
633
- }
634
-
635
- /**
636
- * Colorize log arguments if enabled.
637
- *
638
- * @api public
639
- */
640
-
641
- function formatArgs(args) {
642
- args[0] = (this.useColors ? '%c' : '') +
643
- this.namespace +
644
- (this.useColors ? ' %c' : ' ') +
645
- args[0] +
646
- (this.useColors ? '%c ' : ' ') +
647
- '+' + module.exports.humanize(this.diff);
648
-
649
- if (!this.useColors) {
650
- return;
651
- }
652
-
653
- const c = 'color: ' + this.color;
654
- args.splice(1, 0, c, 'color: inherit');
655
-
656
- // The final "%c" is somewhat tricky, because there could be other
657
- // arguments passed either before or after the %c, so we need to
658
- // figure out the correct index to insert the CSS into
659
- let index = 0;
660
- let lastC = 0;
661
- args[0].replace(/%[a-zA-Z%]/g, match => {
662
- if (match === '%%') {
663
- return;
664
- }
665
- index++;
666
- if (match === '%c') {
667
- // We only are interested in the *last* %c
668
- // (the user may have provided their own)
669
- lastC = index;
670
- }
671
- });
672
-
673
- args.splice(lastC, 0, c);
674
- }
675
-
676
- /**
677
- * Invokes `console.debug()` when available.
678
- * No-op when `console.debug` is not a "function".
679
- * If `console.debug` is not available, falls back
680
- * to `console.log`.
681
- *
682
- * @api public
683
- */
684
- exports$1.log = console.debug || console.log || (() => {});
685
-
686
- /**
687
- * Save `namespaces`.
688
- *
689
- * @param {String} namespaces
690
- * @api private
691
- */
692
- function save(namespaces) {
693
- try {
694
- if (namespaces) {
695
- exports$1.storage.setItem('debug', namespaces);
696
- } else {
697
- exports$1.storage.removeItem('debug');
698
- }
699
- } catch (error) {
700
- // Swallow
701
- // XXX (@Qix-) should we be logging these?
702
- }
703
- }
704
-
705
- /**
706
- * Load `namespaces`.
707
- *
708
- * @return {String} returns the previously persisted debug modes
709
- * @api private
710
- */
711
- function load() {
712
- let r;
713
- try {
714
- r = exports$1.storage.getItem('debug') || exports$1.storage.getItem('DEBUG') ;
715
- } catch (error) {
716
- // Swallow
717
- // XXX (@Qix-) should we be logging these?
718
- }
719
-
720
- // If debug isn't set in LS, and we're in Electron, try to load $DEBUG
721
- if (!r && typeof process !== 'undefined' && 'env' in process) {
722
- r = process.env.DEBUG;
723
- }
724
-
725
- return r;
726
- }
727
-
728
- /**
729
- * Localstorage attempts to return the localstorage.
730
- *
731
- * This is necessary because safari throws
732
- * when a user disables cookies/localstorage
733
- * and you attempt to access it.
734
- *
735
- * @return {LocalStorage}
736
- * @api private
737
- */
738
-
739
- function localstorage() {
740
- try {
741
- // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context
742
- // The Browser also has localStorage in the global context.
743
- return localStorage;
744
- } catch (error) {
745
- // Swallow
746
- // XXX (@Qix-) should we be logging these?
747
- }
748
- }
749
-
750
- module.exports = requireCommon()(exports$1);
751
-
752
- const {formatters} = module.exports;
753
-
754
- /**
755
- * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
756
- */
757
-
758
- formatters.j = function (v) {
759
- try {
760
- return JSON.stringify(v);
761
- } catch (error) {
762
- return '[UnexpectedJSONParseError]: ' + error.message;
763
- }
764
- };
765
- } (browser$1, browser$1.exports));
766
- return browser$1.exports;
767
- }
768
-
769
- var node = {exports: {}};
770
-
771
- /* eslint-env browser */
772
- /* eslint-disable n/no-unsupported-features/node-builtins */
773
-
774
- const level = (() => {
775
- if (!('navigator' in globalThis)) {
776
- return 0;
777
- }
778
-
779
- if (globalThis.navigator.userAgentData) {
780
- const brand = navigator.userAgentData.brands.find(({brand}) => brand === 'Chromium');
781
- if (brand?.version > 93) {
782
- return 3;
783
- }
784
- }
785
-
786
- if (/\b(Chrome|Chromium)\//.test(globalThis.navigator.userAgent)) {
787
- return 1;
788
- }
789
-
790
- return 0;
791
- })();
792
-
793
- const colorSupport = level !== 0 && {
794
- level,
795
- hasBasic: true,
796
- has256: level >= 2,
797
- has16m: level >= 3,
798
- };
799
-
800
- const supportsColor = {
801
- stdout: colorSupport,
802
- stderr: colorSupport,
803
- };
804
-
805
- const browser = {
806
- __proto__: null,
807
- default: supportsColor
808
- };
809
-
810
- const require$$2 = /*@__PURE__*/index.getAugmentedNamespace(browser);
811
-
812
- /**
813
- * Module dependencies.
814
- */
815
-
816
- var hasRequiredNode;
817
-
818
- function requireNode () {
819
- if (hasRequiredNode) return node.exports;
820
- hasRequiredNode = 1;
821
- (function (module, exports$1) {
822
- const tty = require$$0__default;
823
- const util = require$$1__default;
824
-
825
- /**
826
- * This is the Node.js implementation of `debug()`.
827
- */
828
-
829
- exports$1.init = init;
830
- exports$1.log = log;
831
- exports$1.formatArgs = formatArgs;
832
- exports$1.save = save;
833
- exports$1.load = load;
834
- exports$1.useColors = useColors;
835
- exports$1.destroy = util.deprecate(
836
- () => {},
837
- 'Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'
838
- );
839
-
840
- /**
841
- * Colors.
842
- */
843
-
844
- exports$1.colors = [6, 2, 3, 4, 5, 1];
845
-
846
- try {
847
- // Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json)
848
- // eslint-disable-next-line import/no-extraneous-dependencies
849
- const supportsColor = require$$2;
850
-
851
- if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) {
852
- exports$1.colors = [
853
- 20,
854
- 21,
855
- 26,
856
- 27,
857
- 32,
858
- 33,
859
- 38,
860
- 39,
861
- 40,
862
- 41,
863
- 42,
864
- 43,
865
- 44,
866
- 45,
867
- 56,
868
- 57,
869
- 62,
870
- 63,
871
- 68,
872
- 69,
873
- 74,
874
- 75,
875
- 76,
876
- 77,
877
- 78,
878
- 79,
879
- 80,
880
- 81,
881
- 92,
882
- 93,
883
- 98,
884
- 99,
885
- 112,
886
- 113,
887
- 128,
888
- 129,
889
- 134,
890
- 135,
891
- 148,
892
- 149,
893
- 160,
894
- 161,
895
- 162,
896
- 163,
897
- 164,
898
- 165,
899
- 166,
900
- 167,
901
- 168,
902
- 169,
903
- 170,
904
- 171,
905
- 172,
906
- 173,
907
- 178,
908
- 179,
909
- 184,
910
- 185,
911
- 196,
912
- 197,
913
- 198,
914
- 199,
915
- 200,
916
- 201,
917
- 202,
918
- 203,
919
- 204,
920
- 205,
921
- 206,
922
- 207,
923
- 208,
924
- 209,
925
- 214,
926
- 215,
927
- 220,
928
- 221
929
- ];
930
- }
931
- } catch (error) {
932
- // Swallow - we only care if `supports-color` is available; it doesn't have to be.
933
- }
934
-
935
- /**
936
- * Build up the default `inspectOpts` object from the environment variables.
937
- *
938
- * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js
939
- */
940
-
941
- exports$1.inspectOpts = Object.keys(process.env).filter(key => {
942
- return /^debug_/i.test(key);
943
- }).reduce((obj, key) => {
944
- // Camel-case
945
- const prop = key
946
- .substring(6)
947
- .toLowerCase()
948
- .replace(/_([a-z])/g, (_, k) => {
949
- return k.toUpperCase();
950
- });
951
-
952
- // Coerce string value into JS value
953
- let val = process.env[key];
954
- if (/^(yes|on|true|enabled)$/i.test(val)) {
955
- val = true;
956
- } else if (/^(no|off|false|disabled)$/i.test(val)) {
957
- val = false;
958
- } else if (val === 'null') {
959
- val = null;
960
- } else {
961
- val = Number(val);
962
- }
963
-
964
- obj[prop] = val;
965
- return obj;
966
- }, {});
967
-
968
- /**
969
- * Is stdout a TTY? Colored output is enabled when `true`.
970
- */
971
-
972
- function useColors() {
973
- return 'colors' in exports$1.inspectOpts ?
974
- Boolean(exports$1.inspectOpts.colors) :
975
- tty.isatty(process.stderr.fd);
976
- }
977
-
978
- /**
979
- * Adds ANSI color escape codes if enabled.
980
- *
981
- * @api public
982
- */
983
-
984
- function formatArgs(args) {
985
- const {namespace: name, useColors} = this;
986
-
987
- if (useColors) {
988
- const c = this.color;
989
- const colorCode = '\u001B[3' + (c < 8 ? c : '8;5;' + c);
990
- const prefix = ` ${colorCode};1m${name} \u001B[0m`;
991
-
992
- args[0] = prefix + args[0].split('\n').join('\n' + prefix);
993
- args.push(colorCode + 'm+' + module.exports.humanize(this.diff) + '\u001B[0m');
994
- } else {
995
- args[0] = getDate() + name + ' ' + args[0];
996
- }
997
- }
998
-
999
- function getDate() {
1000
- if (exports$1.inspectOpts.hideDate) {
1001
- return '';
1002
- }
1003
- return new Date().toISOString() + ' ';
1004
- }
1005
-
1006
- /**
1007
- * Invokes `util.formatWithOptions()` with the specified arguments and writes to stderr.
1008
- */
1009
-
1010
- function log(...args) {
1011
- return process.stderr.write(util.formatWithOptions(exports$1.inspectOpts, ...args) + '\n');
1012
- }
1013
-
1014
- /**
1015
- * Save `namespaces`.
1016
- *
1017
- * @param {String} namespaces
1018
- * @api private
1019
- */
1020
- function save(namespaces) {
1021
- if (namespaces) {
1022
- process.env.DEBUG = namespaces;
1023
- } else {
1024
- // If you set a process.env field to null or undefined, it gets cast to the
1025
- // string 'null' or 'undefined'. Just delete instead.
1026
- delete process.env.DEBUG;
1027
- }
1028
- }
1029
-
1030
- /**
1031
- * Load `namespaces`.
1032
- *
1033
- * @return {String} returns the previously persisted debug modes
1034
- * @api private
1035
- */
1036
-
1037
- function load() {
1038
- return process.env.DEBUG;
1039
- }
1040
-
1041
- /**
1042
- * Init logic for `debug` instances.
1043
- *
1044
- * Create a new `inspectOpts` object in case `useColors` is set
1045
- * differently for a particular `debug` instance.
1046
- */
1047
-
1048
- function init(debug) {
1049
- debug.inspectOpts = {};
1050
-
1051
- const keys = Object.keys(exports$1.inspectOpts);
1052
- for (let i = 0; i < keys.length; i++) {
1053
- debug.inspectOpts[keys[i]] = exports$1.inspectOpts[keys[i]];
1054
- }
1055
- }
1056
-
1057
- module.exports = requireCommon()(exports$1);
1058
-
1059
- const {formatters} = module.exports;
1060
-
1061
- /**
1062
- * Map %o to `util.inspect()`, all on a single line.
1063
- */
1064
-
1065
- formatters.o = function (v) {
1066
- this.inspectOpts.colors = this.useColors;
1067
- return util.inspect(v, this.inspectOpts)
1068
- .split('\n')
1069
- .map(str => str.trim())
1070
- .join(' ');
1071
- };
1072
-
1073
- /**
1074
- * Map %O to `util.inspect()`, allowing multiple lines if needed.
1075
- */
1076
-
1077
- formatters.O = function (v) {
1078
- this.inspectOpts.colors = this.useColors;
1079
- return util.inspect(v, this.inspectOpts);
1080
- };
1081
- } (node, node.exports));
1082
- return node.exports;
1083
- }
1084
-
1085
- /**
1086
- * Detect Electron renderer / nwjs process, which is node, but we should
1087
- * treat as a browser.
1088
- */
1089
-
1090
- var hasRequiredSrc;
1091
-
1092
- function requireSrc () {
1093
- if (hasRequiredSrc) return src.exports;
1094
- hasRequiredSrc = 1;
1095
- if (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) {
1096
- src.exports = requireBrowser();
1097
- } else {
1098
- src.exports = requireNode();
1099
- }
1100
- return src.exports;
1101
- }
1102
-
1103
- var re = {exports: {}};
1104
-
1105
- var constants;
1106
- var hasRequiredConstants;
1107
-
1108
- function requireConstants () {
1109
- if (hasRequiredConstants) return constants;
1110
- hasRequiredConstants = 1;
1111
-
1112
- // Note: this is the semver.org version of the spec that it implements
1113
- // Not necessarily the package version of this code.
1114
- const SEMVER_SPEC_VERSION = '2.0.0';
1115
-
1116
- const MAX_LENGTH = 256;
1117
- const MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||
1118
- /* istanbul ignore next */ 9007199254740991;
1119
-
1120
- // Max safe segment length for coercion.
1121
- const MAX_SAFE_COMPONENT_LENGTH = 16;
1122
-
1123
- // Max safe length for a build identifier. The max length minus 6 characters for
1124
- // the shortest version with a build 0.0.0+BUILD.
1125
- const MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6;
1126
-
1127
- const RELEASE_TYPES = [
1128
- 'major',
1129
- 'premajor',
1130
- 'minor',
1131
- 'preminor',
1132
- 'patch',
1133
- 'prepatch',
1134
- 'prerelease',
1135
- ];
1136
-
1137
- constants = {
1138
- MAX_LENGTH,
1139
- MAX_SAFE_COMPONENT_LENGTH,
1140
- MAX_SAFE_BUILD_LENGTH,
1141
- MAX_SAFE_INTEGER,
1142
- RELEASE_TYPES,
1143
- SEMVER_SPEC_VERSION,
1144
- FLAG_INCLUDE_PRERELEASE: 0b001,
1145
- FLAG_LOOSE: 0b010,
1146
- };
1147
- return constants;
1148
- }
1149
-
1150
- var debug_1;
1151
- var hasRequiredDebug;
1152
-
1153
- function requireDebug () {
1154
- if (hasRequiredDebug) return debug_1;
1155
- hasRequiredDebug = 1;
1156
-
1157
- const debug = (
1158
- typeof process === 'object' &&
1159
- process.env &&
1160
- process.env.NODE_DEBUG &&
1161
- /\bsemver\b/i.test(process.env.NODE_DEBUG)
1162
- ) ? (...args) => console.error('SEMVER', ...args)
1163
- : () => {};
1164
-
1165
- debug_1 = debug;
1166
- return debug_1;
1167
- }
1168
-
1169
- var hasRequiredRe;
1170
-
1171
- function requireRe () {
1172
- if (hasRequiredRe) return re.exports;
1173
- hasRequiredRe = 1;
1174
- (function (module, exports$1) {
1175
-
1176
- const {
1177
- MAX_SAFE_COMPONENT_LENGTH,
1178
- MAX_SAFE_BUILD_LENGTH,
1179
- MAX_LENGTH,
1180
- } = requireConstants();
1181
- const debug = requireDebug();
1182
- exports$1 = module.exports = {};
1183
-
1184
- // The actual regexps go on exports.re
1185
- const re = exports$1.re = [];
1186
- const safeRe = exports$1.safeRe = [];
1187
- const src = exports$1.src = [];
1188
- const safeSrc = exports$1.safeSrc = [];
1189
- const t = exports$1.t = {};
1190
- let R = 0;
1191
-
1192
- const LETTERDASHNUMBER = '[a-zA-Z0-9-]';
1193
-
1194
- // Replace some greedy regex tokens to prevent regex dos issues. These regex are
1195
- // used internally via the safeRe object since all inputs in this library get
1196
- // normalized first to trim and collapse all extra whitespace. The original
1197
- // regexes are exported for userland consumption and lower level usage. A
1198
- // future breaking change could export the safer regex only with a note that
1199
- // all input should have extra whitespace removed.
1200
- const safeRegexReplacements = [
1201
- ['\\s', 1],
1202
- ['\\d', MAX_LENGTH],
1203
- [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH],
1204
- ];
1205
-
1206
- const makeSafeRegex = (value) => {
1207
- for (const [token, max] of safeRegexReplacements) {
1208
- value = value
1209
- .split(`${token}*`).join(`${token}{0,${max}}`)
1210
- .split(`${token}+`).join(`${token}{1,${max}}`);
1211
- }
1212
- return value
1213
- };
1214
-
1215
- const createToken = (name, value, isGlobal) => {
1216
- const safe = makeSafeRegex(value);
1217
- const index = R++;
1218
- debug(name, index, value);
1219
- t[name] = index;
1220
- src[index] = value;
1221
- safeSrc[index] = safe;
1222
- re[index] = new RegExp(value, isGlobal ? 'g' : undefined);
1223
- safeRe[index] = new RegExp(safe, isGlobal ? 'g' : undefined);
1224
- };
1225
-
1226
- // The following Regular Expressions can be used for tokenizing,
1227
- // validating, and parsing SemVer version strings.
1228
-
1229
- // ## Numeric Identifier
1230
- // A single `0`, or a non-zero digit followed by zero or more digits.
1231
-
1232
- createToken('NUMERICIDENTIFIER', '0|[1-9]\\d*');
1233
- createToken('NUMERICIDENTIFIERLOOSE', '\\d+');
1234
-
1235
- // ## Non-numeric Identifier
1236
- // Zero or more digits, followed by a letter or hyphen, and then zero or
1237
- // more letters, digits, or hyphens.
1238
-
1239
- createToken('NONNUMERICIDENTIFIER', `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`);
1240
-
1241
- // ## Main Version
1242
- // Three dot-separated numeric identifiers.
1243
-
1244
- createToken('MAINVERSION', `(${src[t.NUMERICIDENTIFIER]})\\.` +
1245
- `(${src[t.NUMERICIDENTIFIER]})\\.` +
1246
- `(${src[t.NUMERICIDENTIFIER]})`);
1247
-
1248
- createToken('MAINVERSIONLOOSE', `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.` +
1249
- `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.` +
1250
- `(${src[t.NUMERICIDENTIFIERLOOSE]})`);
1251
-
1252
- // ## Pre-release Version Identifier
1253
- // A numeric identifier, or a non-numeric identifier.
1254
- // Non-numeric identifiers include numeric identifiers but can be longer.
1255
- // Therefore non-numeric identifiers must go first.
1256
-
1257
- createToken('PRERELEASEIDENTIFIER', `(?:${src[t.NONNUMERICIDENTIFIER]
1258
- }|${src[t.NUMERICIDENTIFIER]})`);
1259
-
1260
- createToken('PRERELEASEIDENTIFIERLOOSE', `(?:${src[t.NONNUMERICIDENTIFIER]
1261
- }|${src[t.NUMERICIDENTIFIERLOOSE]})`);
1262
-
1263
- // ## Pre-release Version
1264
- // Hyphen, followed by one or more dot-separated pre-release version
1265
- // identifiers.
1266
-
1267
- createToken('PRERELEASE', `(?:-(${src[t.PRERELEASEIDENTIFIER]
1268
- }(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`);
1269
-
1270
- createToken('PRERELEASELOOSE', `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]
1271
- }(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`);
1272
-
1273
- // ## Build Metadata Identifier
1274
- // Any combination of digits, letters, or hyphens.
1275
-
1276
- createToken('BUILDIDENTIFIER', `${LETTERDASHNUMBER}+`);
1277
-
1278
- // ## Build Metadata
1279
- // Plus sign, followed by one or more period-separated build metadata
1280
- // identifiers.
1281
-
1282
- createToken('BUILD', `(?:\\+(${src[t.BUILDIDENTIFIER]
1283
- }(?:\\.${src[t.BUILDIDENTIFIER]})*))`);
1284
-
1285
- // ## Full Version String
1286
- // A main version, followed optionally by a pre-release version and
1287
- // build metadata.
1288
-
1289
- // Note that the only major, minor, patch, and pre-release sections of
1290
- // the version string are capturing groups. The build metadata is not a
1291
- // capturing group, because it should not ever be used in version
1292
- // comparison.
1293
-
1294
- createToken('FULLPLAIN', `v?${src[t.MAINVERSION]
1295
- }${src[t.PRERELEASE]}?${
1296
- src[t.BUILD]}?`);
1297
-
1298
- createToken('FULL', `^${src[t.FULLPLAIN]}$`);
1299
-
1300
- // like full, but allows v1.2.3 and =1.2.3, which people do sometimes.
1301
- // also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty
1302
- // common in the npm registry.
1303
- createToken('LOOSEPLAIN', `[v=\\s]*${src[t.MAINVERSIONLOOSE]
1304
- }${src[t.PRERELEASELOOSE]}?${
1305
- src[t.BUILD]}?`);
1306
-
1307
- createToken('LOOSE', `^${src[t.LOOSEPLAIN]}$`);
1308
-
1309
- createToken('GTLT', '((?:<|>)?=?)');
1310
-
1311
- // Something like "2.*" or "1.2.x".
1312
- // Note that "x.x" is a valid xRange identifer, meaning "any version"
1313
- // Only the first item is strictly required.
1314
- createToken('XRANGEIDENTIFIERLOOSE', `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);
1315
- createToken('XRANGEIDENTIFIER', `${src[t.NUMERICIDENTIFIER]}|x|X|\\*`);
1316
-
1317
- createToken('XRANGEPLAIN', `[v=\\s]*(${src[t.XRANGEIDENTIFIER]})` +
1318
- `(?:\\.(${src[t.XRANGEIDENTIFIER]})` +
1319
- `(?:\\.(${src[t.XRANGEIDENTIFIER]})` +
1320
- `(?:${src[t.PRERELEASE]})?${
1321
- src[t.BUILD]}?` +
1322
- `)?)?`);
1323
-
1324
- createToken('XRANGEPLAINLOOSE', `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})` +
1325
- `(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` +
1326
- `(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` +
1327
- `(?:${src[t.PRERELEASELOOSE]})?${
1328
- src[t.BUILD]}?` +
1329
- `)?)?`);
1330
-
1331
- createToken('XRANGE', `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`);
1332
- createToken('XRANGELOOSE', `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`);
1333
-
1334
- // Coercion.
1335
- // Extract anything that could conceivably be a part of a valid semver
1336
- createToken('COERCEPLAIN', `${'(^|[^\\d])' +
1337
- '(\\d{1,'}${MAX_SAFE_COMPONENT_LENGTH}})` +
1338
- `(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` +
1339
- `(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`);
1340
- createToken('COERCE', `${src[t.COERCEPLAIN]}(?:$|[^\\d])`);
1341
- createToken('COERCEFULL', src[t.COERCEPLAIN] +
1342
- `(?:${src[t.PRERELEASE]})?` +
1343
- `(?:${src[t.BUILD]})?` +
1344
- `(?:$|[^\\d])`);
1345
- createToken('COERCERTL', src[t.COERCE], true);
1346
- createToken('COERCERTLFULL', src[t.COERCEFULL], true);
1347
-
1348
- // Tilde ranges.
1349
- // Meaning is "reasonably at or greater than"
1350
- createToken('LONETILDE', '(?:~>?)');
1351
-
1352
- createToken('TILDETRIM', `(\\s*)${src[t.LONETILDE]}\\s+`, true);
1353
- exports$1.tildeTrimReplace = '$1~';
1354
-
1355
- createToken('TILDE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`);
1356
- createToken('TILDELOOSE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`);
1357
-
1358
- // Caret ranges.
1359
- // Meaning is "at least and backwards compatible with"
1360
- createToken('LONECARET', '(?:\\^)');
1361
-
1362
- createToken('CARETTRIM', `(\\s*)${src[t.LONECARET]}\\s+`, true);
1363
- exports$1.caretTrimReplace = '$1^';
1364
-
1365
- createToken('CARET', `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`);
1366
- createToken('CARETLOOSE', `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`);
1367
-
1368
- // A simple gt/lt/eq thing, or just "" to indicate "any version"
1369
- createToken('COMPARATORLOOSE', `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`);
1370
- createToken('COMPARATOR', `^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`);
1371
-
1372
- // An expression to strip any whitespace between the gtlt and the thing
1373
- // it modifies, so that `> 1.2.3` ==> `>1.2.3`
1374
- createToken('COMPARATORTRIM', `(\\s*)${src[t.GTLT]
1375
- }\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true);
1376
- exports$1.comparatorTrimReplace = '$1$2$3';
1377
-
1378
- // Something like `1.2.3 - 1.2.4`
1379
- // Note that these all use the loose form, because they'll be
1380
- // checked against either the strict or loose comparator form
1381
- // later.
1382
- createToken('HYPHENRANGE', `^\\s*(${src[t.XRANGEPLAIN]})` +
1383
- `\\s+-\\s+` +
1384
- `(${src[t.XRANGEPLAIN]})` +
1385
- `\\s*$`);
1386
-
1387
- createToken('HYPHENRANGELOOSE', `^\\s*(${src[t.XRANGEPLAINLOOSE]})` +
1388
- `\\s+-\\s+` +
1389
- `(${src[t.XRANGEPLAINLOOSE]})` +
1390
- `\\s*$`);
1391
-
1392
- // Star ranges basically just allow anything at all.
1393
- createToken('STAR', '(<|>)?=?\\s*\\*');
1394
- // >=0.0.0 is like a star
1395
- createToken('GTE0', '^\\s*>=\\s*0\\.0\\.0\\s*$');
1396
- createToken('GTE0PRE', '^\\s*>=\\s*0\\.0\\.0-0\\s*$');
1397
- } (re, re.exports));
1398
- return re.exports;
1399
- }
1400
-
1401
- var parseOptions_1;
1402
- var hasRequiredParseOptions;
1403
-
1404
- function requireParseOptions () {
1405
- if (hasRequiredParseOptions) return parseOptions_1;
1406
- hasRequiredParseOptions = 1;
1407
-
1408
- // parse out just the options we care about
1409
- const looseOption = Object.freeze({ loose: true });
1410
- const emptyOpts = Object.freeze({ });
1411
- const parseOptions = options => {
1412
- if (!options) {
1413
- return emptyOpts
1414
- }
1415
-
1416
- if (typeof options !== 'object') {
1417
- return looseOption
1418
- }
1419
-
1420
- return options
1421
- };
1422
- parseOptions_1 = parseOptions;
1423
- return parseOptions_1;
1424
- }
1425
-
1426
- var identifiers;
1427
- var hasRequiredIdentifiers;
1428
-
1429
- function requireIdentifiers () {
1430
- if (hasRequiredIdentifiers) return identifiers;
1431
- hasRequiredIdentifiers = 1;
1432
-
1433
- const numeric = /^[0-9]+$/;
1434
- const compareIdentifiers = (a, b) => {
1435
- if (typeof a === 'number' && typeof b === 'number') {
1436
- return a === b ? 0 : a < b ? -1 : 1
1437
- }
1438
-
1439
- const anum = numeric.test(a);
1440
- const bnum = numeric.test(b);
1441
-
1442
- if (anum && bnum) {
1443
- a = +a;
1444
- b = +b;
1445
- }
1446
-
1447
- return a === b ? 0
1448
- : (anum && !bnum) ? -1
1449
- : (bnum && !anum) ? 1
1450
- : a < b ? -1
1451
- : 1
1452
- };
1453
-
1454
- const rcompareIdentifiers = (a, b) => compareIdentifiers(b, a);
1455
-
1456
- identifiers = {
1457
- compareIdentifiers,
1458
- rcompareIdentifiers,
1459
- };
1460
- return identifiers;
1461
- }
1462
-
1463
- var semver$1;
1464
- var hasRequiredSemver$1;
1465
-
1466
- function requireSemver$1 () {
1467
- if (hasRequiredSemver$1) return semver$1;
1468
- hasRequiredSemver$1 = 1;
1469
-
1470
- const debug = requireDebug();
1471
- const { MAX_LENGTH, MAX_SAFE_INTEGER } = requireConstants();
1472
- const { safeRe: re, t } = requireRe();
1473
-
1474
- const parseOptions = requireParseOptions();
1475
- const { compareIdentifiers } = requireIdentifiers();
1476
- class SemVer {
1477
- constructor (version, options) {
1478
- options = parseOptions(options);
1479
-
1480
- if (version instanceof SemVer) {
1481
- if (version.loose === !!options.loose &&
1482
- version.includePrerelease === !!options.includePrerelease) {
1483
- return version
1484
- } else {
1485
- version = version.version;
1486
- }
1487
- } else if (typeof version !== 'string') {
1488
- throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version}".`)
1489
- }
1490
-
1491
- if (version.length > MAX_LENGTH) {
1492
- throw new TypeError(
1493
- `version is longer than ${MAX_LENGTH} characters`
1494
- )
1495
- }
1496
-
1497
- debug('SemVer', version, options);
1498
- this.options = options;
1499
- this.loose = !!options.loose;
1500
- // this isn't actually relevant for versions, but keep it so that we
1501
- // don't run into trouble passing this.options around.
1502
- this.includePrerelease = !!options.includePrerelease;
1503
-
1504
- const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]);
1505
-
1506
- if (!m) {
1507
- throw new TypeError(`Invalid Version: ${version}`)
1508
- }
1509
-
1510
- this.raw = version;
1511
-
1512
- // these are actually numbers
1513
- this.major = +m[1];
1514
- this.minor = +m[2];
1515
- this.patch = +m[3];
1516
-
1517
- if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
1518
- throw new TypeError('Invalid major version')
1519
- }
1520
-
1521
- if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
1522
- throw new TypeError('Invalid minor version')
1523
- }
1524
-
1525
- if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
1526
- throw new TypeError('Invalid patch version')
1527
- }
1528
-
1529
- // numberify any prerelease numeric ids
1530
- if (!m[4]) {
1531
- this.prerelease = [];
1532
- } else {
1533
- this.prerelease = m[4].split('.').map((id) => {
1534
- if (/^[0-9]+$/.test(id)) {
1535
- const num = +id;
1536
- if (num >= 0 && num < MAX_SAFE_INTEGER) {
1537
- return num
1538
- }
1539
- }
1540
- return id
1541
- });
1542
- }
1543
-
1544
- this.build = m[5] ? m[5].split('.') : [];
1545
- this.format();
1546
- }
1547
-
1548
- format () {
1549
- this.version = `${this.major}.${this.minor}.${this.patch}`;
1550
- if (this.prerelease.length) {
1551
- this.version += `-${this.prerelease.join('.')}`;
1552
- }
1553
- return this.version
1554
- }
1555
-
1556
- toString () {
1557
- return this.version
1558
- }
1559
-
1560
- compare (other) {
1561
- debug('SemVer.compare', this.version, this.options, other);
1562
- if (!(other instanceof SemVer)) {
1563
- if (typeof other === 'string' && other === this.version) {
1564
- return 0
1565
- }
1566
- other = new SemVer(other, this.options);
1567
- }
1568
-
1569
- if (other.version === this.version) {
1570
- return 0
1571
- }
1572
-
1573
- return this.compareMain(other) || this.comparePre(other)
1574
- }
1575
-
1576
- compareMain (other) {
1577
- if (!(other instanceof SemVer)) {
1578
- other = new SemVer(other, this.options);
1579
- }
1580
-
1581
- if (this.major < other.major) {
1582
- return -1
1583
- }
1584
- if (this.major > other.major) {
1585
- return 1
1586
- }
1587
- if (this.minor < other.minor) {
1588
- return -1
1589
- }
1590
- if (this.minor > other.minor) {
1591
- return 1
1592
- }
1593
- if (this.patch < other.patch) {
1594
- return -1
1595
- }
1596
- if (this.patch > other.patch) {
1597
- return 1
1598
- }
1599
- return 0
1600
- }
1601
-
1602
- comparePre (other) {
1603
- if (!(other instanceof SemVer)) {
1604
- other = new SemVer(other, this.options);
1605
- }
1606
-
1607
- // NOT having a prerelease is > having one
1608
- if (this.prerelease.length && !other.prerelease.length) {
1609
- return -1
1610
- } else if (!this.prerelease.length && other.prerelease.length) {
1611
- return 1
1612
- } else if (!this.prerelease.length && !other.prerelease.length) {
1613
- return 0
1614
- }
1615
-
1616
- let i = 0;
1617
- do {
1618
- const a = this.prerelease[i];
1619
- const b = other.prerelease[i];
1620
- debug('prerelease compare', i, a, b);
1621
- if (a === undefined && b === undefined) {
1622
- return 0
1623
- } else if (b === undefined) {
1624
- return 1
1625
- } else if (a === undefined) {
1626
- return -1
1627
- } else if (a === b) {
1628
- continue
1629
- } else {
1630
- return compareIdentifiers(a, b)
1631
- }
1632
- } while (++i)
1633
- }
1634
-
1635
- compareBuild (other) {
1636
- if (!(other instanceof SemVer)) {
1637
- other = new SemVer(other, this.options);
1638
- }
1639
-
1640
- let i = 0;
1641
- do {
1642
- const a = this.build[i];
1643
- const b = other.build[i];
1644
- debug('build compare', i, a, b);
1645
- if (a === undefined && b === undefined) {
1646
- return 0
1647
- } else if (b === undefined) {
1648
- return 1
1649
- } else if (a === undefined) {
1650
- return -1
1651
- } else if (a === b) {
1652
- continue
1653
- } else {
1654
- return compareIdentifiers(a, b)
1655
- }
1656
- } while (++i)
1657
- }
1658
-
1659
- // preminor will bump the version up to the next minor release, and immediately
1660
- // down to pre-release. premajor and prepatch work the same way.
1661
- inc (release, identifier, identifierBase) {
1662
- if (release.startsWith('pre')) {
1663
- if (!identifier && identifierBase === false) {
1664
- throw new Error('invalid increment argument: identifier is empty')
1665
- }
1666
- // Avoid an invalid semver results
1667
- if (identifier) {
1668
- const match = `-${identifier}`.match(this.options.loose ? re[t.PRERELEASELOOSE] : re[t.PRERELEASE]);
1669
- if (!match || match[1] !== identifier) {
1670
- throw new Error(`invalid identifier: ${identifier}`)
1671
- }
1672
- }
1673
- }
1674
-
1675
- switch (release) {
1676
- case 'premajor':
1677
- this.prerelease.length = 0;
1678
- this.patch = 0;
1679
- this.minor = 0;
1680
- this.major++;
1681
- this.inc('pre', identifier, identifierBase);
1682
- break
1683
- case 'preminor':
1684
- this.prerelease.length = 0;
1685
- this.patch = 0;
1686
- this.minor++;
1687
- this.inc('pre', identifier, identifierBase);
1688
- break
1689
- case 'prepatch':
1690
- // If this is already a prerelease, it will bump to the next version
1691
- // drop any prereleases that might already exist, since they are not
1692
- // relevant at this point.
1693
- this.prerelease.length = 0;
1694
- this.inc('patch', identifier, identifierBase);
1695
- this.inc('pre', identifier, identifierBase);
1696
- break
1697
- // If the input is a non-prerelease version, this acts the same as
1698
- // prepatch.
1699
- case 'prerelease':
1700
- if (this.prerelease.length === 0) {
1701
- this.inc('patch', identifier, identifierBase);
1702
- }
1703
- this.inc('pre', identifier, identifierBase);
1704
- break
1705
- case 'release':
1706
- if (this.prerelease.length === 0) {
1707
- throw new Error(`version ${this.raw} is not a prerelease`)
1708
- }
1709
- this.prerelease.length = 0;
1710
- break
1711
-
1712
- case 'major':
1713
- // If this is a pre-major version, bump up to the same major version.
1714
- // Otherwise increment major.
1715
- // 1.0.0-5 bumps to 1.0.0
1716
- // 1.1.0 bumps to 2.0.0
1717
- if (
1718
- this.minor !== 0 ||
1719
- this.patch !== 0 ||
1720
- this.prerelease.length === 0
1721
- ) {
1722
- this.major++;
1723
- }
1724
- this.minor = 0;
1725
- this.patch = 0;
1726
- this.prerelease = [];
1727
- break
1728
- case 'minor':
1729
- // If this is a pre-minor version, bump up to the same minor version.
1730
- // Otherwise increment minor.
1731
- // 1.2.0-5 bumps to 1.2.0
1732
- // 1.2.1 bumps to 1.3.0
1733
- if (this.patch !== 0 || this.prerelease.length === 0) {
1734
- this.minor++;
1735
- }
1736
- this.patch = 0;
1737
- this.prerelease = [];
1738
- break
1739
- case 'patch':
1740
- // If this is not a pre-release version, it will increment the patch.
1741
- // If it is a pre-release it will bump up to the same patch version.
1742
- // 1.2.0-5 patches to 1.2.0
1743
- // 1.2.0 patches to 1.2.1
1744
- if (this.prerelease.length === 0) {
1745
- this.patch++;
1746
- }
1747
- this.prerelease = [];
1748
- break
1749
- // This probably shouldn't be used publicly.
1750
- // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction.
1751
- case 'pre': {
1752
- const base = Number(identifierBase) ? 1 : 0;
1753
-
1754
- if (this.prerelease.length === 0) {
1755
- this.prerelease = [base];
1756
- } else {
1757
- let i = this.prerelease.length;
1758
- while (--i >= 0) {
1759
- if (typeof this.prerelease[i] === 'number') {
1760
- this.prerelease[i]++;
1761
- i = -2;
1762
- }
1763
- }
1764
- if (i === -1) {
1765
- // didn't increment anything
1766
- if (identifier === this.prerelease.join('.') && identifierBase === false) {
1767
- throw new Error('invalid increment argument: identifier already exists')
1768
- }
1769
- this.prerelease.push(base);
1770
- }
1771
- }
1772
- if (identifier) {
1773
- // 1.2.0-beta.1 bumps to 1.2.0-beta.2,
1774
- // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0
1775
- let prerelease = [identifier, base];
1776
- if (identifierBase === false) {
1777
- prerelease = [identifier];
1778
- }
1779
- if (compareIdentifiers(this.prerelease[0], identifier) === 0) {
1780
- if (isNaN(this.prerelease[1])) {
1781
- this.prerelease = prerelease;
1782
- }
1783
- } else {
1784
- this.prerelease = prerelease;
1785
- }
1786
- }
1787
- break
1788
- }
1789
- default:
1790
- throw new Error(`invalid increment argument: ${release}`)
1791
- }
1792
- this.raw = this.format();
1793
- if (this.build.length) {
1794
- this.raw += `+${this.build.join('.')}`;
1795
- }
1796
- return this
1797
- }
1798
- }
1799
-
1800
- semver$1 = SemVer;
1801
- return semver$1;
1802
- }
1803
-
1804
- var parse_1;
1805
- var hasRequiredParse;
1806
-
1807
- function requireParse () {
1808
- if (hasRequiredParse) return parse_1;
1809
- hasRequiredParse = 1;
1810
-
1811
- const SemVer = requireSemver$1();
1812
- const parse = (version, options, throwErrors = false) => {
1813
- if (version instanceof SemVer) {
1814
- return version
1815
- }
1816
- try {
1817
- return new SemVer(version, options)
1818
- } catch (er) {
1819
- if (!throwErrors) {
1820
- return null
1821
- }
1822
- throw er
1823
- }
1824
- };
1825
-
1826
- parse_1 = parse;
1827
- return parse_1;
1828
- }
1829
-
1830
- var valid_1;
1831
- var hasRequiredValid$1;
1832
-
1833
- function requireValid$1 () {
1834
- if (hasRequiredValid$1) return valid_1;
1835
- hasRequiredValid$1 = 1;
1836
-
1837
- const parse = requireParse();
1838
- const valid = (version, options) => {
1839
- const v = parse(version, options);
1840
- return v ? v.version : null
1841
- };
1842
- valid_1 = valid;
1843
- return valid_1;
1844
- }
1845
-
1846
- var clean_1;
1847
- var hasRequiredClean;
1848
-
1849
- function requireClean () {
1850
- if (hasRequiredClean) return clean_1;
1851
- hasRequiredClean = 1;
1852
-
1853
- const parse = requireParse();
1854
- const clean = (version, options) => {
1855
- const s = parse(version.trim().replace(/^[=v]+/, ''), options);
1856
- return s ? s.version : null
1857
- };
1858
- clean_1 = clean;
1859
- return clean_1;
1860
- }
1861
-
1862
- var inc_1;
1863
- var hasRequiredInc;
1864
-
1865
- function requireInc () {
1866
- if (hasRequiredInc) return inc_1;
1867
- hasRequiredInc = 1;
1868
-
1869
- const SemVer = requireSemver$1();
1870
-
1871
- const inc = (version, release, options, identifier, identifierBase) => {
1872
- if (typeof (options) === 'string') {
1873
- identifierBase = identifier;
1874
- identifier = options;
1875
- options = undefined;
1876
- }
1877
-
1878
- try {
1879
- return new SemVer(
1880
- version instanceof SemVer ? version.version : version,
1881
- options
1882
- ).inc(release, identifier, identifierBase).version
1883
- } catch (er) {
1884
- return null
1885
- }
1886
- };
1887
- inc_1 = inc;
1888
- return inc_1;
1889
- }
1890
-
1891
- var diff_1;
1892
- var hasRequiredDiff;
1893
-
1894
- function requireDiff () {
1895
- if (hasRequiredDiff) return diff_1;
1896
- hasRequiredDiff = 1;
1897
-
1898
- const parse = requireParse();
1899
-
1900
- const diff = (version1, version2) => {
1901
- const v1 = parse(version1, null, true);
1902
- const v2 = parse(version2, null, true);
1903
- const comparison = v1.compare(v2);
1904
-
1905
- if (comparison === 0) {
1906
- return null
1907
- }
1908
-
1909
- const v1Higher = comparison > 0;
1910
- const highVersion = v1Higher ? v1 : v2;
1911
- const lowVersion = v1Higher ? v2 : v1;
1912
- const highHasPre = !!highVersion.prerelease.length;
1913
- const lowHasPre = !!lowVersion.prerelease.length;
1914
-
1915
- if (lowHasPre && !highHasPre) {
1916
- // Going from prerelease -> no prerelease requires some special casing
1917
-
1918
- // If the low version has only a major, then it will always be a major
1919
- // Some examples:
1920
- // 1.0.0-1 -> 1.0.0
1921
- // 1.0.0-1 -> 1.1.1
1922
- // 1.0.0-1 -> 2.0.0
1923
- if (!lowVersion.patch && !lowVersion.minor) {
1924
- return 'major'
1925
- }
1926
-
1927
- // If the main part has no difference
1928
- if (lowVersion.compareMain(highVersion) === 0) {
1929
- if (lowVersion.minor && !lowVersion.patch) {
1930
- return 'minor'
1931
- }
1932
- return 'patch'
1933
- }
1934
- }
1935
-
1936
- // add the `pre` prefix if we are going to a prerelease version
1937
- const prefix = highHasPre ? 'pre' : '';
1938
-
1939
- if (v1.major !== v2.major) {
1940
- return prefix + 'major'
1941
- }
1942
-
1943
- if (v1.minor !== v2.minor) {
1944
- return prefix + 'minor'
1945
- }
1946
-
1947
- if (v1.patch !== v2.patch) {
1948
- return prefix + 'patch'
1949
- }
1950
-
1951
- // high and low are prereleases
1952
- return 'prerelease'
1953
- };
1954
-
1955
- diff_1 = diff;
1956
- return diff_1;
1957
- }
1958
-
1959
- var major_1;
1960
- var hasRequiredMajor;
1961
-
1962
- function requireMajor () {
1963
- if (hasRequiredMajor) return major_1;
1964
- hasRequiredMajor = 1;
1965
-
1966
- const SemVer = requireSemver$1();
1967
- const major = (a, loose) => new SemVer(a, loose).major;
1968
- major_1 = major;
1969
- return major_1;
1970
- }
1971
-
1972
- var minor_1;
1973
- var hasRequiredMinor;
1974
-
1975
- function requireMinor () {
1976
- if (hasRequiredMinor) return minor_1;
1977
- hasRequiredMinor = 1;
1978
-
1979
- const SemVer = requireSemver$1();
1980
- const minor = (a, loose) => new SemVer(a, loose).minor;
1981
- minor_1 = minor;
1982
- return minor_1;
1983
- }
1984
-
1985
- var patch_1;
1986
- var hasRequiredPatch;
1987
-
1988
- function requirePatch () {
1989
- if (hasRequiredPatch) return patch_1;
1990
- hasRequiredPatch = 1;
1991
-
1992
- const SemVer = requireSemver$1();
1993
- const patch = (a, loose) => new SemVer(a, loose).patch;
1994
- patch_1 = patch;
1995
- return patch_1;
1996
- }
1997
-
1998
- var prerelease_1;
1999
- var hasRequiredPrerelease;
2000
-
2001
- function requirePrerelease () {
2002
- if (hasRequiredPrerelease) return prerelease_1;
2003
- hasRequiredPrerelease = 1;
2004
-
2005
- const parse = requireParse();
2006
- const prerelease = (version, options) => {
2007
- const parsed = parse(version, options);
2008
- return (parsed && parsed.prerelease.length) ? parsed.prerelease : null
2009
- };
2010
- prerelease_1 = prerelease;
2011
- return prerelease_1;
2012
- }
2013
-
2014
- var compare_1;
2015
- var hasRequiredCompare;
2016
-
2017
- function requireCompare () {
2018
- if (hasRequiredCompare) return compare_1;
2019
- hasRequiredCompare = 1;
2020
-
2021
- const SemVer = requireSemver$1();
2022
- const compare = (a, b, loose) =>
2023
- new SemVer(a, loose).compare(new SemVer(b, loose));
2024
-
2025
- compare_1 = compare;
2026
- return compare_1;
2027
- }
2028
-
2029
- var rcompare_1;
2030
- var hasRequiredRcompare;
2031
-
2032
- function requireRcompare () {
2033
- if (hasRequiredRcompare) return rcompare_1;
2034
- hasRequiredRcompare = 1;
2035
-
2036
- const compare = requireCompare();
2037
- const rcompare = (a, b, loose) => compare(b, a, loose);
2038
- rcompare_1 = rcompare;
2039
- return rcompare_1;
2040
- }
2041
-
2042
- var compareLoose_1;
2043
- var hasRequiredCompareLoose;
2044
-
2045
- function requireCompareLoose () {
2046
- if (hasRequiredCompareLoose) return compareLoose_1;
2047
- hasRequiredCompareLoose = 1;
2048
-
2049
- const compare = requireCompare();
2050
- const compareLoose = (a, b) => compare(a, b, true);
2051
- compareLoose_1 = compareLoose;
2052
- return compareLoose_1;
2053
- }
2054
-
2055
- var compareBuild_1;
2056
- var hasRequiredCompareBuild;
2057
-
2058
- function requireCompareBuild () {
2059
- if (hasRequiredCompareBuild) return compareBuild_1;
2060
- hasRequiredCompareBuild = 1;
2061
-
2062
- const SemVer = requireSemver$1();
2063
- const compareBuild = (a, b, loose) => {
2064
- const versionA = new SemVer(a, loose);
2065
- const versionB = new SemVer(b, loose);
2066
- return versionA.compare(versionB) || versionA.compareBuild(versionB)
2067
- };
2068
- compareBuild_1 = compareBuild;
2069
- return compareBuild_1;
2070
- }
2071
-
2072
- var sort_1;
2073
- var hasRequiredSort;
2074
-
2075
- function requireSort () {
2076
- if (hasRequiredSort) return sort_1;
2077
- hasRequiredSort = 1;
2078
-
2079
- const compareBuild = requireCompareBuild();
2080
- const sort = (list, loose) => list.sort((a, b) => compareBuild(a, b, loose));
2081
- sort_1 = sort;
2082
- return sort_1;
2083
- }
2084
-
2085
- var rsort_1;
2086
- var hasRequiredRsort;
2087
-
2088
- function requireRsort () {
2089
- if (hasRequiredRsort) return rsort_1;
2090
- hasRequiredRsort = 1;
2091
-
2092
- const compareBuild = requireCompareBuild();
2093
- const rsort = (list, loose) => list.sort((a, b) => compareBuild(b, a, loose));
2094
- rsort_1 = rsort;
2095
- return rsort_1;
2096
- }
2097
-
2098
- var gt_1;
2099
- var hasRequiredGt;
2100
-
2101
- function requireGt () {
2102
- if (hasRequiredGt) return gt_1;
2103
- hasRequiredGt = 1;
2104
-
2105
- const compare = requireCompare();
2106
- const gt = (a, b, loose) => compare(a, b, loose) > 0;
2107
- gt_1 = gt;
2108
- return gt_1;
2109
- }
2110
-
2111
- var lt_1;
2112
- var hasRequiredLt;
2113
-
2114
- function requireLt () {
2115
- if (hasRequiredLt) return lt_1;
2116
- hasRequiredLt = 1;
2117
-
2118
- const compare = requireCompare();
2119
- const lt = (a, b, loose) => compare(a, b, loose) < 0;
2120
- lt_1 = lt;
2121
- return lt_1;
2122
- }
2123
-
2124
- var eq_1;
2125
- var hasRequiredEq;
2126
-
2127
- function requireEq () {
2128
- if (hasRequiredEq) return eq_1;
2129
- hasRequiredEq = 1;
2130
-
2131
- const compare = requireCompare();
2132
- const eq = (a, b, loose) => compare(a, b, loose) === 0;
2133
- eq_1 = eq;
2134
- return eq_1;
2135
- }
2136
-
2137
- var neq_1;
2138
- var hasRequiredNeq;
2139
-
2140
- function requireNeq () {
2141
- if (hasRequiredNeq) return neq_1;
2142
- hasRequiredNeq = 1;
2143
-
2144
- const compare = requireCompare();
2145
- const neq = (a, b, loose) => compare(a, b, loose) !== 0;
2146
- neq_1 = neq;
2147
- return neq_1;
2148
- }
2149
-
2150
- var gte_1;
2151
- var hasRequiredGte;
2152
-
2153
- function requireGte () {
2154
- if (hasRequiredGte) return gte_1;
2155
- hasRequiredGte = 1;
2156
-
2157
- const compare = requireCompare();
2158
- const gte = (a, b, loose) => compare(a, b, loose) >= 0;
2159
- gte_1 = gte;
2160
- return gte_1;
2161
- }
2162
-
2163
- var lte_1;
2164
- var hasRequiredLte;
2165
-
2166
- function requireLte () {
2167
- if (hasRequiredLte) return lte_1;
2168
- hasRequiredLte = 1;
2169
-
2170
- const compare = requireCompare();
2171
- const lte = (a, b, loose) => compare(a, b, loose) <= 0;
2172
- lte_1 = lte;
2173
- return lte_1;
2174
- }
2175
-
2176
- var cmp_1;
2177
- var hasRequiredCmp;
2178
-
2179
- function requireCmp () {
2180
- if (hasRequiredCmp) return cmp_1;
2181
- hasRequiredCmp = 1;
2182
-
2183
- const eq = requireEq();
2184
- const neq = requireNeq();
2185
- const gt = requireGt();
2186
- const gte = requireGte();
2187
- const lt = requireLt();
2188
- const lte = requireLte();
2189
-
2190
- const cmp = (a, op, b, loose) => {
2191
- switch (op) {
2192
- case '===':
2193
- if (typeof a === 'object') {
2194
- a = a.version;
2195
- }
2196
- if (typeof b === 'object') {
2197
- b = b.version;
2198
- }
2199
- return a === b
2200
-
2201
- case '!==':
2202
- if (typeof a === 'object') {
2203
- a = a.version;
2204
- }
2205
- if (typeof b === 'object') {
2206
- b = b.version;
2207
- }
2208
- return a !== b
2209
-
2210
- case '':
2211
- case '=':
2212
- case '==':
2213
- return eq(a, b, loose)
2214
-
2215
- case '!=':
2216
- return neq(a, b, loose)
2217
-
2218
- case '>':
2219
- return gt(a, b, loose)
2220
-
2221
- case '>=':
2222
- return gte(a, b, loose)
2223
-
2224
- case '<':
2225
- return lt(a, b, loose)
2226
-
2227
- case '<=':
2228
- return lte(a, b, loose)
2229
-
2230
- default:
2231
- throw new TypeError(`Invalid operator: ${op}`)
2232
- }
2233
- };
2234
- cmp_1 = cmp;
2235
- return cmp_1;
2236
- }
2237
-
2238
- var coerce_1;
2239
- var hasRequiredCoerce;
2240
-
2241
- function requireCoerce () {
2242
- if (hasRequiredCoerce) return coerce_1;
2243
- hasRequiredCoerce = 1;
2244
-
2245
- const SemVer = requireSemver$1();
2246
- const parse = requireParse();
2247
- const { safeRe: re, t } = requireRe();
2248
-
2249
- const coerce = (version, options) => {
2250
- if (version instanceof SemVer) {
2251
- return version
2252
- }
2253
-
2254
- if (typeof version === 'number') {
2255
- version = String(version);
2256
- }
2257
-
2258
- if (typeof version !== 'string') {
2259
- return null
2260
- }
2261
-
2262
- options = options || {};
2263
-
2264
- let match = null;
2265
- if (!options.rtl) {
2266
- match = version.match(options.includePrerelease ? re[t.COERCEFULL] : re[t.COERCE]);
2267
- } else {
2268
- // Find the right-most coercible string that does not share
2269
- // a terminus with a more left-ward coercible string.
2270
- // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4'
2271
- // With includePrerelease option set, '1.2.3.4-rc' wants to coerce '2.3.4-rc', not '2.3.4'
2272
- //
2273
- // Walk through the string checking with a /g regexp
2274
- // Manually set the index so as to pick up overlapping matches.
2275
- // Stop when we get a match that ends at the string end, since no
2276
- // coercible string can be more right-ward without the same terminus.
2277
- const coerceRtlRegex = options.includePrerelease ? re[t.COERCERTLFULL] : re[t.COERCERTL];
2278
- let next;
2279
- while ((next = coerceRtlRegex.exec(version)) &&
2280
- (!match || match.index + match[0].length !== version.length)
2281
- ) {
2282
- if (!match ||
2283
- next.index + next[0].length !== match.index + match[0].length) {
2284
- match = next;
2285
- }
2286
- coerceRtlRegex.lastIndex = next.index + next[1].length + next[2].length;
2287
- }
2288
- // leave it in a clean state
2289
- coerceRtlRegex.lastIndex = -1;
2290
- }
2291
-
2292
- if (match === null) {
2293
- return null
2294
- }
2295
-
2296
- const major = match[2];
2297
- const minor = match[3] || '0';
2298
- const patch = match[4] || '0';
2299
- const prerelease = options.includePrerelease && match[5] ? `-${match[5]}` : '';
2300
- const build = options.includePrerelease && match[6] ? `+${match[6]}` : '';
2301
-
2302
- return parse(`${major}.${minor}.${patch}${prerelease}${build}`, options)
2303
- };
2304
- coerce_1 = coerce;
2305
- return coerce_1;
2306
- }
2307
-
2308
- var lrucache;
2309
- var hasRequiredLrucache;
2310
-
2311
- function requireLrucache () {
2312
- if (hasRequiredLrucache) return lrucache;
2313
- hasRequiredLrucache = 1;
2314
-
2315
- class LRUCache {
2316
- constructor () {
2317
- this.max = 1000;
2318
- this.map = new Map();
2319
- }
2320
-
2321
- get (key) {
2322
- const value = this.map.get(key);
2323
- if (value === undefined) {
2324
- return undefined
2325
- } else {
2326
- // Remove the key from the map and add it to the end
2327
- this.map.delete(key);
2328
- this.map.set(key, value);
2329
- return value
2330
- }
2331
- }
2332
-
2333
- delete (key) {
2334
- return this.map.delete(key)
2335
- }
2336
-
2337
- set (key, value) {
2338
- const deleted = this.delete(key);
2339
-
2340
- if (!deleted && value !== undefined) {
2341
- // If cache is full, delete the least recently used item
2342
- if (this.map.size >= this.max) {
2343
- const firstKey = this.map.keys().next().value;
2344
- this.delete(firstKey);
2345
- }
2346
-
2347
- this.map.set(key, value);
2348
- }
2349
-
2350
- return this
2351
- }
2352
- }
2353
-
2354
- lrucache = LRUCache;
2355
- return lrucache;
2356
- }
2357
-
2358
- var range;
2359
- var hasRequiredRange;
2360
-
2361
- function requireRange () {
2362
- if (hasRequiredRange) return range;
2363
- hasRequiredRange = 1;
2364
-
2365
- const SPACE_CHARACTERS = /\s+/g;
2366
-
2367
- // hoisted class for cyclic dependency
2368
- class Range {
2369
- constructor (range, options) {
2370
- options = parseOptions(options);
2371
-
2372
- if (range instanceof Range) {
2373
- if (
2374
- range.loose === !!options.loose &&
2375
- range.includePrerelease === !!options.includePrerelease
2376
- ) {
2377
- return range
2378
- } else {
2379
- return new Range(range.raw, options)
2380
- }
2381
- }
2382
-
2383
- if (range instanceof Comparator) {
2384
- // just put it in the set and return
2385
- this.raw = range.value;
2386
- this.set = [[range]];
2387
- this.formatted = undefined;
2388
- return this
2389
- }
2390
-
2391
- this.options = options;
2392
- this.loose = !!options.loose;
2393
- this.includePrerelease = !!options.includePrerelease;
2394
-
2395
- // First reduce all whitespace as much as possible so we do not have to rely
2396
- // on potentially slow regexes like \s*. This is then stored and used for
2397
- // future error messages as well.
2398
- this.raw = range.trim().replace(SPACE_CHARACTERS, ' ');
2399
-
2400
- // First, split on ||
2401
- this.set = this.raw
2402
- .split('||')
2403
- // map the range to a 2d array of comparators
2404
- .map(r => this.parseRange(r.trim()))
2405
- // throw out any comparator lists that are empty
2406
- // this generally means that it was not a valid range, which is allowed
2407
- // in loose mode, but will still throw if the WHOLE range is invalid.
2408
- .filter(c => c.length);
2409
-
2410
- if (!this.set.length) {
2411
- throw new TypeError(`Invalid SemVer Range: ${this.raw}`)
2412
- }
2413
-
2414
- // if we have any that are not the null set, throw out null sets.
2415
- if (this.set.length > 1) {
2416
- // keep the first one, in case they're all null sets
2417
- const first = this.set[0];
2418
- this.set = this.set.filter(c => !isNullSet(c[0]));
2419
- if (this.set.length === 0) {
2420
- this.set = [first];
2421
- } else if (this.set.length > 1) {
2422
- // if we have any that are *, then the range is just *
2423
- for (const c of this.set) {
2424
- if (c.length === 1 && isAny(c[0])) {
2425
- this.set = [c];
2426
- break
2427
- }
2428
- }
2429
- }
2430
- }
2431
-
2432
- this.formatted = undefined;
2433
- }
2434
-
2435
- get range () {
2436
- if (this.formatted === undefined) {
2437
- this.formatted = '';
2438
- for (let i = 0; i < this.set.length; i++) {
2439
- if (i > 0) {
2440
- this.formatted += '||';
2441
- }
2442
- const comps = this.set[i];
2443
- for (let k = 0; k < comps.length; k++) {
2444
- if (k > 0) {
2445
- this.formatted += ' ';
2446
- }
2447
- this.formatted += comps[k].toString().trim();
2448
- }
2449
- }
2450
- }
2451
- return this.formatted
2452
- }
2453
-
2454
- format () {
2455
- return this.range
2456
- }
2457
-
2458
- toString () {
2459
- return this.range
2460
- }
2461
-
2462
- parseRange (range) {
2463
- // memoize range parsing for performance.
2464
- // this is a very hot path, and fully deterministic.
2465
- const memoOpts =
2466
- (this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) |
2467
- (this.options.loose && FLAG_LOOSE);
2468
- const memoKey = memoOpts + ':' + range;
2469
- const cached = cache.get(memoKey);
2470
- if (cached) {
2471
- return cached
2472
- }
2473
-
2474
- const loose = this.options.loose;
2475
- // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`
2476
- const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE];
2477
- range = range.replace(hr, hyphenReplace(this.options.includePrerelease));
2478
- debug('hyphen replace', range);
2479
-
2480
- // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`
2481
- range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace);
2482
- debug('comparator trim', range);
2483
-
2484
- // `~ 1.2.3` => `~1.2.3`
2485
- range = range.replace(re[t.TILDETRIM], tildeTrimReplace);
2486
- debug('tilde trim', range);
2487
-
2488
- // `^ 1.2.3` => `^1.2.3`
2489
- range = range.replace(re[t.CARETTRIM], caretTrimReplace);
2490
- debug('caret trim', range);
2491
-
2492
- // At this point, the range is completely trimmed and
2493
- // ready to be split into comparators.
2494
-
2495
- let rangeList = range
2496
- .split(' ')
2497
- .map(comp => parseComparator(comp, this.options))
2498
- .join(' ')
2499
- .split(/\s+/)
2500
- // >=0.0.0 is equivalent to *
2501
- .map(comp => replaceGTE0(comp, this.options));
2502
-
2503
- if (loose) {
2504
- // in loose mode, throw out any that are not valid comparators
2505
- rangeList = rangeList.filter(comp => {
2506
- debug('loose invalid filter', comp, this.options);
2507
- return !!comp.match(re[t.COMPARATORLOOSE])
2508
- });
2509
- }
2510
- debug('range list', rangeList);
2511
-
2512
- // if any comparators are the null set, then replace with JUST null set
2513
- // if more than one comparator, remove any * comparators
2514
- // also, don't include the same comparator more than once
2515
- const rangeMap = new Map();
2516
- const comparators = rangeList.map(comp => new Comparator(comp, this.options));
2517
- for (const comp of comparators) {
2518
- if (isNullSet(comp)) {
2519
- return [comp]
2520
- }
2521
- rangeMap.set(comp.value, comp);
2522
- }
2523
- if (rangeMap.size > 1 && rangeMap.has('')) {
2524
- rangeMap.delete('');
2525
- }
2526
-
2527
- const result = [...rangeMap.values()];
2528
- cache.set(memoKey, result);
2529
- return result
2530
- }
2531
-
2532
- intersects (range, options) {
2533
- if (!(range instanceof Range)) {
2534
- throw new TypeError('a Range is required')
2535
- }
2536
-
2537
- return this.set.some((thisComparators) => {
2538
- return (
2539
- isSatisfiable(thisComparators, options) &&
2540
- range.set.some((rangeComparators) => {
2541
- return (
2542
- isSatisfiable(rangeComparators, options) &&
2543
- thisComparators.every((thisComparator) => {
2544
- return rangeComparators.every((rangeComparator) => {
2545
- return thisComparator.intersects(rangeComparator, options)
2546
- })
2547
- })
2548
- )
2549
- })
2550
- )
2551
- })
2552
- }
2553
-
2554
- // if ANY of the sets match ALL of its comparators, then pass
2555
- test (version) {
2556
- if (!version) {
2557
- return false
2558
- }
2559
-
2560
- if (typeof version === 'string') {
2561
- try {
2562
- version = new SemVer(version, this.options);
2563
- } catch (er) {
2564
- return false
2565
- }
2566
- }
2567
-
2568
- for (let i = 0; i < this.set.length; i++) {
2569
- if (testSet(this.set[i], version, this.options)) {
2570
- return true
2571
- }
2572
- }
2573
- return false
2574
- }
2575
- }
2576
-
2577
- range = Range;
2578
-
2579
- const LRU = requireLrucache();
2580
- const cache = new LRU();
2581
-
2582
- const parseOptions = requireParseOptions();
2583
- const Comparator = requireComparator();
2584
- const debug = requireDebug();
2585
- const SemVer = requireSemver$1();
2586
- const {
2587
- safeRe: re,
2588
- t,
2589
- comparatorTrimReplace,
2590
- tildeTrimReplace,
2591
- caretTrimReplace,
2592
- } = requireRe();
2593
- const { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = requireConstants();
2594
-
2595
- const isNullSet = c => c.value === '<0.0.0-0';
2596
- const isAny = c => c.value === '';
2597
-
2598
- // take a set of comparators and determine whether there
2599
- // exists a version which can satisfy it
2600
- const isSatisfiable = (comparators, options) => {
2601
- let result = true;
2602
- const remainingComparators = comparators.slice();
2603
- let testComparator = remainingComparators.pop();
2604
-
2605
- while (result && remainingComparators.length) {
2606
- result = remainingComparators.every((otherComparator) => {
2607
- return testComparator.intersects(otherComparator, options)
2608
- });
2609
-
2610
- testComparator = remainingComparators.pop();
2611
- }
2612
-
2613
- return result
2614
- };
2615
-
2616
- // comprised of xranges, tildes, stars, and gtlt's at this point.
2617
- // already replaced the hyphen ranges
2618
- // turn into a set of JUST comparators.
2619
- const parseComparator = (comp, options) => {
2620
- comp = comp.replace(re[t.BUILD], '');
2621
- debug('comp', comp, options);
2622
- comp = replaceCarets(comp, options);
2623
- debug('caret', comp);
2624
- comp = replaceTildes(comp, options);
2625
- debug('tildes', comp);
2626
- comp = replaceXRanges(comp, options);
2627
- debug('xrange', comp);
2628
- comp = replaceStars(comp, options);
2629
- debug('stars', comp);
2630
- return comp
2631
- };
2632
-
2633
- const isX = id => !id || id.toLowerCase() === 'x' || id === '*';
2634
-
2635
- // ~, ~> --> * (any, kinda silly)
2636
- // ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0-0
2637
- // ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0-0
2638
- // ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0-0
2639
- // ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0-0
2640
- // ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0-0
2641
- // ~0.0.1 --> >=0.0.1 <0.1.0-0
2642
- const replaceTildes = (comp, options) => {
2643
- return comp
2644
- .trim()
2645
- .split(/\s+/)
2646
- .map((c) => replaceTilde(c, options))
2647
- .join(' ')
2648
- };
2649
-
2650
- const replaceTilde = (comp, options) => {
2651
- const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE];
2652
- return comp.replace(r, (_, M, m, p, pr) => {
2653
- debug('tilde', comp, _, M, m, p, pr);
2654
- let ret;
2655
-
2656
- if (isX(M)) {
2657
- ret = '';
2658
- } else if (isX(m)) {
2659
- ret = `>=${M}.0.0 <${+M + 1}.0.0-0`;
2660
- } else if (isX(p)) {
2661
- // ~1.2 == >=1.2.0 <1.3.0-0
2662
- ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0`;
2663
- } else if (pr) {
2664
- debug('replaceTilde pr', pr);
2665
- ret = `>=${M}.${m}.${p}-${pr
2666
- } <${M}.${+m + 1}.0-0`;
2667
- } else {
2668
- // ~1.2.3 == >=1.2.3 <1.3.0-0
2669
- ret = `>=${M}.${m}.${p
2670
- } <${M}.${+m + 1}.0-0`;
2671
- }
2672
-
2673
- debug('tilde return', ret);
2674
- return ret
2675
- })
2676
- };
2677
-
2678
- // ^ --> * (any, kinda silly)
2679
- // ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0-0
2680
- // ^2.0, ^2.0.x --> >=2.0.0 <3.0.0-0
2681
- // ^1.2, ^1.2.x --> >=1.2.0 <2.0.0-0
2682
- // ^1.2.3 --> >=1.2.3 <2.0.0-0
2683
- // ^1.2.0 --> >=1.2.0 <2.0.0-0
2684
- // ^0.0.1 --> >=0.0.1 <0.0.2-0
2685
- // ^0.1.0 --> >=0.1.0 <0.2.0-0
2686
- const replaceCarets = (comp, options) => {
2687
- return comp
2688
- .trim()
2689
- .split(/\s+/)
2690
- .map((c) => replaceCaret(c, options))
2691
- .join(' ')
2692
- };
2693
-
2694
- const replaceCaret = (comp, options) => {
2695
- debug('caret', comp, options);
2696
- const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET];
2697
- const z = options.includePrerelease ? '-0' : '';
2698
- return comp.replace(r, (_, M, m, p, pr) => {
2699
- debug('caret', comp, _, M, m, p, pr);
2700
- let ret;
2701
-
2702
- if (isX(M)) {
2703
- ret = '';
2704
- } else if (isX(m)) {
2705
- ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0`;
2706
- } else if (isX(p)) {
2707
- if (M === '0') {
2708
- ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0`;
2709
- } else {
2710
- ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0`;
2711
- }
2712
- } else if (pr) {
2713
- debug('replaceCaret pr', pr);
2714
- if (M === '0') {
2715
- if (m === '0') {
2716
- ret = `>=${M}.${m}.${p}-${pr
2717
- } <${M}.${m}.${+p + 1}-0`;
2718
- } else {
2719
- ret = `>=${M}.${m}.${p}-${pr
2720
- } <${M}.${+m + 1}.0-0`;
2721
- }
2722
- } else {
2723
- ret = `>=${M}.${m}.${p}-${pr
2724
- } <${+M + 1}.0.0-0`;
2725
- }
2726
- } else {
2727
- debug('no pr');
2728
- if (M === '0') {
2729
- if (m === '0') {
2730
- ret = `>=${M}.${m}.${p
2731
- }${z} <${M}.${m}.${+p + 1}-0`;
2732
- } else {
2733
- ret = `>=${M}.${m}.${p
2734
- }${z} <${M}.${+m + 1}.0-0`;
2735
- }
2736
- } else {
2737
- ret = `>=${M}.${m}.${p
2738
- } <${+M + 1}.0.0-0`;
2739
- }
2740
- }
2741
-
2742
- debug('caret return', ret);
2743
- return ret
2744
- })
2745
- };
2746
-
2747
- const replaceXRanges = (comp, options) => {
2748
- debug('replaceXRanges', comp, options);
2749
- return comp
2750
- .split(/\s+/)
2751
- .map((c) => replaceXRange(c, options))
2752
- .join(' ')
2753
- };
2754
-
2755
- const replaceXRange = (comp, options) => {
2756
- comp = comp.trim();
2757
- const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE];
2758
- return comp.replace(r, (ret, gtlt, M, m, p, pr) => {
2759
- debug('xRange', comp, ret, gtlt, M, m, p, pr);
2760
- const xM = isX(M);
2761
- const xm = xM || isX(m);
2762
- const xp = xm || isX(p);
2763
- const anyX = xp;
2764
-
2765
- if (gtlt === '=' && anyX) {
2766
- gtlt = '';
2767
- }
2768
-
2769
- // if we're including prereleases in the match, then we need
2770
- // to fix this to -0, the lowest possible prerelease value
2771
- pr = options.includePrerelease ? '-0' : '';
2772
-
2773
- if (xM) {
2774
- if (gtlt === '>' || gtlt === '<') {
2775
- // nothing is allowed
2776
- ret = '<0.0.0-0';
2777
- } else {
2778
- // nothing is forbidden
2779
- ret = '*';
2780
- }
2781
- } else if (gtlt && anyX) {
2782
- // we know patch is an x, because we have any x at all.
2783
- // replace X with 0
2784
- if (xm) {
2785
- m = 0;
2786
- }
2787
- p = 0;
2788
-
2789
- if (gtlt === '>') {
2790
- // >1 => >=2.0.0
2791
- // >1.2 => >=1.3.0
2792
- gtlt = '>=';
2793
- if (xm) {
2794
- M = +M + 1;
2795
- m = 0;
2796
- p = 0;
2797
- } else {
2798
- m = +m + 1;
2799
- p = 0;
2800
- }
2801
- } else if (gtlt === '<=') {
2802
- // <=0.7.x is actually <0.8.0, since any 0.7.x should
2803
- // pass. Similarly, <=7.x is actually <8.0.0, etc.
2804
- gtlt = '<';
2805
- if (xm) {
2806
- M = +M + 1;
2807
- } else {
2808
- m = +m + 1;
2809
- }
2810
- }
2811
-
2812
- if (gtlt === '<') {
2813
- pr = '-0';
2814
- }
2815
-
2816
- ret = `${gtlt + M}.${m}.${p}${pr}`;
2817
- } else if (xm) {
2818
- ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0`;
2819
- } else if (xp) {
2820
- ret = `>=${M}.${m}.0${pr
2821
- } <${M}.${+m + 1}.0-0`;
2822
- }
2823
-
2824
- debug('xRange return', ret);
2825
-
2826
- return ret
2827
- })
2828
- };
2829
-
2830
- // Because * is AND-ed with everything else in the comparator,
2831
- // and '' means "any version", just remove the *s entirely.
2832
- const replaceStars = (comp, options) => {
2833
- debug('replaceStars', comp, options);
2834
- // Looseness is ignored here. star is always as loose as it gets!
2835
- return comp
2836
- .trim()
2837
- .replace(re[t.STAR], '')
2838
- };
2839
-
2840
- const replaceGTE0 = (comp, options) => {
2841
- debug('replaceGTE0', comp, options);
2842
- return comp
2843
- .trim()
2844
- .replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], '')
2845
- };
2846
-
2847
- // This function is passed to string.replace(re[t.HYPHENRANGE])
2848
- // M, m, patch, prerelease, build
2849
- // 1.2 - 3.4.5 => >=1.2.0 <=3.4.5
2850
- // 1.2.3 - 3.4 => >=1.2.0 <3.5.0-0 Any 3.4.x will do
2851
- // 1.2 - 3.4 => >=1.2.0 <3.5.0-0
2852
- // TODO build?
2853
- const hyphenReplace = incPr => ($0,
2854
- from, fM, fm, fp, fpr, fb,
2855
- to, tM, tm, tp, tpr) => {
2856
- if (isX(fM)) {
2857
- from = '';
2858
- } else if (isX(fm)) {
2859
- from = `>=${fM}.0.0${incPr ? '-0' : ''}`;
2860
- } else if (isX(fp)) {
2861
- from = `>=${fM}.${fm}.0${incPr ? '-0' : ''}`;
2862
- } else if (fpr) {
2863
- from = `>=${from}`;
2864
- } else {
2865
- from = `>=${from}${incPr ? '-0' : ''}`;
2866
- }
2867
-
2868
- if (isX(tM)) {
2869
- to = '';
2870
- } else if (isX(tm)) {
2871
- to = `<${+tM + 1}.0.0-0`;
2872
- } else if (isX(tp)) {
2873
- to = `<${tM}.${+tm + 1}.0-0`;
2874
- } else if (tpr) {
2875
- to = `<=${tM}.${tm}.${tp}-${tpr}`;
2876
- } else if (incPr) {
2877
- to = `<${tM}.${tm}.${+tp + 1}-0`;
2878
- } else {
2879
- to = `<=${to}`;
2880
- }
2881
-
2882
- return `${from} ${to}`.trim()
2883
- };
2884
-
2885
- const testSet = (set, version, options) => {
2886
- for (let i = 0; i < set.length; i++) {
2887
- if (!set[i].test(version)) {
2888
- return false
2889
- }
2890
- }
2891
-
2892
- if (version.prerelease.length && !options.includePrerelease) {
2893
- // Find the set of versions that are allowed to have prereleases
2894
- // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0
2895
- // That should allow `1.2.3-pr.2` to pass.
2896
- // However, `1.2.4-alpha.notready` should NOT be allowed,
2897
- // even though it's within the range set by the comparators.
2898
- for (let i = 0; i < set.length; i++) {
2899
- debug(set[i].semver);
2900
- if (set[i].semver === Comparator.ANY) {
2901
- continue
2902
- }
2903
-
2904
- if (set[i].semver.prerelease.length > 0) {
2905
- const allowed = set[i].semver;
2906
- if (allowed.major === version.major &&
2907
- allowed.minor === version.minor &&
2908
- allowed.patch === version.patch) {
2909
- return true
2910
- }
2911
- }
2912
- }
2913
-
2914
- // Version has a -pre, but it's not one of the ones we like.
2915
- return false
2916
- }
2917
-
2918
- return true
2919
- };
2920
- return range;
2921
- }
2922
-
2923
- var comparator;
2924
- var hasRequiredComparator;
2925
-
2926
- function requireComparator () {
2927
- if (hasRequiredComparator) return comparator;
2928
- hasRequiredComparator = 1;
2929
-
2930
- const ANY = Symbol('SemVer ANY');
2931
- // hoisted class for cyclic dependency
2932
- class Comparator {
2933
- static get ANY () {
2934
- return ANY
2935
- }
2936
-
2937
- constructor (comp, options) {
2938
- options = parseOptions(options);
2939
-
2940
- if (comp instanceof Comparator) {
2941
- if (comp.loose === !!options.loose) {
2942
- return comp
2943
- } else {
2944
- comp = comp.value;
2945
- }
2946
- }
2947
-
2948
- comp = comp.trim().split(/\s+/).join(' ');
2949
- debug('comparator', comp, options);
2950
- this.options = options;
2951
- this.loose = !!options.loose;
2952
- this.parse(comp);
2953
-
2954
- if (this.semver === ANY) {
2955
- this.value = '';
2956
- } else {
2957
- this.value = this.operator + this.semver.version;
2958
- }
2959
-
2960
- debug('comp', this);
2961
- }
2962
-
2963
- parse (comp) {
2964
- const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR];
2965
- const m = comp.match(r);
2966
-
2967
- if (!m) {
2968
- throw new TypeError(`Invalid comparator: ${comp}`)
2969
- }
2970
-
2971
- this.operator = m[1] !== undefined ? m[1] : '';
2972
- if (this.operator === '=') {
2973
- this.operator = '';
2974
- }
2975
-
2976
- // if it literally is just '>' or '' then allow anything.
2977
- if (!m[2]) {
2978
- this.semver = ANY;
2979
- } else {
2980
- this.semver = new SemVer(m[2], this.options.loose);
2981
- }
2982
- }
2983
-
2984
- toString () {
2985
- return this.value
2986
- }
2987
-
2988
- test (version) {
2989
- debug('Comparator.test', version, this.options.loose);
2990
-
2991
- if (this.semver === ANY || version === ANY) {
2992
- return true
2993
- }
2994
-
2995
- if (typeof version === 'string') {
2996
- try {
2997
- version = new SemVer(version, this.options);
2998
- } catch (er) {
2999
- return false
3000
- }
3001
- }
3002
-
3003
- return cmp(version, this.operator, this.semver, this.options)
3004
- }
3005
-
3006
- intersects (comp, options) {
3007
- if (!(comp instanceof Comparator)) {
3008
- throw new TypeError('a Comparator is required')
3009
- }
3010
-
3011
- if (this.operator === '') {
3012
- if (this.value === '') {
3013
- return true
3014
- }
3015
- return new Range(comp.value, options).test(this.value)
3016
- } else if (comp.operator === '') {
3017
- if (comp.value === '') {
3018
- return true
3019
- }
3020
- return new Range(this.value, options).test(comp.semver)
3021
- }
3022
-
3023
- options = parseOptions(options);
3024
-
3025
- // Special cases where nothing can possibly be lower
3026
- if (options.includePrerelease &&
3027
- (this.value === '<0.0.0-0' || comp.value === '<0.0.0-0')) {
3028
- return false
3029
- }
3030
- if (!options.includePrerelease &&
3031
- (this.value.startsWith('<0.0.0') || comp.value.startsWith('<0.0.0'))) {
3032
- return false
3033
- }
3034
-
3035
- // Same direction increasing (> or >=)
3036
- if (this.operator.startsWith('>') && comp.operator.startsWith('>')) {
3037
- return true
3038
- }
3039
- // Same direction decreasing (< or <=)
3040
- if (this.operator.startsWith('<') && comp.operator.startsWith('<')) {
3041
- return true
3042
- }
3043
- // same SemVer and both sides are inclusive (<= or >=)
3044
- if (
3045
- (this.semver.version === comp.semver.version) &&
3046
- this.operator.includes('=') && comp.operator.includes('=')) {
3047
- return true
3048
- }
3049
- // opposite directions less than
3050
- if (cmp(this.semver, '<', comp.semver, options) &&
3051
- this.operator.startsWith('>') && comp.operator.startsWith('<')) {
3052
- return true
3053
- }
3054
- // opposite directions greater than
3055
- if (cmp(this.semver, '>', comp.semver, options) &&
3056
- this.operator.startsWith('<') && comp.operator.startsWith('>')) {
3057
- return true
3058
- }
3059
- return false
3060
- }
3061
- }
3062
-
3063
- comparator = Comparator;
3064
-
3065
- const parseOptions = requireParseOptions();
3066
- const { safeRe: re, t } = requireRe();
3067
- const cmp = requireCmp();
3068
- const debug = requireDebug();
3069
- const SemVer = requireSemver$1();
3070
- const Range = requireRange();
3071
- return comparator;
3072
- }
3073
-
3074
- var satisfies_1;
3075
- var hasRequiredSatisfies;
3076
-
3077
- function requireSatisfies () {
3078
- if (hasRequiredSatisfies) return satisfies_1;
3079
- hasRequiredSatisfies = 1;
3080
-
3081
- const Range = requireRange();
3082
- const satisfies = (version, range, options) => {
3083
- try {
3084
- range = new Range(range, options);
3085
- } catch (er) {
3086
- return false
3087
- }
3088
- return range.test(version)
3089
- };
3090
- satisfies_1 = satisfies;
3091
- return satisfies_1;
3092
- }
3093
-
3094
- var toComparators_1;
3095
- var hasRequiredToComparators;
3096
-
3097
- function requireToComparators () {
3098
- if (hasRequiredToComparators) return toComparators_1;
3099
- hasRequiredToComparators = 1;
3100
-
3101
- const Range = requireRange();
3102
-
3103
- // Mostly just for testing and legacy API reasons
3104
- const toComparators = (range, options) =>
3105
- new Range(range, options).set
3106
- .map(comp => comp.map(c => c.value).join(' ').trim().split(' '));
3107
-
3108
- toComparators_1 = toComparators;
3109
- return toComparators_1;
3110
- }
3111
-
3112
- var maxSatisfying_1;
3113
- var hasRequiredMaxSatisfying;
3114
-
3115
- function requireMaxSatisfying () {
3116
- if (hasRequiredMaxSatisfying) return maxSatisfying_1;
3117
- hasRequiredMaxSatisfying = 1;
3118
-
3119
- const SemVer = requireSemver$1();
3120
- const Range = requireRange();
3121
-
3122
- const maxSatisfying = (versions, range, options) => {
3123
- let max = null;
3124
- let maxSV = null;
3125
- let rangeObj = null;
3126
- try {
3127
- rangeObj = new Range(range, options);
3128
- } catch (er) {
3129
- return null
3130
- }
3131
- versions.forEach((v) => {
3132
- if (rangeObj.test(v)) {
3133
- // satisfies(v, range, options)
3134
- if (!max || maxSV.compare(v) === -1) {
3135
- // compare(max, v, true)
3136
- max = v;
3137
- maxSV = new SemVer(max, options);
3138
- }
3139
- }
3140
- });
3141
- return max
3142
- };
3143
- maxSatisfying_1 = maxSatisfying;
3144
- return maxSatisfying_1;
3145
- }
3146
-
3147
- var minSatisfying_1;
3148
- var hasRequiredMinSatisfying;
3149
-
3150
- function requireMinSatisfying () {
3151
- if (hasRequiredMinSatisfying) return minSatisfying_1;
3152
- hasRequiredMinSatisfying = 1;
3153
-
3154
- const SemVer = requireSemver$1();
3155
- const Range = requireRange();
3156
- const minSatisfying = (versions, range, options) => {
3157
- let min = null;
3158
- let minSV = null;
3159
- let rangeObj = null;
3160
- try {
3161
- rangeObj = new Range(range, options);
3162
- } catch (er) {
3163
- return null
3164
- }
3165
- versions.forEach((v) => {
3166
- if (rangeObj.test(v)) {
3167
- // satisfies(v, range, options)
3168
- if (!min || minSV.compare(v) === 1) {
3169
- // compare(min, v, true)
3170
- min = v;
3171
- minSV = new SemVer(min, options);
3172
- }
3173
- }
3174
- });
3175
- return min
3176
- };
3177
- minSatisfying_1 = minSatisfying;
3178
- return minSatisfying_1;
3179
- }
3180
-
3181
- var minVersion_1;
3182
- var hasRequiredMinVersion;
3183
-
3184
- function requireMinVersion () {
3185
- if (hasRequiredMinVersion) return minVersion_1;
3186
- hasRequiredMinVersion = 1;
3187
-
3188
- const SemVer = requireSemver$1();
3189
- const Range = requireRange();
3190
- const gt = requireGt();
3191
-
3192
- const minVersion = (range, loose) => {
3193
- range = new Range(range, loose);
3194
-
3195
- let minver = new SemVer('0.0.0');
3196
- if (range.test(minver)) {
3197
- return minver
3198
- }
3199
-
3200
- minver = new SemVer('0.0.0-0');
3201
- if (range.test(minver)) {
3202
- return minver
3203
- }
3204
-
3205
- minver = null;
3206
- for (let i = 0; i < range.set.length; ++i) {
3207
- const comparators = range.set[i];
3208
-
3209
- let setMin = null;
3210
- comparators.forEach((comparator) => {
3211
- // Clone to avoid manipulating the comparator's semver object.
3212
- const compver = new SemVer(comparator.semver.version);
3213
- switch (comparator.operator) {
3214
- case '>':
3215
- if (compver.prerelease.length === 0) {
3216
- compver.patch++;
3217
- } else {
3218
- compver.prerelease.push(0);
3219
- }
3220
- compver.raw = compver.format();
3221
- /* fallthrough */
3222
- case '':
3223
- case '>=':
3224
- if (!setMin || gt(compver, setMin)) {
3225
- setMin = compver;
3226
- }
3227
- break
3228
- case '<':
3229
- case '<=':
3230
- /* Ignore maximum versions */
3231
- break
3232
- /* istanbul ignore next */
3233
- default:
3234
- throw new Error(`Unexpected operation: ${comparator.operator}`)
3235
- }
3236
- });
3237
- if (setMin && (!minver || gt(minver, setMin))) {
3238
- minver = setMin;
3239
- }
3240
- }
3241
-
3242
- if (minver && range.test(minver)) {
3243
- return minver
3244
- }
3245
-
3246
- return null
3247
- };
3248
- minVersion_1 = minVersion;
3249
- return minVersion_1;
3250
- }
3251
-
3252
- var valid;
3253
- var hasRequiredValid;
3254
-
3255
- function requireValid () {
3256
- if (hasRequiredValid) return valid;
3257
- hasRequiredValid = 1;
3258
-
3259
- const Range = requireRange();
3260
- const validRange = (range, options) => {
3261
- try {
3262
- // Return '*' instead of '' so that truthiness works.
3263
- // This will throw if it's invalid anyway
3264
- return new Range(range, options).range || '*'
3265
- } catch (er) {
3266
- return null
3267
- }
3268
- };
3269
- valid = validRange;
3270
- return valid;
3271
- }
3272
-
3273
- var outside_1;
3274
- var hasRequiredOutside;
3275
-
3276
- function requireOutside () {
3277
- if (hasRequiredOutside) return outside_1;
3278
- hasRequiredOutside = 1;
3279
-
3280
- const SemVer = requireSemver$1();
3281
- const Comparator = requireComparator();
3282
- const { ANY } = Comparator;
3283
- const Range = requireRange();
3284
- const satisfies = requireSatisfies();
3285
- const gt = requireGt();
3286
- const lt = requireLt();
3287
- const lte = requireLte();
3288
- const gte = requireGte();
3289
-
3290
- const outside = (version, range, hilo, options) => {
3291
- version = new SemVer(version, options);
3292
- range = new Range(range, options);
3293
-
3294
- let gtfn, ltefn, ltfn, comp, ecomp;
3295
- switch (hilo) {
3296
- case '>':
3297
- gtfn = gt;
3298
- ltefn = lte;
3299
- ltfn = lt;
3300
- comp = '>';
3301
- ecomp = '>=';
3302
- break
3303
- case '<':
3304
- gtfn = lt;
3305
- ltefn = gte;
3306
- ltfn = gt;
3307
- comp = '<';
3308
- ecomp = '<=';
3309
- break
3310
- default:
3311
- throw new TypeError('Must provide a hilo val of "<" or ">"')
3312
- }
3313
-
3314
- // If it satisfies the range it is not outside
3315
- if (satisfies(version, range, options)) {
3316
- return false
3317
- }
3318
-
3319
- // From now on, variable terms are as if we're in "gtr" mode.
3320
- // but note that everything is flipped for the "ltr" function.
3321
-
3322
- for (let i = 0; i < range.set.length; ++i) {
3323
- const comparators = range.set[i];
3324
-
3325
- let high = null;
3326
- let low = null;
3327
-
3328
- comparators.forEach((comparator) => {
3329
- if (comparator.semver === ANY) {
3330
- comparator = new Comparator('>=0.0.0');
3331
- }
3332
- high = high || comparator;
3333
- low = low || comparator;
3334
- if (gtfn(comparator.semver, high.semver, options)) {
3335
- high = comparator;
3336
- } else if (ltfn(comparator.semver, low.semver, options)) {
3337
- low = comparator;
3338
- }
3339
- });
3340
-
3341
- // If the edge version comparator has a operator then our version
3342
- // isn't outside it
3343
- if (high.operator === comp || high.operator === ecomp) {
3344
- return false
3345
- }
3346
-
3347
- // If the lowest version comparator has an operator and our version
3348
- // is less than it then it isn't higher than the range
3349
- if ((!low.operator || low.operator === comp) &&
3350
- ltefn(version, low.semver)) {
3351
- return false
3352
- } else if (low.operator === ecomp && ltfn(version, low.semver)) {
3353
- return false
3354
- }
3355
- }
3356
- return true
3357
- };
3358
-
3359
- outside_1 = outside;
3360
- return outside_1;
3361
- }
3362
-
3363
- var gtr_1;
3364
- var hasRequiredGtr;
3365
-
3366
- function requireGtr () {
3367
- if (hasRequiredGtr) return gtr_1;
3368
- hasRequiredGtr = 1;
3369
-
3370
- // Determine if version is greater than all the versions possible in the range.
3371
- const outside = requireOutside();
3372
- const gtr = (version, range, options) => outside(version, range, '>', options);
3373
- gtr_1 = gtr;
3374
- return gtr_1;
3375
- }
3376
-
3377
- var ltr_1;
3378
- var hasRequiredLtr;
3379
-
3380
- function requireLtr () {
3381
- if (hasRequiredLtr) return ltr_1;
3382
- hasRequiredLtr = 1;
3383
-
3384
- const outside = requireOutside();
3385
- // Determine if version is less than all the versions possible in the range
3386
- const ltr = (version, range, options) => outside(version, range, '<', options);
3387
- ltr_1 = ltr;
3388
- return ltr_1;
3389
- }
3390
-
3391
- var intersects_1;
3392
- var hasRequiredIntersects;
3393
-
3394
- function requireIntersects () {
3395
- if (hasRequiredIntersects) return intersects_1;
3396
- hasRequiredIntersects = 1;
3397
-
3398
- const Range = requireRange();
3399
- const intersects = (r1, r2, options) => {
3400
- r1 = new Range(r1, options);
3401
- r2 = new Range(r2, options);
3402
- return r1.intersects(r2, options)
3403
- };
3404
- intersects_1 = intersects;
3405
- return intersects_1;
3406
- }
3407
-
3408
- var simplify;
3409
- var hasRequiredSimplify;
3410
-
3411
- function requireSimplify () {
3412
- if (hasRequiredSimplify) return simplify;
3413
- hasRequiredSimplify = 1;
3414
-
3415
- // given a set of versions and a range, create a "simplified" range
3416
- // that includes the same versions that the original range does
3417
- // If the original range is shorter than the simplified one, return that.
3418
- const satisfies = requireSatisfies();
3419
- const compare = requireCompare();
3420
- simplify = (versions, range, options) => {
3421
- const set = [];
3422
- let first = null;
3423
- let prev = null;
3424
- const v = versions.sort((a, b) => compare(a, b, options));
3425
- for (const version of v) {
3426
- const included = satisfies(version, range, options);
3427
- if (included) {
3428
- prev = version;
3429
- if (!first) {
3430
- first = version;
3431
- }
3432
- } else {
3433
- if (prev) {
3434
- set.push([first, prev]);
3435
- }
3436
- prev = null;
3437
- first = null;
3438
- }
3439
- }
3440
- if (first) {
3441
- set.push([first, null]);
3442
- }
3443
-
3444
- const ranges = [];
3445
- for (const [min, max] of set) {
3446
- if (min === max) {
3447
- ranges.push(min);
3448
- } else if (!max && min === v[0]) {
3449
- ranges.push('*');
3450
- } else if (!max) {
3451
- ranges.push(`>=${min}`);
3452
- } else if (min === v[0]) {
3453
- ranges.push(`<=${max}`);
3454
- } else {
3455
- ranges.push(`${min} - ${max}`);
3456
- }
3457
- }
3458
- const simplified = ranges.join(' || ');
3459
- const original = typeof range.raw === 'string' ? range.raw : String(range);
3460
- return simplified.length < original.length ? simplified : range
3461
- };
3462
- return simplify;
3463
- }
3464
-
3465
- var subset_1;
3466
- var hasRequiredSubset;
3467
-
3468
- function requireSubset () {
3469
- if (hasRequiredSubset) return subset_1;
3470
- hasRequiredSubset = 1;
3471
-
3472
- const Range = requireRange();
3473
- const Comparator = requireComparator();
3474
- const { ANY } = Comparator;
3475
- const satisfies = requireSatisfies();
3476
- const compare = requireCompare();
3477
-
3478
- // Complex range `r1 || r2 || ...` is a subset of `R1 || R2 || ...` iff:
3479
- // - Every simple range `r1, r2, ...` is a null set, OR
3480
- // - Every simple range `r1, r2, ...` which is not a null set is a subset of
3481
- // some `R1, R2, ...`
3482
- //
3483
- // Simple range `c1 c2 ...` is a subset of simple range `C1 C2 ...` iff:
3484
- // - If c is only the ANY comparator
3485
- // - If C is only the ANY comparator, return true
3486
- // - Else if in prerelease mode, return false
3487
- // - else replace c with `[>=0.0.0]`
3488
- // - If C is only the ANY comparator
3489
- // - if in prerelease mode, return true
3490
- // - else replace C with `[>=0.0.0]`
3491
- // - Let EQ be the set of = comparators in c
3492
- // - If EQ is more than one, return true (null set)
3493
- // - Let GT be the highest > or >= comparator in c
3494
- // - Let LT be the lowest < or <= comparator in c
3495
- // - If GT and LT, and GT.semver > LT.semver, return true (null set)
3496
- // - If any C is a = range, and GT or LT are set, return false
3497
- // - If EQ
3498
- // - If GT, and EQ does not satisfy GT, return true (null set)
3499
- // - If LT, and EQ does not satisfy LT, return true (null set)
3500
- // - If EQ satisfies every C, return true
3501
- // - Else return false
3502
- // - If GT
3503
- // - If GT.semver is lower than any > or >= comp in C, return false
3504
- // - If GT is >=, and GT.semver does not satisfy every C, return false
3505
- // - If GT.semver has a prerelease, and not in prerelease mode
3506
- // - If no C has a prerelease and the GT.semver tuple, return false
3507
- // - If LT
3508
- // - If LT.semver is greater than any < or <= comp in C, return false
3509
- // - If LT is <=, and LT.semver does not satisfy every C, return false
3510
- // - If LT.semver has a prerelease, and not in prerelease mode
3511
- // - If no C has a prerelease and the LT.semver tuple, return false
3512
- // - Else return true
3513
-
3514
- const subset = (sub, dom, options = {}) => {
3515
- if (sub === dom) {
3516
- return true
3517
- }
3518
-
3519
- sub = new Range(sub, options);
3520
- dom = new Range(dom, options);
3521
- let sawNonNull = false;
3522
-
3523
- OUTER: for (const simpleSub of sub.set) {
3524
- for (const simpleDom of dom.set) {
3525
- const isSub = simpleSubset(simpleSub, simpleDom, options);
3526
- sawNonNull = sawNonNull || isSub !== null;
3527
- if (isSub) {
3528
- continue OUTER
3529
- }
3530
- }
3531
- // the null set is a subset of everything, but null simple ranges in
3532
- // a complex range should be ignored. so if we saw a non-null range,
3533
- // then we know this isn't a subset, but if EVERY simple range was null,
3534
- // then it is a subset.
3535
- if (sawNonNull) {
3536
- return false
3537
- }
3538
- }
3539
- return true
3540
- };
3541
-
3542
- const minimumVersionWithPreRelease = [new Comparator('>=0.0.0-0')];
3543
- const minimumVersion = [new Comparator('>=0.0.0')];
3544
-
3545
- const simpleSubset = (sub, dom, options) => {
3546
- if (sub === dom) {
3547
- return true
3548
- }
3549
-
3550
- if (sub.length === 1 && sub[0].semver === ANY) {
3551
- if (dom.length === 1 && dom[0].semver === ANY) {
3552
- return true
3553
- } else if (options.includePrerelease) {
3554
- sub = minimumVersionWithPreRelease;
3555
- } else {
3556
- sub = minimumVersion;
3557
- }
3558
- }
3559
-
3560
- if (dom.length === 1 && dom[0].semver === ANY) {
3561
- if (options.includePrerelease) {
3562
- return true
3563
- } else {
3564
- dom = minimumVersion;
3565
- }
3566
- }
3567
-
3568
- const eqSet = new Set();
3569
- let gt, lt;
3570
- for (const c of sub) {
3571
- if (c.operator === '>' || c.operator === '>=') {
3572
- gt = higherGT(gt, c, options);
3573
- } else if (c.operator === '<' || c.operator === '<=') {
3574
- lt = lowerLT(lt, c, options);
3575
- } else {
3576
- eqSet.add(c.semver);
3577
- }
3578
- }
3579
-
3580
- if (eqSet.size > 1) {
3581
- return null
3582
- }
3583
-
3584
- let gtltComp;
3585
- if (gt && lt) {
3586
- gtltComp = compare(gt.semver, lt.semver, options);
3587
- if (gtltComp > 0) {
3588
- return null
3589
- } else if (gtltComp === 0 && (gt.operator !== '>=' || lt.operator !== '<=')) {
3590
- return null
3591
- }
3592
- }
3593
-
3594
- // will iterate one or zero times
3595
- for (const eq of eqSet) {
3596
- if (gt && !satisfies(eq, String(gt), options)) {
3597
- return null
3598
- }
3599
-
3600
- if (lt && !satisfies(eq, String(lt), options)) {
3601
- return null
3602
- }
3603
-
3604
- for (const c of dom) {
3605
- if (!satisfies(eq, String(c), options)) {
3606
- return false
3607
- }
3608
- }
3609
-
3610
- return true
3611
- }
3612
-
3613
- let higher, lower;
3614
- let hasDomLT, hasDomGT;
3615
- // if the subset has a prerelease, we need a comparator in the superset
3616
- // with the same tuple and a prerelease, or it's not a subset
3617
- let needDomLTPre = lt &&
3618
- !options.includePrerelease &&
3619
- lt.semver.prerelease.length ? lt.semver : false;
3620
- let needDomGTPre = gt &&
3621
- !options.includePrerelease &&
3622
- gt.semver.prerelease.length ? gt.semver : false;
3623
- // exception: <1.2.3-0 is the same as <1.2.3
3624
- if (needDomLTPre && needDomLTPre.prerelease.length === 1 &&
3625
- lt.operator === '<' && needDomLTPre.prerelease[0] === 0) {
3626
- needDomLTPre = false;
3627
- }
3628
-
3629
- for (const c of dom) {
3630
- hasDomGT = hasDomGT || c.operator === '>' || c.operator === '>=';
3631
- hasDomLT = hasDomLT || c.operator === '<' || c.operator === '<=';
3632
- if (gt) {
3633
- if (needDomGTPre) {
3634
- if (c.semver.prerelease && c.semver.prerelease.length &&
3635
- c.semver.major === needDomGTPre.major &&
3636
- c.semver.minor === needDomGTPre.minor &&
3637
- c.semver.patch === needDomGTPre.patch) {
3638
- needDomGTPre = false;
3639
- }
3640
- }
3641
- if (c.operator === '>' || c.operator === '>=') {
3642
- higher = higherGT(gt, c, options);
3643
- if (higher === c && higher !== gt) {
3644
- return false
3645
- }
3646
- } else if (gt.operator === '>=' && !satisfies(gt.semver, String(c), options)) {
3647
- return false
3648
- }
3649
- }
3650
- if (lt) {
3651
- if (needDomLTPre) {
3652
- if (c.semver.prerelease && c.semver.prerelease.length &&
3653
- c.semver.major === needDomLTPre.major &&
3654
- c.semver.minor === needDomLTPre.minor &&
3655
- c.semver.patch === needDomLTPre.patch) {
3656
- needDomLTPre = false;
3657
- }
3658
- }
3659
- if (c.operator === '<' || c.operator === '<=') {
3660
- lower = lowerLT(lt, c, options);
3661
- if (lower === c && lower !== lt) {
3662
- return false
3663
- }
3664
- } else if (lt.operator === '<=' && !satisfies(lt.semver, String(c), options)) {
3665
- return false
3666
- }
3667
- }
3668
- if (!c.operator && (lt || gt) && gtltComp !== 0) {
3669
- return false
3670
- }
3671
- }
3672
-
3673
- // if there was a < or >, and nothing in the dom, then must be false
3674
- // UNLESS it was limited by another range in the other direction.
3675
- // Eg, >1.0.0 <1.0.1 is still a subset of <2.0.0
3676
- if (gt && hasDomLT && !lt && gtltComp !== 0) {
3677
- return false
3678
- }
3679
-
3680
- if (lt && hasDomGT && !gt && gtltComp !== 0) {
3681
- return false
3682
- }
3683
-
3684
- // we needed a prerelease range in a specific tuple, but didn't get one
3685
- // then this isn't a subset. eg >=1.2.3-pre is not a subset of >=1.0.0,
3686
- // because it includes prereleases in the 1.2.3 tuple
3687
- if (needDomGTPre || needDomLTPre) {
3688
- return false
3689
- }
3690
-
3691
- return true
3692
- };
3693
-
3694
- // >=1.2.3 is lower than >1.2.3
3695
- const higherGT = (a, b, options) => {
3696
- if (!a) {
3697
- return b
3698
- }
3699
- const comp = compare(a.semver, b.semver, options);
3700
- return comp > 0 ? a
3701
- : comp < 0 ? b
3702
- : b.operator === '>' && a.operator === '>=' ? b
3703
- : a
3704
- };
3705
-
3706
- // <=1.2.3 is higher than <1.2.3
3707
- const lowerLT = (a, b, options) => {
3708
- if (!a) {
3709
- return b
3710
- }
3711
- const comp = compare(a.semver, b.semver, options);
3712
- return comp < 0 ? a
3713
- : comp > 0 ? b
3714
- : b.operator === '<' && a.operator === '<=' ? b
3715
- : a
3716
- };
3717
-
3718
- subset_1 = subset;
3719
- return subset_1;
3720
- }
3721
-
3722
- var semver;
3723
- var hasRequiredSemver;
3724
-
3725
- function requireSemver () {
3726
- if (hasRequiredSemver) return semver;
3727
- hasRequiredSemver = 1;
3728
-
3729
- // just pre-load all the stuff that index.js lazily exports
3730
- const internalRe = requireRe();
3731
- const constants = requireConstants();
3732
- const SemVer = requireSemver$1();
3733
- const identifiers = requireIdentifiers();
3734
- const parse = requireParse();
3735
- const valid = requireValid$1();
3736
- const clean = requireClean();
3737
- const inc = requireInc();
3738
- const diff = requireDiff();
3739
- const major = requireMajor();
3740
- const minor = requireMinor();
3741
- const patch = requirePatch();
3742
- const prerelease = requirePrerelease();
3743
- const compare = requireCompare();
3744
- const rcompare = requireRcompare();
3745
- const compareLoose = requireCompareLoose();
3746
- const compareBuild = requireCompareBuild();
3747
- const sort = requireSort();
3748
- const rsort = requireRsort();
3749
- const gt = requireGt();
3750
- const lt = requireLt();
3751
- const eq = requireEq();
3752
- const neq = requireNeq();
3753
- const gte = requireGte();
3754
- const lte = requireLte();
3755
- const cmp = requireCmp();
3756
- const coerce = requireCoerce();
3757
- const Comparator = requireComparator();
3758
- const Range = requireRange();
3759
- const satisfies = requireSatisfies();
3760
- const toComparators = requireToComparators();
3761
- const maxSatisfying = requireMaxSatisfying();
3762
- const minSatisfying = requireMinSatisfying();
3763
- const minVersion = requireMinVersion();
3764
- const validRange = requireValid();
3765
- const outside = requireOutside();
3766
- const gtr = requireGtr();
3767
- const ltr = requireLtr();
3768
- const intersects = requireIntersects();
3769
- const simplifyRange = requireSimplify();
3770
- const subset = requireSubset();
3771
- semver = {
3772
- parse,
3773
- valid,
3774
- clean,
3775
- inc,
3776
- diff,
3777
- major,
3778
- minor,
3779
- patch,
3780
- prerelease,
3781
- compare,
3782
- rcompare,
3783
- compareLoose,
3784
- compareBuild,
3785
- sort,
3786
- rsort,
3787
- gt,
3788
- lt,
3789
- eq,
3790
- neq,
3791
- gte,
3792
- lte,
3793
- cmp,
3794
- coerce,
3795
- Comparator,
3796
- Range,
3797
- satisfies,
3798
- toComparators,
3799
- maxSatisfying,
3800
- minSatisfying,
3801
- minVersion,
3802
- validRange,
3803
- outside,
3804
- gtr,
3805
- ltr,
3806
- intersects,
3807
- simplifyRange,
3808
- subset,
3809
- SemVer,
3810
- re: internalRe.re,
3811
- src: internalRe.src,
3812
- tokens: internalRe.t,
3813
- SEMVER_SPEC_VERSION: constants.SEMVER_SPEC_VERSION,
3814
- RELEASE_TYPES: constants.RELEASE_TYPES,
3815
- compareIdentifiers: identifiers.compareIdentifiers,
3816
- rcompareIdentifiers: identifiers.rcompareIdentifiers,
3817
- };
3818
- return semver;
3819
- }
3820
-
3821
- exports.requireSemver = requireSemver;
3822
- exports.requireSrc = requireSrc;