@saasmakers/eslint 0.2.5 → 0.2.7

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