@grafana/plugin-e2e 3.10.0 → 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 (58) hide show
  1. package/dist/_virtual/index.js +7 -0
  2. package/dist/_virtual/re.js +5 -0
  3. package/dist/index.d.ts +69 -49
  4. package/dist/index.js +12 -0
  5. package/dist/models/Components.js +18 -0
  6. package/dist/models/components/ColorPicker.js +13 -4
  7. package/dist/models/components/MultiSelect.js +12 -0
  8. package/dist/models/components/RadioGroup.js +14 -0
  9. package/dist/models/components/Select.js +11 -0
  10. package/dist/models/components/Switch.js +14 -0
  11. package/dist/models/components/UnitPicker.js +12 -0
  12. package/dist/node_modules/semver/classes/comparator.js +161 -0
  13. package/dist/node_modules/semver/classes/range.js +596 -0
  14. package/dist/node_modules/semver/classes/semver.js +367 -0
  15. package/dist/node_modules/semver/functions/clean.js +21 -0
  16. package/dist/node_modules/semver/functions/cmp.js +72 -0
  17. package/dist/node_modules/semver/functions/coerce.js +77 -0
  18. package/dist/node_modules/semver/functions/compare-build.js +22 -0
  19. package/dist/node_modules/semver/functions/compare-loose.js +18 -0
  20. package/dist/node_modules/semver/functions/compare.js +20 -0
  21. package/dist/node_modules/semver/functions/diff.js +73 -0
  22. package/dist/node_modules/semver/functions/eq.js +18 -0
  23. package/dist/node_modules/semver/functions/gt.js +18 -0
  24. package/dist/node_modules/semver/functions/gte.js +18 -0
  25. package/dist/node_modules/semver/functions/inc.js +34 -0
  26. package/dist/node_modules/semver/functions/lt.js +18 -0
  27. package/dist/node_modules/semver/functions/lte.js +18 -0
  28. package/dist/node_modules/semver/functions/major.js +18 -0
  29. package/dist/node_modules/semver/functions/minor.js +18 -0
  30. package/dist/node_modules/semver/functions/neq.js +18 -0
  31. package/dist/node_modules/semver/functions/parse.js +31 -0
  32. package/dist/node_modules/semver/functions/patch.js +18 -0
  33. package/dist/node_modules/semver/functions/prerelease.js +21 -0
  34. package/dist/node_modules/semver/functions/rcompare.js +18 -0
  35. package/dist/node_modules/semver/functions/rsort.js +18 -0
  36. package/dist/node_modules/semver/functions/satisfies.js +25 -0
  37. package/dist/node_modules/semver/functions/sort.js +18 -0
  38. package/dist/node_modules/semver/functions/truncate.js +63 -0
  39. package/dist/node_modules/semver/functions/valid.js +21 -0
  40. package/dist/node_modules/semver/index.js +147 -0
  41. package/dist/node_modules/semver/internal/constants.js +48 -0
  42. package/dist/node_modules/semver/internal/debug.js +22 -0
  43. package/dist/node_modules/semver/internal/identifiers.js +40 -0
  44. package/dist/node_modules/semver/internal/lrucache.js +53 -0
  45. package/dist/node_modules/semver/internal/parse-options.js +28 -0
  46. package/dist/node_modules/semver/internal/re.js +239 -0
  47. package/dist/node_modules/semver/ranges/gtr.js +19 -0
  48. package/dist/node_modules/semver/ranges/intersects.js +22 -0
  49. package/dist/node_modules/semver/ranges/ltr.js +19 -0
  50. package/dist/node_modules/semver/ranges/max-satisfying.js +41 -0
  51. package/dist/node_modules/semver/ranges/min-satisfying.js +40 -0
  52. package/dist/node_modules/semver/ranges/min-version.js +78 -0
  53. package/dist/node_modules/semver/ranges/outside.js +102 -0
  54. package/dist/node_modules/semver/ranges/simplify.js +63 -0
  55. package/dist/node_modules/semver/ranges/subset.js +265 -0
  56. package/dist/node_modules/semver/ranges/to-comparators.js +23 -0
  57. package/dist/node_modules/semver/ranges/valid.js +26 -0
  58. package/package.json +2 -2
