@grafana/plugin-e2e 3.9.2 → 3.11.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 (59) hide show
  1. package/dist/_virtual/index.js +7 -0
  2. package/dist/_virtual/re.js +5 -0
  3. package/dist/fixtures/page.js +6 -0
  4. package/dist/index.d.ts +69 -49
  5. package/dist/index.js +12 -0
  6. package/dist/models/Components.js +18 -0
  7. package/dist/models/components/ColorPicker.js +13 -4
  8. package/dist/models/components/MultiSelect.js +12 -0
  9. package/dist/models/components/RadioGroup.js +14 -0
  10. package/dist/models/components/Select.js +11 -0
  11. package/dist/models/components/Switch.js +14 -0
  12. package/dist/models/components/UnitPicker.js +12 -0
  13. package/dist/node_modules/semver/classes/comparator.js +161 -0
  14. package/dist/node_modules/semver/classes/range.js +596 -0
  15. package/dist/node_modules/semver/classes/semver.js +367 -0
  16. package/dist/node_modules/semver/functions/clean.js +21 -0
  17. package/dist/node_modules/semver/functions/cmp.js +72 -0
  18. package/dist/node_modules/semver/functions/coerce.js +77 -0
  19. package/dist/node_modules/semver/functions/compare-build.js +22 -0
  20. package/dist/node_modules/semver/functions/compare-loose.js +18 -0
  21. package/dist/node_modules/semver/functions/compare.js +20 -0
  22. package/dist/node_modules/semver/functions/diff.js +73 -0
  23. package/dist/node_modules/semver/functions/eq.js +18 -0
  24. package/dist/node_modules/semver/functions/gt.js +18 -0
  25. package/dist/node_modules/semver/functions/gte.js +18 -0
  26. package/dist/node_modules/semver/functions/inc.js +34 -0
  27. package/dist/node_modules/semver/functions/lt.js +18 -0
  28. package/dist/node_modules/semver/functions/lte.js +18 -0
  29. package/dist/node_modules/semver/functions/major.js +18 -0
  30. package/dist/node_modules/semver/functions/minor.js +18 -0
  31. package/dist/node_modules/semver/functions/neq.js +18 -0
  32. package/dist/node_modules/semver/functions/parse.js +31 -0
  33. package/dist/node_modules/semver/functions/patch.js +18 -0
  34. package/dist/node_modules/semver/functions/prerelease.js +21 -0
  35. package/dist/node_modules/semver/functions/rcompare.js +18 -0
  36. package/dist/node_modules/semver/functions/rsort.js +18 -0
  37. package/dist/node_modules/semver/functions/satisfies.js +25 -0
  38. package/dist/node_modules/semver/functions/sort.js +18 -0
  39. package/dist/node_modules/semver/functions/truncate.js +63 -0
  40. package/dist/node_modules/semver/functions/valid.js +21 -0
  41. package/dist/node_modules/semver/index.js +147 -0
  42. package/dist/node_modules/semver/internal/constants.js +48 -0
  43. package/dist/node_modules/semver/internal/debug.js +22 -0
  44. package/dist/node_modules/semver/internal/identifiers.js +40 -0
  45. package/dist/node_modules/semver/internal/lrucache.js +53 -0
  46. package/dist/node_modules/semver/internal/parse-options.js +28 -0
  47. package/dist/node_modules/semver/internal/re.js +239 -0
  48. package/dist/node_modules/semver/ranges/gtr.js +19 -0
  49. package/dist/node_modules/semver/ranges/intersects.js +22 -0
  50. package/dist/node_modules/semver/ranges/ltr.js +19 -0
  51. package/dist/node_modules/semver/ranges/max-satisfying.js +41 -0
  52. package/dist/node_modules/semver/ranges/min-satisfying.js +40 -0
  53. package/dist/node_modules/semver/ranges/min-version.js +78 -0
  54. package/dist/node_modules/semver/ranges/outside.js +102 -0
  55. package/dist/node_modules/semver/ranges/simplify.js +63 -0
  56. package/dist/node_modules/semver/ranges/subset.js +265 -0
  57. package/dist/node_modules/semver/ranges/to-comparators.js +23 -0
  58. package/dist/node_modules/semver/ranges/valid.js +26 -0
  59. package/package.json +2 -2
