@saasmakers/eslint 0.2.6 → 0.2.8

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