@@ -0,0 +1,53 @@
1
+ 'use strict';
2
+
3
+ var lrucache;
4
+ var hasRequiredLrucache;
5
+
6
+ function requireLrucache () {
7
+ if (hasRequiredLrucache) return lrucache;
8
+ hasRequiredLrucache = 1;
9
+
10
+ class LRUCache {
11
+ constructor () {
12
+ this.max = 1000;
13
+ this.map = new Map();
14
+ }
15
+
16
+ get (key) {
17
+ const value = this.map.get(key);
18
+ if (value === undefined) {
19
+ return undefined
20
+ } else {
21
+ // Remove the key from the map and add it to the end
22
+ this.map.delete(key);
23
+ this.map.set(key, value);
24
+ return value
25
+ }
26
+ }
27
+
28
+ delete (key) {
29
+ return this.map.delete(key)
30
+ }
31
+
32
+ set (key, value) {
33
+ const deleted = this.delete(key);
34
+
35
+ if (!deleted && value !== undefined) {
36
+ // If cache is full, delete the least recently used item
37
+ if (this.map.size >= this.max) {
38
+ const firstKey = this.map.keys().next().value;
39
+ this.delete(firstKey);
40
+ }
41
+
42
+ this.map.set(key, value);
43
+ }
44
+
45
+ return this
46
+ }
47
+ }
48
+
49
+ lrucache = LRUCache;
50
+ return lrucache;
51
+ }
52
+
53
+ exports.__require = requireLrucache;
@@ -0,0 +1,28 @@
1
+ 'use strict';
2
+
3
+ var parseOptions_1;
4
+ var hasRequiredParseOptions;
5
+
6
+ function requireParseOptions () {
7
+ if (hasRequiredParseOptions) return parseOptions_1;
8
+ hasRequiredParseOptions = 1;
9
+
10
+ // parse out just the options we care about
11
+ const looseOption = Object.freeze({ loose: true });
12
+ const emptyOpts = Object.freeze({ });
13
+ const parseOptions = options => {
14
+ if (!options) {
15
+ return emptyOpts
16
+ }
17
+
18
+ if (typeof options !== 'object') {
19
+ return looseOption
20
+ }
21
+
22
+ return options
23
+ };
24
+ parseOptions_1 = parseOptions;
25
+ return parseOptions_1;
26
+ }
27
+
28
+ exports.__require = requireParseOptions;
@@ -0,0 +1,239 @@
1
+ 'use strict';
2
+
3
+ var re = require('../../../_virtual/re.js');
4
+ var constants = require('./constants.js');
5
+ var debug = require('./debug.js');
6
+
7
+ var hasRequiredRe;
8
+
9
+ function requireRe () {
10
+ if (hasRequiredRe) return re.__module.exports;
11
+ hasRequiredRe = 1;
12
+ (function (module, exports$1) {
13
+
14
+ const {
15
+ MAX_SAFE_COMPONENT_LENGTH,
16
+ MAX_SAFE_BUILD_LENGTH,
17
+ MAX_LENGTH,
18
+ } = constants.__require();
19
+ const debug$1 = debug.__require();
20
+ exports$1 = module.exports = {};
21
+
22
+ // The actual regexps go on exports.re
23
+ const re = exports$1.re = [];
24
+ const safeRe = exports$1.safeRe = [];
25
+ const src = exports$1.src = [];
26
+ const safeSrc = exports$1.safeSrc = [];
27
+ const t = exports$1.t = {};
28
+ let R = 0;
29
+
30
+ const LETTERDASHNUMBER = '[a-zA-Z0-9-]';
31
+
32
+ // Replace some greedy regex tokens to prevent regex dos issues. These regex are
33
+ // used internally via the safeRe object since all inputs in this library get
34
+ // normalized first to trim and collapse all extra whitespace. The original
35
+ // regexes are exported for userland consumption and lower level usage. A
36
+ // future breaking change could export the safer regex only with a note that
37
+ // all input should have extra whitespace removed.
38
+ const safeRegexReplacements = [
39
+ ['\\s', 1],
40
+ ['\\d', MAX_LENGTH],
41
+ [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH],
42
+ ];
43
+
44
+ const makeSafeRegex = (value) => {
45
+ for (const [token, max] of safeRegexReplacements) {
46
+ value = value
47
+ .split(`${token}*`).join(`${token}{0,${max}}`)
48
+ .split(`${token}+`).join(`${token}{1,${max}}`);
49
+ }
50
+ return value
51
+ };
52
+
53
+ const createToken = (name, value, isGlobal) => {
54
+ const safe = makeSafeRegex(value);
55
+ const index = R++;
56
+ debug$1(name, index, value);
57
+ t[name] = index;
58
+ src[index] = value;
59
+ safeSrc[index] = safe;
60
+ re[index] = new RegExp(value, isGlobal ? 'g' : undefined);
61
+ safeRe[index] = new RegExp(safe, isGlobal ? 'g' : undefined);
62
+ };
63
+
64
+ // The following Regular Expressions can be used for tokenizing,
65
+ // validating, and parsing SemVer version strings.
66
+
67
+ // ## Numeric Identifier
68
+ // A single `0`, or a non-zero digit followed by zero or more digits.
69
+
70
+ createToken('NUMERICIDENTIFIER', '0|[1-9]\\d*');
71
+ createToken('NUMERICIDENTIFIERLOOSE', '\\d+');
72
+
73
+ // ## Non-numeric Identifier
74
+ // Zero or more digits, followed by a letter or hyphen, and then zero or
75
+ // more letters, digits, or hyphens.
76
+
77
+ createToken('NONNUMERICIDENTIFIER', `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`);
78
+
79
+ // ## Main Version
80
+ // Three dot-separated numeric identifiers.
81
+
82
+ createToken('MAINVERSION', `(${src[t.NUMERICIDENTIFIER]})\\.` +
83
+ `(${src[t.NUMERICIDENTIFIER]})\\.` +
84
+ `(${src[t.NUMERICIDENTIFIER]})`);
85
+
86
+ createToken('MAINVERSIONLOOSE', `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.` +
87
+ `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.` +
88
+ `(${src[t.NUMERICIDENTIFIERLOOSE]})`);
89
+
90
+ // ## Pre-release Version Identifier
91
+ // A numeric identifier, or a non-numeric identifier.
92
+ // Non-numeric identifiers include numeric identifiers but can be longer.
93
+ // Therefore non-numeric identifiers must go first.
94
+
95
+ createToken('PRERELEASEIDENTIFIER', `(?:${src[t.NONNUMERICIDENTIFIER]
96
+ }|${src[t.NUMERICIDENTIFIER]})`);
97
+
98
+ createToken('PRERELEASEIDENTIFIERLOOSE', `(?:${src[t.NONNUMERICIDENTIFIER]
99
+ }|${src[t.NUMERICIDENTIFIERLOOSE]})`);
100
+
101
+ // ## Pre-release Version
102
+ // Hyphen, followed by one or more dot-separated pre-release version
103
+ // identifiers.
104
+
105
+ createToken('PRERELEASE', `(?:-(${src[t.PRERELEASEIDENTIFIER]
106
+ }(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`);
107
+
108
+ createToken('PRERELEASELOOSE', `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]
109
+ }(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`);
110
+
111
+ // ## Build Metadata Identifier
112
+ // Any combination of digits, letters, or hyphens.
113
+
114
+ createToken('BUILDIDENTIFIER', `${LETTERDASHNUMBER}+`);
115
+
116
+ // ## Build Metadata
117
+ // Plus sign, followed by one or more period-separated build metadata
118
+ // identifiers.
119
+
120
+ createToken('BUILD', `(?:\\+(${src[t.BUILDIDENTIFIER]
121
+ }(?:\\.${src[t.BUILDIDENTIFIER]})*))`);
122
+
123
+ // ## Full Version String
124
+ // A main version, followed optionally by a pre-release version and
125
+ // build metadata.
126
+
127
+ // Note that the only major, minor, patch, and pre-release sections of
128
+ // the version string are capturing groups. The build metadata is not a
129
+ // capturing group, because it should not ever be used in version
130
+ // comparison.
131
+
132
+ createToken('FULLPLAIN', `v?${src[t.MAINVERSION]
133
+ }${src[t.PRERELEASE]}?${
134
+ src[t.BUILD]}?`);
135
+
136
+ createToken('FULL', `^${src[t.FULLPLAIN]}$`);
137
+
138
+ // like full, but allows v1.2.3 and =1.2.3, which people do sometimes.
139
+ // also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty
140
+ // common in the npm registry.
141
+ createToken('LOOSEPLAIN', `[v=\\s]*${src[t.MAINVERSIONLOOSE]
142
+ }${src[t.PRERELEASELOOSE]}?${
143
+ src[t.BUILD]}?`);
144
+
145
+ createToken('LOOSE', `^${src[t.LOOSEPLAIN]}$`);
146
+
147
+ createToken('GTLT', '((?:<|>)?=?)');
148
+
149
+ // Something like "2.*" or "1.2.x".
150
+ // Note that "x.x" is a valid xRange identifier, meaning "any version"
151
+ // Only the first item is strictly required.
152
+ createToken('XRANGEIDENTIFIERLOOSE', `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);
153
+ createToken('XRANGEIDENTIFIER', `${src[t.NUMERICIDENTIFIER]}|x|X|\\*`);
154
+
155
+ createToken('XRANGEPLAIN', `[v=\\s]*(${src[t.XRANGEIDENTIFIER]})` +
156
+ `(?:\\.(${src[t.XRANGEIDENTIFIER]})` +
157
+ `(?:\\.(${src[t.XRANGEIDENTIFIER]})` +
158
+ `(?:${src[t.PRERELEASE]})?${
159
+ src[t.BUILD]}?` +
160
+ `)?)?`);
161
+
162
+ createToken('XRANGEPLAINLOOSE', `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})` +
163
+ `(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` +
164
+ `(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` +
165
+ `(?:${src[t.PRERELEASELOOSE]})?${
166
+ src[t.BUILD]}?` +
167
+ `)?)?`);
168
+
169
+ createToken('XRANGE', `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`);
170
+ createToken('XRANGELOOSE', `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`);
171
+
172
+ // Coercion.
173
+ // Extract anything that could conceivably be a part of a valid semver
174
+ createToken('COERCEPLAIN', `${'(^|[^\\d])' +
175
+ '(\\d{1,'}${MAX_SAFE_COMPONENT_LENGTH}})` +
176
+ `(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` +
177
+ `(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`);
178
+ createToken('COERCE', `${src[t.COERCEPLAIN]}(?:$|[^\\d])`);
179
+ createToken('COERCEFULL', src[t.COERCEPLAIN] +
180
+ `(?:${src[t.PRERELEASE]})?` +
181
+ `(?:${src[t.BUILD]})?` +
182
+ `(?:$|[^\\d])`);
183
+ createToken('COERCERTL', src[t.COERCE], true);
184
+ createToken('COERCERTLFULL', src[t.COERCEFULL], true);
185
+
186
+ // Tilde ranges.
187
+ // Meaning is "reasonably at or greater than"
188
+ createToken('LONETILDE', '(?:~>?)');
189
+
190
+ createToken('TILDETRIM', `(\\s*)${src[t.LONETILDE]}\\s+`, true);
191
+ exports$1.tildeTrimReplace = '$1~';
192
+
193
+ createToken('TILDE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`);
194
+ createToken('TILDELOOSE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`);
195
+
196
+ // Caret ranges.
197
+ // Meaning is "at least and backwards compatible with"
198
+ createToken('LONECARET', '(?:\\^)');
199
+
200
+ createToken('CARETTRIM', `(\\s*)${src[t.LONECARET]}\\s+`, true);
201
+ exports$1.caretTrimReplace = '$1^';
202
+
203
+ createToken('CARET', `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`);
204
+ createToken('CARETLOOSE', `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`);
205
+
206
+ // A simple gt/lt/eq thing, or just "" to indicate "any version"
207
+ createToken('COMPARATORLOOSE', `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`);
208
+ createToken('COMPARATOR', `^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`);
209
+
210
+ // An expression to strip any whitespace between the gtlt and the thing
211
+ // it modifies, so that `> 1.2.3` ==> `>1.2.3`
212
+ createToken('COMPARATORTRIM', `(\\s*)${src[t.GTLT]
213
+ }\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true);
214
+ exports$1.comparatorTrimReplace = '$1$2$3';
215
+
216
+ // Something like `1.2.3 - 1.2.4`
217
+ // Note that these all use the loose form, because they'll be
218
+ // checked against either the strict or loose comparator form
219
+ // later.
220
+ createToken('HYPHENRANGE', `^\\s*(${src[t.XRANGEPLAIN]})` +
221
+ `\\s+-\\s+` +
222
+ `(${src[t.XRANGEPLAIN]})` +
223
+ `\\s*$`);
224
+
225
+ createToken('HYPHENRANGELOOSE', `^\\s*(${src[t.XRANGEPLAINLOOSE]})` +
226
+ `\\s+-\\s+` +
227
+ `(${src[t.XRANGEPLAINLOOSE]})` +
228
+ `\\s*$`);
229
+
230
+ // Star ranges basically just allow anything at all.
231
+ createToken('STAR', '(<|>)?=?\\s*\\*');
232
+ // >=0.0.0 is like a star
233
+ createToken('GTE0', '^\\s*>=\\s*0\\.0\\.0\\s*$');
234
+ createToken('GTE0PRE', '^\\s*>=\\s*0\\.0\\.0-0\\s*$');
235
+ } (re.__module, re.__module.exports));
236
+ return re.__module.exports;
237
+ }
238
+
239
+ exports.__require = requireRe;
@@ -0,0 +1,19 @@
1
+ 'use strict';
2
+
3
+ var outside = require('./outside.js');
4
+
5
+ var gtr_1;
6
+ var hasRequiredGtr;
7
+
8
+ function requireGtr () {
9
+ if (hasRequiredGtr) return gtr_1;
10
+ hasRequiredGtr = 1;
11
+
12
+ // Determine if version is greater than all the versions possible in the range.
13
+ const outside$1 = outside.__require();
14
+ const gtr = (version, range, options) => outside$1(version, range, '>', options);
15
+ gtr_1 = gtr;
16
+ return gtr_1;
17
+ }
18
+
19
+ exports.__require = requireGtr;
@@ -0,0 +1,22 @@
1
+ 'use strict';
2
+
3
+ var range = require('../classes/range.js');
4
+
5
+ var intersects_1;
6
+ var hasRequiredIntersects;
7
+
8
+ function requireIntersects () {
9
+ if (hasRequiredIntersects) return intersects_1;
10
+ hasRequiredIntersects = 1;
11
+
12
+ const Range = range.__require();
13
+ const intersects = (r1, r2, options) => {
14
+ r1 = new Range(r1, options);
15
+ r2 = new Range(r2, options);
16
+ return r1.intersects(r2, options)
17
+ };
18
+ intersects_1 = intersects;
19
+ return intersects_1;
20
+ }
21
+
22
+ exports.__require = requireIntersects;
@@ -0,0 +1,19 @@
1
+ 'use strict';
2
+
3
+ var outside = require('./outside.js');
4
+
5
+ var ltr_1;
6
+ var hasRequiredLtr;
7
+
8
+ function requireLtr () {
9
+ if (hasRequiredLtr) return ltr_1;
10
+ hasRequiredLtr = 1;
11
+
12
+ const outside$1 = outside.__require();
13
+ // Determine if version is less than all the versions possible in the range
14
+ const ltr = (version, range, options) => outside$1(version, range, '<', options);
15
+ ltr_1 = ltr;
16
+ return ltr_1;
17
+ }
18
+
19
+ exports.__require = requireLtr;
@@ -0,0 +1,41 @@
1
+ 'use strict';
2
+
3
+ var semver = require('../classes/semver.js');
4
+ var range = require('../classes/range.js');
5
+
6
+ var maxSatisfying_1;
7
+ var hasRequiredMaxSatisfying;
8
+
9
+ function requireMaxSatisfying () {
10
+ if (hasRequiredMaxSatisfying) return maxSatisfying_1;
11
+ hasRequiredMaxSatisfying = 1;
12
+
13
+ const SemVer = semver.__require();
14
+ const Range = range.__require();
15
+
16
+ const maxSatisfying = (versions, range, options) => {
17
+ let max = null;
18
+ let maxSV = null;
19
+ let rangeObj = null;
20
+ try {
21
+ rangeObj = new Range(range, options);
22
+ } catch (er) {
23
+ return null
24
+ }
25
+ versions.forEach((v) => {
26
+ if (rangeObj.test(v)) {
27
+ // satisfies(v, range, options)
28
+ if (!max || maxSV.compare(v) === -1) {
29
+ // compare(max, v, true)
30
+ max = v;
31
+ maxSV = new SemVer(max, options);
32
+ }
33
+ }
34
+ });
35
+ return max
36
+ };
37
+ maxSatisfying_1 = maxSatisfying;
38
+ return maxSatisfying_1;
39
+ }
40
+
41
+ exports.__require = requireMaxSatisfying;
@@ -0,0 +1,40 @@
1
+ 'use strict';
2
+
3
+ var semver = require('../classes/semver.js');
4
+ var range = require('../classes/range.js');
5
+
6
+ var minSatisfying_1;
7
+ var hasRequiredMinSatisfying;
8
+
9
+ function requireMinSatisfying () {
10
+ if (hasRequiredMinSatisfying) return minSatisfying_1;
11
+ hasRequiredMinSatisfying = 1;
12
+
13
+ const SemVer = semver.__require();
14
+ const Range = range.__require();
15
+ const minSatisfying = (versions, range, options) => {
16
+ let min = null;
17
+ let minSV = null;
18
+ let rangeObj = null;
19
+ try {
20
+ rangeObj = new Range(range, options);
21
+ } catch (er) {
22
+ return null
23
+ }
24
+ versions.forEach((v) => {
25
+ if (rangeObj.test(v)) {
26
+ // satisfies(v, range, options)
27
+ if (!min || minSV.compare(v) === 1) {
28
+ // compare(min, v, true)
29
+ min = v;
30
+ minSV = new SemVer(min, options);
31
+ }
32
+ }
33
+ });
34
+ return min
35
+ };
36
+ minSatisfying_1 = minSatisfying;
37
+ return minSatisfying_1;
38
+ }
39
+
40
+ exports.__require = requireMinSatisfying;
@@ -0,0 +1,78 @@
1
+ 'use strict';
2
+
3
+ var semver = require('../classes/semver.js');
4
+ var range = require('../classes/range.js');
5
+ var gt = require('../functions/gt.js');
6
+
7
+ var minVersion_1;
8
+ var hasRequiredMinVersion;
9
+
10
+ function requireMinVersion () {
11
+ if (hasRequiredMinVersion) return minVersion_1;
12
+ hasRequiredMinVersion = 1;
13
+
14
+ const SemVer = semver.__require();
15
+ const Range = range.__require();
16
+ const gt$1 = gt.__require();
17
+
18
+ const minVersion = (range, loose) => {
19
+ range = new Range(range, loose);
20
+
21
+ let minver = new SemVer('0.0.0');
22
+ if (range.test(minver)) {
23
+ return minver
24
+ }
25
+
26
+ minver = new SemVer('0.0.0-0');
27
+ if (range.test(minver)) {
28
+ return minver
29
+ }
30
+
31
+ minver = null;
32
+ for (let i = 0; i < range.set.length; ++i) {
33
+ const comparators = range.set[i];
34
+
35
+ let setMin = null;
36
+ comparators.forEach((comparator) => {
37
+ // Clone to avoid manipulating the comparator's semver object.
38
+ const compver = new SemVer(comparator.semver.version);
39
+ switch (comparator.operator) {
40
+ case '>':
41
+ if (compver.prerelease.length === 0) {
42
+ compver.patch++;
43
+ } else {
44
+ compver.prerelease.push(0);
45
+ }
46
+ compver.raw = compver.format();
47
+ /* fallthrough */
48
+ case '':
49
+ case '>=':
50
+ if (!setMin || gt$1(compver, setMin)) {
51
+ setMin = compver;
52
+ }
53
+ break
54
+ case '<':
55
+ case '<=':
56
+ /* Ignore maximum versions */
57
+ break
58
+ /* istanbul ignore next */
59
+ default:
60
+ throw new Error(`Unexpected operation: ${comparator.operator}`)
61
+ }
62
+ });
63
+ if (setMin && (!minver || gt$1(minver, setMin))) {
64
+ minver = setMin;
65
+ }
66
+ }
67
+
68
+ if (minver && range.test(minver)) {
69
+ return minver
70
+ }
71
+
72
+ return null
73
+ };
74
+ minVersion_1 = minVersion;
75
+ return minVersion_1;
76
+ }
77
+
78
+ exports.__require = requireMinVersion;
@@ -0,0 +1,102 @@
1
+ 'use strict';
2
+
3
+ var semver = require('../classes/semver.js');
4
+ var comparator = require('../classes/comparator.js');
5
+ var range = require('../classes/range.js');
6
+ var satisfies = require('../functions/satisfies.js');
7
+ var gt = require('../functions/gt.js');
8
+ var lt = require('../functions/lt.js');
9
+ var lte = require('../functions/lte.js');
10
+ var gte = require('../functions/gte.js');
11
+
12
+ var outside_1;
13
+ var hasRequiredOutside;
14
+
15
+ function requireOutside () {
16
+ if (hasRequiredOutside) return outside_1;
17
+ hasRequiredOutside = 1;
18
+
19
+ const SemVer = semver.__require();
20
+ const Comparator = comparator.__require();
21
+ const { ANY } = Comparator;
22
+ const Range = range.__require();
23
+ const satisfies$1 = satisfies.__require();
24
+ const gt$1 = gt.__require();
25
+ const lt$1 = lt.__require();
26
+ const lte$1 = lte.__require();
27
+ const gte$1 = gte.__require();
28
+
29
+ const outside = (version, range, hilo, options) => {
30
+ version = new SemVer(version, options);
31
+ range = new Range(range, options);
32
+
33
+ let gtfn, ltefn, ltfn, comp, ecomp;
34
+ switch (hilo) {
35
+ case '>':
36
+ gtfn = gt$1;
37
+ ltefn = lte$1;
38
+ ltfn = lt$1;
39
+ comp = '>';
40
+ ecomp = '>=';
41
+ break
42
+ case '<':
43
+ gtfn = lt$1;
44
+ ltefn = gte$1;
45
+ ltfn = gt$1;
46
+ comp = '<';
47
+ ecomp = '<=';
48
+ break
49
+ default:
50
+ throw new TypeError('Must provide a hilo val of "<" or ">"')
51
+ }
52
+
53
+ // If it satisfies the range it is not outside
54
+ if (satisfies$1(version, range, options)) {
55
+ return false
56
+ }
57
+
58
+ // From now on, variable terms are as if we're in "gtr" mode.
59
+ // but note that everything is flipped for the "ltr" function.
60
+
61
+ for (let i = 0; i < range.set.length; ++i) {
62
+ const comparators = range.set[i];
63
+
64
+ let high = null;
65
+ let low = null;
66
+
67
+ comparators.forEach((comparator) => {
68
+ if (comparator.semver === ANY) {
69
+ comparator = new Comparator('>=0.0.0');
70
+ }
71
+ high = high || comparator;
72
+ low = low || comparator;
73
+ if (gtfn(comparator.semver, high.semver, options)) {
74
+ high = comparator;
75
+ } else if (ltfn(comparator.semver, low.semver, options)) {
76
+ low = comparator;
77
+ }
78
+ });
79
+
80
+ // If the edge version comparator has a operator then our version
81
+ // isn't outside it
82
+ if (high.operator === comp || high.operator === ecomp) {
83
+ return false
84
+ }
85
+
86
+ // If the lowest version comparator has an operator and our version
87
+ // is less than it then it isn't higher than the range
88
+ if ((!low.operator || low.operator === comp) &&
89
+ ltefn(version, low.semver)) {
90
+ return false
91
+ } else if (low.operator === ecomp && ltfn(version, low.semver)) {
92
+ return false
93
+ }
94
+ }
95
+ return true
96
+ };
97
+
98
+ outside_1 = outside;
99
+ return outside_1;
100
+ }
101
+
102
+ exports.__require = requireOutside;