@@ -0,0 +1,367 @@
1
+ 'use strict';
2
+
3
+ var debug = require('../internal/debug.js');
4
+ var constants = require('../internal/constants.js');
5
+ var re = require('../internal/re.js');
6
+ var parseOptions = require('../internal/parse-options.js');
7
+ var identifiers = require('../internal/identifiers.js');
8
+
9
+ var semver;
10
+ var hasRequiredSemver;
11
+
12
+ function requireSemver () {
13
+ if (hasRequiredSemver) return semver;
14
+ hasRequiredSemver = 1;
15
+
16
+ const debug$1 = debug.__require();
17
+ const { MAX_LENGTH, MAX_SAFE_INTEGER } = constants.__require();
18
+ const { safeRe: re$1, t } = re.__require();
19
+
20
+ const parseOptions$1 = parseOptions.__require();
21
+ const { compareIdentifiers } = identifiers.__require();
22
+
23
+ const isPrereleaseIdentifier = (prerelease, identifier) => {
24
+ const identifiers = identifier.split('.');
25
+ if (identifiers.length > prerelease.length) {
26
+ return false
27
+ }
28
+
29
+ for (let i = 0; i < identifiers.length; i++) {
30
+ if (compareIdentifiers(prerelease[i], identifiers[i]) !== 0) {
31
+ return false
32
+ }
33
+ }
34
+
35
+ return true
36
+ };
37
+
38
+ class SemVer {
39
+ constructor (version, options) {
40
+ options = parseOptions$1(options);
41
+
42
+ if (version instanceof SemVer) {
43
+ if (version.loose === !!options.loose &&
44
+ version.includePrerelease === !!options.includePrerelease) {
45
+ return version
46
+ } else {
47
+ version = version.version;
48
+ }
49
+ } else if (typeof version !== 'string') {
50
+ throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version}".`)
51
+ }
52
+
53
+ if (version.length > MAX_LENGTH) {
54
+ throw new TypeError(
55
+ `version is longer than ${MAX_LENGTH} characters`
56
+ )
57
+ }
58
+
59
+ debug$1('SemVer', version, options);
60
+ this.options = options;
61
+ this.loose = !!options.loose;
62
+ // this isn't actually relevant for versions, but keep it so that we
63
+ // don't run into trouble passing this.options around.
64
+ this.includePrerelease = !!options.includePrerelease;
65
+
66
+ const m = version.trim().match(options.loose ? re$1[t.LOOSE] : re$1[t.FULL]);
67
+
68
+ if (!m) {
69
+ throw new TypeError(`Invalid Version: ${version}`)
70
+ }
71
+
72
+ this.raw = version;
73
+
74
+ // these are actually numbers
75
+ this.major = +m[1];
76
+ this.minor = +m[2];
77
+ this.patch = +m[3];
78
+
79
+ if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
80
+ throw new TypeError('Invalid major version')
81
+ }
82
+
83
+ if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
84
+ throw new TypeError('Invalid minor version')
85
+ }
86
+
87
+ if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
88
+ throw new TypeError('Invalid patch version')
89
+ }
90
+
91
+ // numberify any prerelease numeric ids
92
+ if (!m[4]) {
93
+ this.prerelease = [];
94
+ } else {
95
+ this.prerelease = m[4].split('.').map((id) => {
96
+ if (/^[0-9]+$/.test(id)) {
97
+ const num = +id;
98
+ if (num >= 0 && num < MAX_SAFE_INTEGER) {
99
+ return num
100
+ }
101
+ }
102
+ return id
103
+ });
104
+ }
105
+
106
+ this.build = m[5] ? m[5].split('.') : [];
107
+ this.format();
108
+ }
109
+
110
+ format () {
111
+ this.version = `${this.major}.${this.minor}.${this.patch}`;
112
+ if (this.prerelease.length) {
113
+ this.version += `-${this.prerelease.join('.')}`;
114
+ }
115
+ return this.version
116
+ }
117
+
118
+ toString () {
119
+ return this.version
120
+ }
121
+
122
+ compare (other) {
123
+ debug$1('SemVer.compare', this.version, this.options, other);
124
+ if (!(other instanceof SemVer)) {
125
+ if (typeof other === 'string' && other === this.version) {
126
+ return 0
127
+ }
128
+ other = new SemVer(other, this.options);
129
+ }
130
+
131
+ if (other.version === this.version) {
132
+ return 0
133
+ }
134
+
135
+ return this.compareMain(other) || this.comparePre(other)
136
+ }
137
+
138
+ compareMain (other) {
139
+ if (!(other instanceof SemVer)) {
140
+ other = new SemVer(other, this.options);
141
+ }
142
+
143
+ if (this.major < other.major) {
144
+ return -1
145
+ }
146
+ if (this.major > other.major) {
147
+ return 1
148
+ }
149
+ if (this.minor < other.minor) {
150
+ return -1
151
+ }
152
+ if (this.minor > other.minor) {
153
+ return 1
154
+ }
155
+ if (this.patch < other.patch) {
156
+ return -1
157
+ }
158
+ if (this.patch > other.patch) {
159
+ return 1
160
+ }
161
+ return 0
162
+ }
163
+
164
+ comparePre (other) {
165
+ if (!(other instanceof SemVer)) {
166
+ other = new SemVer(other, this.options);
167
+ }
168
+
169
+ // NOT having a prerelease is > having one
170
+ if (this.prerelease.length && !other.prerelease.length) {
171
+ return -1
172
+ } else if (!this.prerelease.length && other.prerelease.length) {
173
+ return 1
174
+ } else if (!this.prerelease.length && !other.prerelease.length) {
175
+ return 0
176
+ }
177
+
178
+ let i = 0;
179
+ do {
180
+ const a = this.prerelease[i];
181
+ const b = other.prerelease[i];
182
+ debug$1('prerelease compare', i, a, b);
183
+ if (a === undefined && b === undefined) {
184
+ return 0
185
+ } else if (b === undefined) {
186
+ return 1
187
+ } else if (a === undefined) {
188
+ return -1
189
+ } else if (a === b) {
190
+ continue
191
+ } else {
192
+ return compareIdentifiers(a, b)
193
+ }
194
+ } while (++i)
195
+ }
196
+
197
+ compareBuild (other) {
198
+ if (!(other instanceof SemVer)) {
199
+ other = new SemVer(other, this.options);
200
+ }
201
+
202
+ let i = 0;
203
+ do {
204
+ const a = this.build[i];
205
+ const b = other.build[i];
206
+ debug$1('build compare', i, a, b);
207
+ if (a === undefined && b === undefined) {
208
+ return 0
209
+ } else if (b === undefined) {
210
+ return 1
211
+ } else if (a === undefined) {
212
+ return -1
213
+ } else if (a === b) {
214
+ continue
215
+ } else {
216
+ return compareIdentifiers(a, b)
217
+ }
218
+ } while (++i)
219
+ }
220
+
221
+ // preminor will bump the version up to the next minor release, and immediately
222
+ // down to pre-release. premajor and prepatch work the same way.
223
+ inc (release, identifier, identifierBase) {
224
+ if (release.startsWith('pre')) {
225
+ if (!identifier && identifierBase === false) {
226
+ throw new Error('invalid increment argument: identifier is empty')
227
+ }
228
+ // Avoid an invalid semver results
229
+ if (identifier) {
230
+ const match = `-${identifier}`.match(this.options.loose ? re$1[t.PRERELEASELOOSE] : re$1[t.PRERELEASE]);
231
+ if (!match || match[1] !== identifier) {
232
+ throw new Error(`invalid identifier: ${identifier}`)
233
+ }
234
+ }
235
+ }
236
+
237
+ switch (release) {
238
+ case 'premajor':
239
+ this.prerelease.length = 0;
240
+ this.patch = 0;
241
+ this.minor = 0;
242
+ this.major++;
243
+ this.inc('pre', identifier, identifierBase);
244
+ break
245
+ case 'preminor':
246
+ this.prerelease.length = 0;
247
+ this.patch = 0;
248
+ this.minor++;
249
+ this.inc('pre', identifier, identifierBase);
250
+ break
251
+ case 'prepatch':
252
+ // If this is already a prerelease, it will bump to the next version
253
+ // drop any prereleases that might already exist, since they are not
254
+ // relevant at this point.
255
+ this.prerelease.length = 0;
256
+ this.inc('patch', identifier, identifierBase);
257
+ this.inc('pre', identifier, identifierBase);
258
+ break
259
+ // If the input is a non-prerelease version, this acts the same as
260
+ // prepatch.
261
+ case 'prerelease':
262
+ if (this.prerelease.length === 0) {
263
+ this.inc('patch', identifier, identifierBase);
264
+ }
265
+ this.inc('pre', identifier, identifierBase);
266
+ break
267
+ case 'release':
268
+ if (this.prerelease.length === 0) {
269
+ throw new Error(`version ${this.raw} is not a prerelease`)
270
+ }
271
+ this.prerelease.length = 0;
272
+ break
273
+
274
+ case 'major':
275
+ // If this is a pre-major version, bump up to the same major version.
276
+ // Otherwise increment major.
277
+ // 1.0.0-5 bumps to 1.0.0
278
+ // 1.1.0 bumps to 2.0.0
279
+ if (
280
+ this.minor !== 0 ||
281
+ this.patch !== 0 ||
282
+ this.prerelease.length === 0
283
+ ) {
284
+ this.major++;
285
+ }
286
+ this.minor = 0;
287
+ this.patch = 0;
288
+ this.prerelease = [];
289
+ break
290
+ case 'minor':
291
+ // If this is a pre-minor version, bump up to the same minor version.
292
+ // Otherwise increment minor.
293
+ // 1.2.0-5 bumps to 1.2.0
294
+ // 1.2.1 bumps to 1.3.0
295
+ if (this.patch !== 0 || this.prerelease.length === 0) {
296
+ this.minor++;
297
+ }
298
+ this.patch = 0;
299
+ this.prerelease = [];
300
+ break
301
+ case 'patch':
302
+ // If this is not a pre-release version, it will increment the patch.
303
+ // If it is a pre-release it will bump up to the same patch version.
304
+ // 1.2.0-5 patches to 1.2.0
305
+ // 1.2.0 patches to 1.2.1
306
+ if (this.prerelease.length === 0) {
307
+ this.patch++;
308
+ }
309
+ this.prerelease = [];
310
+ break
311
+ // This probably shouldn't be used publicly.
312
+ // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction.
313
+ case 'pre': {
314
+ const base = Number(identifierBase) ? 1 : 0;
315
+
316
+ if (this.prerelease.length === 0) {
317
+ this.prerelease = [base];
318
+ } else {
319
+ let i = this.prerelease.length;
320
+ while (--i >= 0) {
321
+ if (typeof this.prerelease[i] === 'number') {
322
+ this.prerelease[i]++;
323
+ i = -2;
324
+ }
325
+ }
326
+ if (i === -1) {
327
+ // didn't increment anything
328
+ if (identifier === this.prerelease.join('.') && identifierBase === false) {
329
+ throw new Error('invalid increment argument: identifier already exists')
330
+ }
331
+ this.prerelease.push(base);
332
+ }
333
+ }
334
+ if (identifier) {
335
+ // 1.2.0-beta.1 bumps to 1.2.0-beta.2,
336
+ // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0
337
+ let prerelease = [identifier, base];
338
+ if (identifierBase === false) {
339
+ prerelease = [identifier];
340
+ }
341
+ if (isPrereleaseIdentifier(this.prerelease, identifier)) {
342
+ const prereleaseBase = this.prerelease[identifier.split('.').length];
343
+ if (isNaN(prereleaseBase)) {
344
+ this.prerelease = prerelease;
345
+ }
346
+ } else {
347
+ this.prerelease = prerelease;
348
+ }
349
+ }
350
+ break
351
+ }
352
+ default:
353
+ throw new Error(`invalid increment argument: ${release}`)
354
+ }
355
+ this.raw = this.format();
356
+ if (this.build.length) {
357
+ this.raw += `+${this.build.join('.')}`;
358
+ }
359
+ return this
360
+ }
361
+ }
362
+
363
+ semver = SemVer;
364
+ return semver;
365
+ }
366
+
367
+ exports.__require = requireSemver;
@@ -0,0 +1,21 @@
1
+ 'use strict';
2
+
3
+ var parse = require('./parse.js');
4
+
5
+ var clean_1;
6
+ var hasRequiredClean;
7
+
8
+ function requireClean () {
9
+ if (hasRequiredClean) return clean_1;
10
+ hasRequiredClean = 1;
11
+
12
+ const parse$1 = parse.__require();
13
+ const clean = (version, options) => {
14
+ const s = parse$1(version.trim().replace(/^[=v]+/, ''), options);
15
+ return s ? s.version : null
16
+ };
17
+ clean_1 = clean;
18
+ return clean_1;
19
+ }
20
+
21
+ exports.__require = requireClean;
@@ -0,0 +1,72 @@
1
+ 'use strict';
2
+
3
+ var eq = require('./eq.js');
4
+ var neq = require('./neq.js');
5
+ var gt = require('./gt.js');
6
+ var gte = require('./gte.js');
7
+ var lt = require('./lt.js');
8
+ var lte = require('./lte.js');
9
+
10
+ var cmp_1;
11
+ var hasRequiredCmp;
12
+
13
+ function requireCmp () {
14
+ if (hasRequiredCmp) return cmp_1;
15
+ hasRequiredCmp = 1;
16
+
17
+ const eq$1 = eq.__require();
18
+ const neq$1 = neq.__require();
19
+ const gt$1 = gt.__require();
20
+ const gte$1 = gte.__require();
21
+ const lt$1 = lt.__require();
22
+ const lte$1 = lte.__require();
23
+
24
+ const cmp = (a, op, b, loose) => {
25
+ switch (op) {
26
+ case '===':
27
+ if (typeof a === 'object') {
28
+ a = a.version;
29
+ }
30
+ if (typeof b === 'object') {
31
+ b = b.version;
32
+ }
33
+ return a === b
34
+
35
+ case '!==':
36
+ if (typeof a === 'object') {
37
+ a = a.version;
38
+ }
39
+ if (typeof b === 'object') {
40
+ b = b.version;
41
+ }
42
+ return a !== b
43
+
44
+ case '':
45
+ case '=':
46
+ case '==':
47
+ return eq$1(a, b, loose)
48
+
49
+ case '!=':
50
+ return neq$1(a, b, loose)
51
+
52
+ case '>':
53
+ return gt$1(a, b, loose)
54
+
55
+ case '>=':
56
+ return gte$1(a, b, loose)
57
+
58
+ case '<':
59
+ return lt$1(a, b, loose)
60
+
61
+ case '<=':
62
+ return lte$1(a, b, loose)
63
+
64
+ default:
65
+ throw new TypeError(`Invalid operator: ${op}`)
66
+ }
67
+ };
68
+ cmp_1 = cmp;
69
+ return cmp_1;
70
+ }
71
+
72
+ exports.__require = requireCmp;
@@ -0,0 +1,77 @@
1
+ 'use strict';
2
+
3
+ var semver = require('../classes/semver.js');
4
+ var parse = require('./parse.js');
5
+ var re = require('../internal/re.js');
6
+
7
+ var coerce_1;
8
+ var hasRequiredCoerce;
9
+
10
+ function requireCoerce () {
11
+ if (hasRequiredCoerce) return coerce_1;
12
+ hasRequiredCoerce = 1;
13
+
14
+ const SemVer = semver.__require();
15
+ const parse$1 = parse.__require();
16
+ const { safeRe: re$1, t } = re.__require();
17
+
18
+ const coerce = (version, options) => {
19
+ if (version instanceof SemVer) {
20
+ return version
21
+ }
22
+
23
+ if (typeof version === 'number') {
24
+ version = String(version);
25
+ }
26
+
27
+ if (typeof version !== 'string') {
28
+ return null
29
+ }
30
+
31
+ options = options || {};
32
+
33
+ let match = null;
34
+ if (!options.rtl) {
35
+ match = version.match(options.includePrerelease ? re$1[t.COERCEFULL] : re$1[t.COERCE]);
36
+ } else {
37
+ // Find the right-most coercible string that does not share
38
+ // a terminus with a more left-ward coercible string.
39
+ // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4'
40
+ // With includePrerelease option set, '1.2.3.4-rc' wants to coerce '2.3.4-rc', not '2.3.4'
41
+ //
42
+ // Walk through the string checking with a /g regexp
43
+ // Manually set the index so as to pick up overlapping matches.
44
+ // Stop when we get a match that ends at the string end, since no
45
+ // coercible string can be more right-ward without the same terminus.
46
+ const coerceRtlRegex = options.includePrerelease ? re$1[t.COERCERTLFULL] : re$1[t.COERCERTL];
47
+ let next;
48
+ while ((next = coerceRtlRegex.exec(version)) &&
49
+ (!match || match.index + match[0].length !== version.length)
50
+ ) {
51
+ if (!match ||
52
+ next.index + next[0].length !== match.index + match[0].length) {
53
+ match = next;
54
+ }
55
+ coerceRtlRegex.lastIndex = next.index + next[1].length + next[2].length;
56
+ }
57
+ // leave it in a clean state
58
+ coerceRtlRegex.lastIndex = -1;
59
+ }
60
+
61
+ if (match === null) {
62
+ return null
63
+ }
64
+
65
+ const major = match[2];
66
+ const minor = match[3] || '0';
67
+ const patch = match[4] || '0';
68
+ const prerelease = options.includePrerelease && match[5] ? `-${match[5]}` : '';
69
+ const build = options.includePrerelease && match[6] ? `+${match[6]}` : '';
70
+
71
+ return parse$1(`${major}.${minor}.${patch}${prerelease}${build}`, options)
72
+ };
73
+ coerce_1 = coerce;
74
+ return coerce_1;
75
+ }
76
+
77
+ exports.__require = requireCoerce;
@@ -0,0 +1,22 @@
1
+ 'use strict';
2
+
3
+ var semver = require('../classes/semver.js');
4
+
5
+ var compareBuild_1;
6
+ var hasRequiredCompareBuild;
7
+
8
+ function requireCompareBuild () {
9
+ if (hasRequiredCompareBuild) return compareBuild_1;
10
+ hasRequiredCompareBuild = 1;
11
+
12
+ const SemVer = semver.__require();
13
+ const compareBuild = (a, b, loose) => {
14
+ const versionA = new SemVer(a, loose);
15
+ const versionB = new SemVer(b, loose);
16
+ return versionA.compare(versionB) || versionA.compareBuild(versionB)
17
+ };
18
+ compareBuild_1 = compareBuild;
19
+ return compareBuild_1;
20
+ }
21
+
22
+ exports.__require = requireCompareBuild;
@@ -0,0 +1,18 @@
1
+ 'use strict';
2
+
3
+ var compare = require('./compare.js');
4
+
5
+ var compareLoose_1;
6
+ var hasRequiredCompareLoose;
7
+
8
+ function requireCompareLoose () {
9
+ if (hasRequiredCompareLoose) return compareLoose_1;
10
+ hasRequiredCompareLoose = 1;
11
+
12
+ const compare$1 = compare.__require();
13
+ const compareLoose = (a, b) => compare$1(a, b, true);
14
+ compareLoose_1 = compareLoose;
15
+ return compareLoose_1;
16
+ }
17
+
18
+ exports.__require = requireCompareLoose;
@@ -0,0 +1,20 @@
1
+ 'use strict';
2
+
3
+ var semver = require('../classes/semver.js');
4
+
5
+ var compare_1;
6
+ var hasRequiredCompare;
7
+
8
+ function requireCompare () {
9
+ if (hasRequiredCompare) return compare_1;
10
+ hasRequiredCompare = 1;
11
+
12
+ const SemVer = semver.__require();
13
+ const compare = (a, b, loose) =>
14
+ new SemVer(a, loose).compare(new SemVer(b, loose));
15
+
16
+ compare_1 = compare;
17
+ return compare_1;
18
+ }
19
+
20
+ exports.__require = requireCompare;
@@ -0,0 +1,73 @@
1
+ 'use strict';
2
+
3
+ var parse = require('./parse.js');
4
+
5
+ var diff_1;
6
+ var hasRequiredDiff;
7
+
8
+ function requireDiff () {
9
+ if (hasRequiredDiff) return diff_1;
10
+ hasRequiredDiff = 1;
11
+
12
+ const parse$1 = parse.__require();
13
+
14
+ const diff = (version1, version2) => {
15
+ const v1 = parse$1(version1, null, true);
16
+ const v2 = parse$1(version2, null, true);
17
+ const comparison = v1.compare(v2);
18
+
19
+ if (comparison === 0) {
20
+ return null
21
+ }
22
+
23
+ const v1Higher = comparison > 0;
24
+ const highVersion = v1Higher ? v1 : v2;
25
+ const lowVersion = v1Higher ? v2 : v1;
26
+ const highHasPre = !!highVersion.prerelease.length;
27
+ const lowHasPre = !!lowVersion.prerelease.length;
28
+
29
+ if (lowHasPre && !highHasPre) {
30
+ // Going from prerelease -> no prerelease requires some special casing
31
+
32
+ // If the low version has only a major, then it will always be a major
33
+ // Some examples:
34
+ // 1.0.0-1 -> 1.0.0
35
+ // 1.0.0-1 -> 1.1.1
36
+ // 1.0.0-1 -> 2.0.0
37
+ if (!lowVersion.patch && !lowVersion.minor) {
38
+ return 'major'
39
+ }
40
+
41
+ // If the main part has no difference
42
+ if (lowVersion.compareMain(highVersion) === 0) {
43
+ if (lowVersion.minor && !lowVersion.patch) {
44
+ return 'minor'
45
+ }
46
+ return 'patch'
47
+ }
48
+ }
49
+
50
+ // add the `pre` prefix if we are going to a prerelease version
51
+ const prefix = highHasPre ? 'pre' : '';
52
+
53
+ if (v1.major !== v2.major) {
54
+ return prefix + 'major'
55
+ }
56
+
57
+ if (v1.minor !== v2.minor) {
58
+ return prefix + 'minor'
59
+ }
60
+
61
+ if (v1.patch !== v2.patch) {
62
+ return prefix + 'patch'
63
+ }
64
+
65
+ // high and low are prereleases
66
+ return 'prerelease'
67
+ };
68
+
69
+ diff_1 = diff;
70
+ return diff_1;
71
+ }
72
+
73
+ exports.__require = requireDiff;
@@ -0,0 +1,18 @@
1
+ 'use strict';
2
+
3
+ var compare = require('./compare.js');
4
+
5
+ var eq_1;
6
+ var hasRequiredEq;
7
+
8
+ function requireEq () {
9
+ if (hasRequiredEq) return eq_1;
10
+ hasRequiredEq = 1;
11
+
12
+ const compare$1 = compare.__require();
13
+ const eq = (a, b, loose) => compare$1(a, b, loose) === 0;
14
+ eq_1 = eq;
15
+ return eq_1;
16
+ }
17
+
18
+ exports.__require = requireEq;