@dcf-micro/eslint-config 5.0.0

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