@ecmaos/kernel 0.2.6 → 0.2.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +141 -98
- package/dist/.vite/manifest.json +14 -14
- package/dist/{browser-C0q0NWWv.js → browser-D_CtuxSB.js} +2 -2
- package/dist/{browser-C0q0NWWv.js.map → browser-D_CtuxSB.js.map} +1 -1
- package/dist/{empty-BMkCc_7L.js → empty--zdtkf0T.js} +2099 -156
- package/dist/empty--zdtkf0T.js.map +1 -0
- package/dist/install-Ds1oWgTf.js +119 -0
- package/dist/install-Ds1oWgTf.js.map +1 -0
- package/dist/kernel.d.ts +18 -3
- package/dist/kernel.js +1 -1
- package/dist/swapi.js +1 -1
- package/dist/{topbar.min-xBbuiIjv.js → topbar.min-CDkSVOxV.js} +2 -2
- package/dist/{topbar.min-xBbuiIjv.js.map → topbar.min-CDkSVOxV.js.map} +1 -1
- package/dist/ui.js +1 -1
- package/package.json +2 -2
- package/dist/empty-BMkCc_7L.js.map +0 -1
- package/dist/install-C64fBUI2.js +0 -1997
- package/dist/install-C64fBUI2.js.map +0 -1
package/dist/install-C64fBUI2.js
DELETED
|
@@ -1,1997 +0,0 @@
|
|
|
1
|
-
import { p as process$1, g as getDefaultExportFromCjs, c as chalk, a as path } from "./empty-BMkCc_7L.js";
|
|
2
|
-
var re = { exports: {} };
|
|
3
|
-
var constants;
|
|
4
|
-
var hasRequiredConstants;
|
|
5
|
-
function requireConstants() {
|
|
6
|
-
if (hasRequiredConstants) return constants;
|
|
7
|
-
hasRequiredConstants = 1;
|
|
8
|
-
const SEMVER_SPEC_VERSION = "2.0.0";
|
|
9
|
-
const MAX_LENGTH = 256;
|
|
10
|
-
const MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */
|
|
11
|
-
9007199254740991;
|
|
12
|
-
const MAX_SAFE_COMPONENT_LENGTH = 16;
|
|
13
|
-
const MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6;
|
|
14
|
-
const RELEASE_TYPES = [
|
|
15
|
-
"major",
|
|
16
|
-
"premajor",
|
|
17
|
-
"minor",
|
|
18
|
-
"preminor",
|
|
19
|
-
"patch",
|
|
20
|
-
"prepatch",
|
|
21
|
-
"prerelease"
|
|
22
|
-
];
|
|
23
|
-
constants = {
|
|
24
|
-
MAX_LENGTH,
|
|
25
|
-
MAX_SAFE_COMPONENT_LENGTH,
|
|
26
|
-
MAX_SAFE_BUILD_LENGTH,
|
|
27
|
-
MAX_SAFE_INTEGER,
|
|
28
|
-
RELEASE_TYPES,
|
|
29
|
-
SEMVER_SPEC_VERSION,
|
|
30
|
-
FLAG_INCLUDE_PRERELEASE: 1,
|
|
31
|
-
FLAG_LOOSE: 2
|
|
32
|
-
};
|
|
33
|
-
return constants;
|
|
34
|
-
}
|
|
35
|
-
var debug_1;
|
|
36
|
-
var hasRequiredDebug;
|
|
37
|
-
function requireDebug() {
|
|
38
|
-
if (hasRequiredDebug) return debug_1;
|
|
39
|
-
hasRequiredDebug = 1;
|
|
40
|
-
const debug = typeof process$1 === "object" && process$1.env && process$1.env.NODE_DEBUG && /\bsemver\b/i.test(process$1.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => {
|
|
41
|
-
};
|
|
42
|
-
debug_1 = debug;
|
|
43
|
-
return debug_1;
|
|
44
|
-
}
|
|
45
|
-
var hasRequiredRe;
|
|
46
|
-
function requireRe() {
|
|
47
|
-
if (hasRequiredRe) return re.exports;
|
|
48
|
-
hasRequiredRe = 1;
|
|
49
|
-
(function(module, exports) {
|
|
50
|
-
const {
|
|
51
|
-
MAX_SAFE_COMPONENT_LENGTH,
|
|
52
|
-
MAX_SAFE_BUILD_LENGTH,
|
|
53
|
-
MAX_LENGTH
|
|
54
|
-
} = requireConstants();
|
|
55
|
-
const debug = requireDebug();
|
|
56
|
-
exports = module.exports = {};
|
|
57
|
-
const re2 = exports.re = [];
|
|
58
|
-
const safeRe = exports.safeRe = [];
|
|
59
|
-
const src = exports.src = [];
|
|
60
|
-
const t = exports.t = {};
|
|
61
|
-
let R = 0;
|
|
62
|
-
const LETTERDASHNUMBER = "[a-zA-Z0-9-]";
|
|
63
|
-
const safeRegexReplacements = [
|
|
64
|
-
["\\s", 1],
|
|
65
|
-
["\\d", MAX_LENGTH],
|
|
66
|
-
[LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH]
|
|
67
|
-
];
|
|
68
|
-
const makeSafeRegex = (value) => {
|
|
69
|
-
for (const [token, max] of safeRegexReplacements) {
|
|
70
|
-
value = value.split(`${token}*`).join(`${token}{0,${max}}`).split(`${token}+`).join(`${token}{1,${max}}`);
|
|
71
|
-
}
|
|
72
|
-
return value;
|
|
73
|
-
};
|
|
74
|
-
const createToken = (name, value, isGlobal) => {
|
|
75
|
-
const safe = makeSafeRegex(value);
|
|
76
|
-
const index = R++;
|
|
77
|
-
debug(name, index, value);
|
|
78
|
-
t[name] = index;
|
|
79
|
-
src[index] = value;
|
|
80
|
-
re2[index] = new RegExp(value, isGlobal ? "g" : void 0);
|
|
81
|
-
safeRe[index] = new RegExp(safe, isGlobal ? "g" : void 0);
|
|
82
|
-
};
|
|
83
|
-
createToken("NUMERICIDENTIFIER", "0|[1-9]\\d*");
|
|
84
|
-
createToken("NUMERICIDENTIFIERLOOSE", "\\d+");
|
|
85
|
-
createToken("NONNUMERICIDENTIFIER", `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`);
|
|
86
|
-
createToken("MAINVERSION", `(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})`);
|
|
87
|
-
createToken("MAINVERSIONLOOSE", `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})`);
|
|
88
|
-
createToken("PRERELEASEIDENTIFIER", `(?:${src[t.NUMERICIDENTIFIER]}|${src[t.NONNUMERICIDENTIFIER]})`);
|
|
89
|
-
createToken("PRERELEASEIDENTIFIERLOOSE", `(?:${src[t.NUMERICIDENTIFIERLOOSE]}|${src[t.NONNUMERICIDENTIFIER]})`);
|
|
90
|
-
createToken("PRERELEASE", `(?:-(${src[t.PRERELEASEIDENTIFIER]}(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`);
|
|
91
|
-
createToken("PRERELEASELOOSE", `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`);
|
|
92
|
-
createToken("BUILDIDENTIFIER", `${LETTERDASHNUMBER}+`);
|
|
93
|
-
createToken("BUILD", `(?:\\+(${src[t.BUILDIDENTIFIER]}(?:\\.${src[t.BUILDIDENTIFIER]})*))`);
|
|
94
|
-
createToken("FULLPLAIN", `v?${src[t.MAINVERSION]}${src[t.PRERELEASE]}?${src[t.BUILD]}?`);
|
|
95
|
-
createToken("FULL", `^${src[t.FULLPLAIN]}$`);
|
|
96
|
-
createToken("LOOSEPLAIN", `[v=\\s]*${src[t.MAINVERSIONLOOSE]}${src[t.PRERELEASELOOSE]}?${src[t.BUILD]}?`);
|
|
97
|
-
createToken("LOOSE", `^${src[t.LOOSEPLAIN]}$`);
|
|
98
|
-
createToken("GTLT", "((?:<|>)?=?)");
|
|
99
|
-
createToken("XRANGEIDENTIFIERLOOSE", `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);
|
|
100
|
-
createToken("XRANGEIDENTIFIER", `${src[t.NUMERICIDENTIFIER]}|x|X|\\*`);
|
|
101
|
-
createToken("XRANGEPLAIN", `[v=\\s]*(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:${src[t.PRERELEASE]})?${src[t.BUILD]}?)?)?`);
|
|
102
|
-
createToken("XRANGEPLAINLOOSE", `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:${src[t.PRERELEASELOOSE]})?${src[t.BUILD]}?)?)?`);
|
|
103
|
-
createToken("XRANGE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`);
|
|
104
|
-
createToken("XRANGELOOSE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`);
|
|
105
|
-
createToken("COERCEPLAIN", `${"(^|[^\\d])(\\d{1,"}${MAX_SAFE_COMPONENT_LENGTH}})(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`);
|
|
106
|
-
createToken("COERCE", `${src[t.COERCEPLAIN]}(?:$|[^\\d])`);
|
|
107
|
-
createToken("COERCEFULL", src[t.COERCEPLAIN] + `(?:${src[t.PRERELEASE]})?(?:${src[t.BUILD]})?(?:$|[^\\d])`);
|
|
108
|
-
createToken("COERCERTL", src[t.COERCE], true);
|
|
109
|
-
createToken("COERCERTLFULL", src[t.COERCEFULL], true);
|
|
110
|
-
createToken("LONETILDE", "(?:~>?)");
|
|
111
|
-
createToken("TILDETRIM", `(\\s*)${src[t.LONETILDE]}\\s+`, true);
|
|
112
|
-
exports.tildeTrimReplace = "$1~";
|
|
113
|
-
createToken("TILDE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`);
|
|
114
|
-
createToken("TILDELOOSE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`);
|
|
115
|
-
createToken("LONECARET", "(?:\\^)");
|
|
116
|
-
createToken("CARETTRIM", `(\\s*)${src[t.LONECARET]}\\s+`, true);
|
|
117
|
-
exports.caretTrimReplace = "$1^";
|
|
118
|
-
createToken("CARET", `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`);
|
|
119
|
-
createToken("CARETLOOSE", `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`);
|
|
120
|
-
createToken("COMPARATORLOOSE", `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`);
|
|
121
|
-
createToken("COMPARATOR", `^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`);
|
|
122
|
-
createToken("COMPARATORTRIM", `(\\s*)${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true);
|
|
123
|
-
exports.comparatorTrimReplace = "$1$2$3";
|
|
124
|
-
createToken("HYPHENRANGE", `^\\s*(${src[t.XRANGEPLAIN]})\\s+-\\s+(${src[t.XRANGEPLAIN]})\\s*$`);
|
|
125
|
-
createToken("HYPHENRANGELOOSE", `^\\s*(${src[t.XRANGEPLAINLOOSE]})\\s+-\\s+(${src[t.XRANGEPLAINLOOSE]})\\s*$`);
|
|
126
|
-
createToken("STAR", "(<|>)?=?\\s*\\*");
|
|
127
|
-
createToken("GTE0", "^\\s*>=\\s*0\\.0\\.0\\s*$");
|
|
128
|
-
createToken("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$");
|
|
129
|
-
})(re, re.exports);
|
|
130
|
-
return re.exports;
|
|
131
|
-
}
|
|
132
|
-
var parseOptions_1;
|
|
133
|
-
var hasRequiredParseOptions;
|
|
134
|
-
function requireParseOptions() {
|
|
135
|
-
if (hasRequiredParseOptions) return parseOptions_1;
|
|
136
|
-
hasRequiredParseOptions = 1;
|
|
137
|
-
const looseOption = Object.freeze({ loose: true });
|
|
138
|
-
const emptyOpts = Object.freeze({});
|
|
139
|
-
const parseOptions = (options) => {
|
|
140
|
-
if (!options) {
|
|
141
|
-
return emptyOpts;
|
|
142
|
-
}
|
|
143
|
-
if (typeof options !== "object") {
|
|
144
|
-
return looseOption;
|
|
145
|
-
}
|
|
146
|
-
return options;
|
|
147
|
-
};
|
|
148
|
-
parseOptions_1 = parseOptions;
|
|
149
|
-
return parseOptions_1;
|
|
150
|
-
}
|
|
151
|
-
var identifiers;
|
|
152
|
-
var hasRequiredIdentifiers;
|
|
153
|
-
function requireIdentifiers() {
|
|
154
|
-
if (hasRequiredIdentifiers) return identifiers;
|
|
155
|
-
hasRequiredIdentifiers = 1;
|
|
156
|
-
const numeric = /^[0-9]+$/;
|
|
157
|
-
const compareIdentifiers = (a, b) => {
|
|
158
|
-
const anum = numeric.test(a);
|
|
159
|
-
const bnum = numeric.test(b);
|
|
160
|
-
if (anum && bnum) {
|
|
161
|
-
a = +a;
|
|
162
|
-
b = +b;
|
|
163
|
-
}
|
|
164
|
-
return a === b ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a < b ? -1 : 1;
|
|
165
|
-
};
|
|
166
|
-
const rcompareIdentifiers = (a, b) => compareIdentifiers(b, a);
|
|
167
|
-
identifiers = {
|
|
168
|
-
compareIdentifiers,
|
|
169
|
-
rcompareIdentifiers
|
|
170
|
-
};
|
|
171
|
-
return identifiers;
|
|
172
|
-
}
|
|
173
|
-
var semver$2;
|
|
174
|
-
var hasRequiredSemver$1;
|
|
175
|
-
function requireSemver$1() {
|
|
176
|
-
if (hasRequiredSemver$1) return semver$2;
|
|
177
|
-
hasRequiredSemver$1 = 1;
|
|
178
|
-
const debug = requireDebug();
|
|
179
|
-
const { MAX_LENGTH, MAX_SAFE_INTEGER } = requireConstants();
|
|
180
|
-
const { safeRe: re2, t } = requireRe();
|
|
181
|
-
const parseOptions = requireParseOptions();
|
|
182
|
-
const { compareIdentifiers } = requireIdentifiers();
|
|
183
|
-
class SemVer {
|
|
184
|
-
constructor(version, options) {
|
|
185
|
-
options = parseOptions(options);
|
|
186
|
-
if (version instanceof SemVer) {
|
|
187
|
-
if (version.loose === !!options.loose && version.includePrerelease === !!options.includePrerelease) {
|
|
188
|
-
return version;
|
|
189
|
-
} else {
|
|
190
|
-
version = version.version;
|
|
191
|
-
}
|
|
192
|
-
} else if (typeof version !== "string") {
|
|
193
|
-
throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version}".`);
|
|
194
|
-
}
|
|
195
|
-
if (version.length > MAX_LENGTH) {
|
|
196
|
-
throw new TypeError(
|
|
197
|
-
`version is longer than ${MAX_LENGTH} characters`
|
|
198
|
-
);
|
|
199
|
-
}
|
|
200
|
-
debug("SemVer", version, options);
|
|
201
|
-
this.options = options;
|
|
202
|
-
this.loose = !!options.loose;
|
|
203
|
-
this.includePrerelease = !!options.includePrerelease;
|
|
204
|
-
const m = version.trim().match(options.loose ? re2[t.LOOSE] : re2[t.FULL]);
|
|
205
|
-
if (!m) {
|
|
206
|
-
throw new TypeError(`Invalid Version: ${version}`);
|
|
207
|
-
}
|
|
208
|
-
this.raw = version;
|
|
209
|
-
this.major = +m[1];
|
|
210
|
-
this.minor = +m[2];
|
|
211
|
-
this.patch = +m[3];
|
|
212
|
-
if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
|
|
213
|
-
throw new TypeError("Invalid major version");
|
|
214
|
-
}
|
|
215
|
-
if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
|
|
216
|
-
throw new TypeError("Invalid minor version");
|
|
217
|
-
}
|
|
218
|
-
if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
|
|
219
|
-
throw new TypeError("Invalid patch version");
|
|
220
|
-
}
|
|
221
|
-
if (!m[4]) {
|
|
222
|
-
this.prerelease = [];
|
|
223
|
-
} else {
|
|
224
|
-
this.prerelease = m[4].split(".").map((id) => {
|
|
225
|
-
if (/^[0-9]+$/.test(id)) {
|
|
226
|
-
const num = +id;
|
|
227
|
-
if (num >= 0 && num < MAX_SAFE_INTEGER) {
|
|
228
|
-
return num;
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
return id;
|
|
232
|
-
});
|
|
233
|
-
}
|
|
234
|
-
this.build = m[5] ? m[5].split(".") : [];
|
|
235
|
-
this.format();
|
|
236
|
-
}
|
|
237
|
-
format() {
|
|
238
|
-
this.version = `${this.major}.${this.minor}.${this.patch}`;
|
|
239
|
-
if (this.prerelease.length) {
|
|
240
|
-
this.version += `-${this.prerelease.join(".")}`;
|
|
241
|
-
}
|
|
242
|
-
return this.version;
|
|
243
|
-
}
|
|
244
|
-
toString() {
|
|
245
|
-
return this.version;
|
|
246
|
-
}
|
|
247
|
-
compare(other) {
|
|
248
|
-
debug("SemVer.compare", this.version, this.options, other);
|
|
249
|
-
if (!(other instanceof SemVer)) {
|
|
250
|
-
if (typeof other === "string" && other === this.version) {
|
|
251
|
-
return 0;
|
|
252
|
-
}
|
|
253
|
-
other = new SemVer(other, this.options);
|
|
254
|
-
}
|
|
255
|
-
if (other.version === this.version) {
|
|
256
|
-
return 0;
|
|
257
|
-
}
|
|
258
|
-
return this.compareMain(other) || this.comparePre(other);
|
|
259
|
-
}
|
|
260
|
-
compareMain(other) {
|
|
261
|
-
if (!(other instanceof SemVer)) {
|
|
262
|
-
other = new SemVer(other, this.options);
|
|
263
|
-
}
|
|
264
|
-
return compareIdentifiers(this.major, other.major) || compareIdentifiers(this.minor, other.minor) || compareIdentifiers(this.patch, other.patch);
|
|
265
|
-
}
|
|
266
|
-
comparePre(other) {
|
|
267
|
-
if (!(other instanceof SemVer)) {
|
|
268
|
-
other = new SemVer(other, this.options);
|
|
269
|
-
}
|
|
270
|
-
if (this.prerelease.length && !other.prerelease.length) {
|
|
271
|
-
return -1;
|
|
272
|
-
} else if (!this.prerelease.length && other.prerelease.length) {
|
|
273
|
-
return 1;
|
|
274
|
-
} else if (!this.prerelease.length && !other.prerelease.length) {
|
|
275
|
-
return 0;
|
|
276
|
-
}
|
|
277
|
-
let i = 0;
|
|
278
|
-
do {
|
|
279
|
-
const a = this.prerelease[i];
|
|
280
|
-
const b = other.prerelease[i];
|
|
281
|
-
debug("prerelease compare", i, a, b);
|
|
282
|
-
if (a === void 0 && b === void 0) {
|
|
283
|
-
return 0;
|
|
284
|
-
} else if (b === void 0) {
|
|
285
|
-
return 1;
|
|
286
|
-
} else if (a === void 0) {
|
|
287
|
-
return -1;
|
|
288
|
-
} else if (a === b) {
|
|
289
|
-
continue;
|
|
290
|
-
} else {
|
|
291
|
-
return compareIdentifiers(a, b);
|
|
292
|
-
}
|
|
293
|
-
} while (++i);
|
|
294
|
-
}
|
|
295
|
-
compareBuild(other) {
|
|
296
|
-
if (!(other instanceof SemVer)) {
|
|
297
|
-
other = new SemVer(other, this.options);
|
|
298
|
-
}
|
|
299
|
-
let i = 0;
|
|
300
|
-
do {
|
|
301
|
-
const a = this.build[i];
|
|
302
|
-
const b = other.build[i];
|
|
303
|
-
debug("build compare", i, a, b);
|
|
304
|
-
if (a === void 0 && b === void 0) {
|
|
305
|
-
return 0;
|
|
306
|
-
} else if (b === void 0) {
|
|
307
|
-
return 1;
|
|
308
|
-
} else if (a === void 0) {
|
|
309
|
-
return -1;
|
|
310
|
-
} else if (a === b) {
|
|
311
|
-
continue;
|
|
312
|
-
} else {
|
|
313
|
-
return compareIdentifiers(a, b);
|
|
314
|
-
}
|
|
315
|
-
} while (++i);
|
|
316
|
-
}
|
|
317
|
-
// preminor will bump the version up to the next minor release, and immediately
|
|
318
|
-
// down to pre-release. premajor and prepatch work the same way.
|
|
319
|
-
inc(release, identifier, identifierBase) {
|
|
320
|
-
switch (release) {
|
|
321
|
-
case "premajor":
|
|
322
|
-
this.prerelease.length = 0;
|
|
323
|
-
this.patch = 0;
|
|
324
|
-
this.minor = 0;
|
|
325
|
-
this.major++;
|
|
326
|
-
this.inc("pre", identifier, identifierBase);
|
|
327
|
-
break;
|
|
328
|
-
case "preminor":
|
|
329
|
-
this.prerelease.length = 0;
|
|
330
|
-
this.patch = 0;
|
|
331
|
-
this.minor++;
|
|
332
|
-
this.inc("pre", identifier, identifierBase);
|
|
333
|
-
break;
|
|
334
|
-
case "prepatch":
|
|
335
|
-
this.prerelease.length = 0;
|
|
336
|
-
this.inc("patch", identifier, identifierBase);
|
|
337
|
-
this.inc("pre", identifier, identifierBase);
|
|
338
|
-
break;
|
|
339
|
-
// If the input is a non-prerelease version, this acts the same as
|
|
340
|
-
// prepatch.
|
|
341
|
-
case "prerelease":
|
|
342
|
-
if (this.prerelease.length === 0) {
|
|
343
|
-
this.inc("patch", identifier, identifierBase);
|
|
344
|
-
}
|
|
345
|
-
this.inc("pre", identifier, identifierBase);
|
|
346
|
-
break;
|
|
347
|
-
case "major":
|
|
348
|
-
if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) {
|
|
349
|
-
this.major++;
|
|
350
|
-
}
|
|
351
|
-
this.minor = 0;
|
|
352
|
-
this.patch = 0;
|
|
353
|
-
this.prerelease = [];
|
|
354
|
-
break;
|
|
355
|
-
case "minor":
|
|
356
|
-
if (this.patch !== 0 || this.prerelease.length === 0) {
|
|
357
|
-
this.minor++;
|
|
358
|
-
}
|
|
359
|
-
this.patch = 0;
|
|
360
|
-
this.prerelease = [];
|
|
361
|
-
break;
|
|
362
|
-
case "patch":
|
|
363
|
-
if (this.prerelease.length === 0) {
|
|
364
|
-
this.patch++;
|
|
365
|
-
}
|
|
366
|
-
this.prerelease = [];
|
|
367
|
-
break;
|
|
368
|
-
// This probably shouldn't be used publicly.
|
|
369
|
-
// 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction.
|
|
370
|
-
case "pre": {
|
|
371
|
-
const base = Number(identifierBase) ? 1 : 0;
|
|
372
|
-
if (!identifier && identifierBase === false) {
|
|
373
|
-
throw new Error("invalid increment argument: identifier is empty");
|
|
374
|
-
}
|
|
375
|
-
if (this.prerelease.length === 0) {
|
|
376
|
-
this.prerelease = [base];
|
|
377
|
-
} else {
|
|
378
|
-
let i = this.prerelease.length;
|
|
379
|
-
while (--i >= 0) {
|
|
380
|
-
if (typeof this.prerelease[i] === "number") {
|
|
381
|
-
this.prerelease[i]++;
|
|
382
|
-
i = -2;
|
|
383
|
-
}
|
|
384
|
-
}
|
|
385
|
-
if (i === -1) {
|
|
386
|
-
if (identifier === this.prerelease.join(".") && identifierBase === false) {
|
|
387
|
-
throw new Error("invalid increment argument: identifier already exists");
|
|
388
|
-
}
|
|
389
|
-
this.prerelease.push(base);
|
|
390
|
-
}
|
|
391
|
-
}
|
|
392
|
-
if (identifier) {
|
|
393
|
-
let prerelease = [identifier, base];
|
|
394
|
-
if (identifierBase === false) {
|
|
395
|
-
prerelease = [identifier];
|
|
396
|
-
}
|
|
397
|
-
if (compareIdentifiers(this.prerelease[0], identifier) === 0) {
|
|
398
|
-
if (isNaN(this.prerelease[1])) {
|
|
399
|
-
this.prerelease = prerelease;
|
|
400
|
-
}
|
|
401
|
-
} else {
|
|
402
|
-
this.prerelease = prerelease;
|
|
403
|
-
}
|
|
404
|
-
}
|
|
405
|
-
break;
|
|
406
|
-
}
|
|
407
|
-
default:
|
|
408
|
-
throw new Error(`invalid increment argument: ${release}`);
|
|
409
|
-
}
|
|
410
|
-
this.raw = this.format();
|
|
411
|
-
if (this.build.length) {
|
|
412
|
-
this.raw += `+${this.build.join(".")}`;
|
|
413
|
-
}
|
|
414
|
-
return this;
|
|
415
|
-
}
|
|
416
|
-
}
|
|
417
|
-
semver$2 = SemVer;
|
|
418
|
-
return semver$2;
|
|
419
|
-
}
|
|
420
|
-
var parse_1;
|
|
421
|
-
var hasRequiredParse;
|
|
422
|
-
function requireParse() {
|
|
423
|
-
if (hasRequiredParse) return parse_1;
|
|
424
|
-
hasRequiredParse = 1;
|
|
425
|
-
const SemVer = requireSemver$1();
|
|
426
|
-
const parse = (version, options, throwErrors = false) => {
|
|
427
|
-
if (version instanceof SemVer) {
|
|
428
|
-
return version;
|
|
429
|
-
}
|
|
430
|
-
try {
|
|
431
|
-
return new SemVer(version, options);
|
|
432
|
-
} catch (er) {
|
|
433
|
-
if (!throwErrors) {
|
|
434
|
-
return null;
|
|
435
|
-
}
|
|
436
|
-
throw er;
|
|
437
|
-
}
|
|
438
|
-
};
|
|
439
|
-
parse_1 = parse;
|
|
440
|
-
return parse_1;
|
|
441
|
-
}
|
|
442
|
-
var valid_1;
|
|
443
|
-
var hasRequiredValid$1;
|
|
444
|
-
function requireValid$1() {
|
|
445
|
-
if (hasRequiredValid$1) return valid_1;
|
|
446
|
-
hasRequiredValid$1 = 1;
|
|
447
|
-
const parse = requireParse();
|
|
448
|
-
const valid2 = (version, options) => {
|
|
449
|
-
const v = parse(version, options);
|
|
450
|
-
return v ? v.version : null;
|
|
451
|
-
};
|
|
452
|
-
valid_1 = valid2;
|
|
453
|
-
return valid_1;
|
|
454
|
-
}
|
|
455
|
-
var clean_1;
|
|
456
|
-
var hasRequiredClean;
|
|
457
|
-
function requireClean() {
|
|
458
|
-
if (hasRequiredClean) return clean_1;
|
|
459
|
-
hasRequiredClean = 1;
|
|
460
|
-
const parse = requireParse();
|
|
461
|
-
const clean = (version, options) => {
|
|
462
|
-
const s = parse(version.trim().replace(/^[=v]+/, ""), options);
|
|
463
|
-
return s ? s.version : null;
|
|
464
|
-
};
|
|
465
|
-
clean_1 = clean;
|
|
466
|
-
return clean_1;
|
|
467
|
-
}
|
|
468
|
-
var inc_1;
|
|
469
|
-
var hasRequiredInc;
|
|
470
|
-
function requireInc() {
|
|
471
|
-
if (hasRequiredInc) return inc_1;
|
|
472
|
-
hasRequiredInc = 1;
|
|
473
|
-
const SemVer = requireSemver$1();
|
|
474
|
-
const inc = (version, release, options, identifier, identifierBase) => {
|
|
475
|
-
if (typeof options === "string") {
|
|
476
|
-
identifierBase = identifier;
|
|
477
|
-
identifier = options;
|
|
478
|
-
options = void 0;
|
|
479
|
-
}
|
|
480
|
-
try {
|
|
481
|
-
return new SemVer(
|
|
482
|
-
version instanceof SemVer ? version.version : version,
|
|
483
|
-
options
|
|
484
|
-
).inc(release, identifier, identifierBase).version;
|
|
485
|
-
} catch (er) {
|
|
486
|
-
return null;
|
|
487
|
-
}
|
|
488
|
-
};
|
|
489
|
-
inc_1 = inc;
|
|
490
|
-
return inc_1;
|
|
491
|
-
}
|
|
492
|
-
var diff_1;
|
|
493
|
-
var hasRequiredDiff;
|
|
494
|
-
function requireDiff() {
|
|
495
|
-
if (hasRequiredDiff) return diff_1;
|
|
496
|
-
hasRequiredDiff = 1;
|
|
497
|
-
const parse = requireParse();
|
|
498
|
-
const diff = (version1, version2) => {
|
|
499
|
-
const v1 = parse(version1, null, true);
|
|
500
|
-
const v2 = parse(version2, null, true);
|
|
501
|
-
const comparison = v1.compare(v2);
|
|
502
|
-
if (comparison === 0) {
|
|
503
|
-
return null;
|
|
504
|
-
}
|
|
505
|
-
const v1Higher = comparison > 0;
|
|
506
|
-
const highVersion = v1Higher ? v1 : v2;
|
|
507
|
-
const lowVersion = v1Higher ? v2 : v1;
|
|
508
|
-
const highHasPre = !!highVersion.prerelease.length;
|
|
509
|
-
const lowHasPre = !!lowVersion.prerelease.length;
|
|
510
|
-
if (lowHasPre && !highHasPre) {
|
|
511
|
-
if (!lowVersion.patch && !lowVersion.minor) {
|
|
512
|
-
return "major";
|
|
513
|
-
}
|
|
514
|
-
if (highVersion.patch) {
|
|
515
|
-
return "patch";
|
|
516
|
-
}
|
|
517
|
-
if (highVersion.minor) {
|
|
518
|
-
return "minor";
|
|
519
|
-
}
|
|
520
|
-
return "major";
|
|
521
|
-
}
|
|
522
|
-
const prefix = highHasPre ? "pre" : "";
|
|
523
|
-
if (v1.major !== v2.major) {
|
|
524
|
-
return prefix + "major";
|
|
525
|
-
}
|
|
526
|
-
if (v1.minor !== v2.minor) {
|
|
527
|
-
return prefix + "minor";
|
|
528
|
-
}
|
|
529
|
-
if (v1.patch !== v2.patch) {
|
|
530
|
-
return prefix + "patch";
|
|
531
|
-
}
|
|
532
|
-
return "prerelease";
|
|
533
|
-
};
|
|
534
|
-
diff_1 = diff;
|
|
535
|
-
return diff_1;
|
|
536
|
-
}
|
|
537
|
-
var major_1;
|
|
538
|
-
var hasRequiredMajor;
|
|
539
|
-
function requireMajor() {
|
|
540
|
-
if (hasRequiredMajor) return major_1;
|
|
541
|
-
hasRequiredMajor = 1;
|
|
542
|
-
const SemVer = requireSemver$1();
|
|
543
|
-
const major = (a, loose) => new SemVer(a, loose).major;
|
|
544
|
-
major_1 = major;
|
|
545
|
-
return major_1;
|
|
546
|
-
}
|
|
547
|
-
var minor_1;
|
|
548
|
-
var hasRequiredMinor;
|
|
549
|
-
function requireMinor() {
|
|
550
|
-
if (hasRequiredMinor) return minor_1;
|
|
551
|
-
hasRequiredMinor = 1;
|
|
552
|
-
const SemVer = requireSemver$1();
|
|
553
|
-
const minor = (a, loose) => new SemVer(a, loose).minor;
|
|
554
|
-
minor_1 = minor;
|
|
555
|
-
return minor_1;
|
|
556
|
-
}
|
|
557
|
-
var patch_1;
|
|
558
|
-
var hasRequiredPatch;
|
|
559
|
-
function requirePatch() {
|
|
560
|
-
if (hasRequiredPatch) return patch_1;
|
|
561
|
-
hasRequiredPatch = 1;
|
|
562
|
-
const SemVer = requireSemver$1();
|
|
563
|
-
const patch = (a, loose) => new SemVer(a, loose).patch;
|
|
564
|
-
patch_1 = patch;
|
|
565
|
-
return patch_1;
|
|
566
|
-
}
|
|
567
|
-
var prerelease_1;
|
|
568
|
-
var hasRequiredPrerelease;
|
|
569
|
-
function requirePrerelease() {
|
|
570
|
-
if (hasRequiredPrerelease) return prerelease_1;
|
|
571
|
-
hasRequiredPrerelease = 1;
|
|
572
|
-
const parse = requireParse();
|
|
573
|
-
const prerelease = (version, options) => {
|
|
574
|
-
const parsed = parse(version, options);
|
|
575
|
-
return parsed && parsed.prerelease.length ? parsed.prerelease : null;
|
|
576
|
-
};
|
|
577
|
-
prerelease_1 = prerelease;
|
|
578
|
-
return prerelease_1;
|
|
579
|
-
}
|
|
580
|
-
var compare_1;
|
|
581
|
-
var hasRequiredCompare;
|
|
582
|
-
function requireCompare() {
|
|
583
|
-
if (hasRequiredCompare) return compare_1;
|
|
584
|
-
hasRequiredCompare = 1;
|
|
585
|
-
const SemVer = requireSemver$1();
|
|
586
|
-
const compare = (a, b, loose) => new SemVer(a, loose).compare(new SemVer(b, loose));
|
|
587
|
-
compare_1 = compare;
|
|
588
|
-
return compare_1;
|
|
589
|
-
}
|
|
590
|
-
var rcompare_1;
|
|
591
|
-
var hasRequiredRcompare;
|
|
592
|
-
function requireRcompare() {
|
|
593
|
-
if (hasRequiredRcompare) return rcompare_1;
|
|
594
|
-
hasRequiredRcompare = 1;
|
|
595
|
-
const compare = requireCompare();
|
|
596
|
-
const rcompare = (a, b, loose) => compare(b, a, loose);
|
|
597
|
-
rcompare_1 = rcompare;
|
|
598
|
-
return rcompare_1;
|
|
599
|
-
}
|
|
600
|
-
var compareLoose_1;
|
|
601
|
-
var hasRequiredCompareLoose;
|
|
602
|
-
function requireCompareLoose() {
|
|
603
|
-
if (hasRequiredCompareLoose) return compareLoose_1;
|
|
604
|
-
hasRequiredCompareLoose = 1;
|
|
605
|
-
const compare = requireCompare();
|
|
606
|
-
const compareLoose = (a, b) => compare(a, b, true);
|
|
607
|
-
compareLoose_1 = compareLoose;
|
|
608
|
-
return compareLoose_1;
|
|
609
|
-
}
|
|
610
|
-
var compareBuild_1;
|
|
611
|
-
var hasRequiredCompareBuild;
|
|
612
|
-
function requireCompareBuild() {
|
|
613
|
-
if (hasRequiredCompareBuild) return compareBuild_1;
|
|
614
|
-
hasRequiredCompareBuild = 1;
|
|
615
|
-
const SemVer = requireSemver$1();
|
|
616
|
-
const compareBuild = (a, b, loose) => {
|
|
617
|
-
const versionA = new SemVer(a, loose);
|
|
618
|
-
const versionB = new SemVer(b, loose);
|
|
619
|
-
return versionA.compare(versionB) || versionA.compareBuild(versionB);
|
|
620
|
-
};
|
|
621
|
-
compareBuild_1 = compareBuild;
|
|
622
|
-
return compareBuild_1;
|
|
623
|
-
}
|
|
624
|
-
var sort_1;
|
|
625
|
-
var hasRequiredSort;
|
|
626
|
-
function requireSort() {
|
|
627
|
-
if (hasRequiredSort) return sort_1;
|
|
628
|
-
hasRequiredSort = 1;
|
|
629
|
-
const compareBuild = requireCompareBuild();
|
|
630
|
-
const sort = (list, loose) => list.sort((a, b) => compareBuild(a, b, loose));
|
|
631
|
-
sort_1 = sort;
|
|
632
|
-
return sort_1;
|
|
633
|
-
}
|
|
634
|
-
var rsort_1;
|
|
635
|
-
var hasRequiredRsort;
|
|
636
|
-
function requireRsort() {
|
|
637
|
-
if (hasRequiredRsort) return rsort_1;
|
|
638
|
-
hasRequiredRsort = 1;
|
|
639
|
-
const compareBuild = requireCompareBuild();
|
|
640
|
-
const rsort = (list, loose) => list.sort((a, b) => compareBuild(b, a, loose));
|
|
641
|
-
rsort_1 = rsort;
|
|
642
|
-
return rsort_1;
|
|
643
|
-
}
|
|
644
|
-
var gt_1;
|
|
645
|
-
var hasRequiredGt;
|
|
646
|
-
function requireGt() {
|
|
647
|
-
if (hasRequiredGt) return gt_1;
|
|
648
|
-
hasRequiredGt = 1;
|
|
649
|
-
const compare = requireCompare();
|
|
650
|
-
const gt = (a, b, loose) => compare(a, b, loose) > 0;
|
|
651
|
-
gt_1 = gt;
|
|
652
|
-
return gt_1;
|
|
653
|
-
}
|
|
654
|
-
var lt_1;
|
|
655
|
-
var hasRequiredLt;
|
|
656
|
-
function requireLt() {
|
|
657
|
-
if (hasRequiredLt) return lt_1;
|
|
658
|
-
hasRequiredLt = 1;
|
|
659
|
-
const compare = requireCompare();
|
|
660
|
-
const lt = (a, b, loose) => compare(a, b, loose) < 0;
|
|
661
|
-
lt_1 = lt;
|
|
662
|
-
return lt_1;
|
|
663
|
-
}
|
|
664
|
-
var eq_1;
|
|
665
|
-
var hasRequiredEq;
|
|
666
|
-
function requireEq() {
|
|
667
|
-
if (hasRequiredEq) return eq_1;
|
|
668
|
-
hasRequiredEq = 1;
|
|
669
|
-
const compare = requireCompare();
|
|
670
|
-
const eq = (a, b, loose) => compare(a, b, loose) === 0;
|
|
671
|
-
eq_1 = eq;
|
|
672
|
-
return eq_1;
|
|
673
|
-
}
|
|
674
|
-
var neq_1;
|
|
675
|
-
var hasRequiredNeq;
|
|
676
|
-
function requireNeq() {
|
|
677
|
-
if (hasRequiredNeq) return neq_1;
|
|
678
|
-
hasRequiredNeq = 1;
|
|
679
|
-
const compare = requireCompare();
|
|
680
|
-
const neq = (a, b, loose) => compare(a, b, loose) !== 0;
|
|
681
|
-
neq_1 = neq;
|
|
682
|
-
return neq_1;
|
|
683
|
-
}
|
|
684
|
-
var gte_1;
|
|
685
|
-
var hasRequiredGte;
|
|
686
|
-
function requireGte() {
|
|
687
|
-
if (hasRequiredGte) return gte_1;
|
|
688
|
-
hasRequiredGte = 1;
|
|
689
|
-
const compare = requireCompare();
|
|
690
|
-
const gte = (a, b, loose) => compare(a, b, loose) >= 0;
|
|
691
|
-
gte_1 = gte;
|
|
692
|
-
return gte_1;
|
|
693
|
-
}
|
|
694
|
-
var lte_1;
|
|
695
|
-
var hasRequiredLte;
|
|
696
|
-
function requireLte() {
|
|
697
|
-
if (hasRequiredLte) return lte_1;
|
|
698
|
-
hasRequiredLte = 1;
|
|
699
|
-
const compare = requireCompare();
|
|
700
|
-
const lte = (a, b, loose) => compare(a, b, loose) <= 0;
|
|
701
|
-
lte_1 = lte;
|
|
702
|
-
return lte_1;
|
|
703
|
-
}
|
|
704
|
-
var cmp_1;
|
|
705
|
-
var hasRequiredCmp;
|
|
706
|
-
function requireCmp() {
|
|
707
|
-
if (hasRequiredCmp) return cmp_1;
|
|
708
|
-
hasRequiredCmp = 1;
|
|
709
|
-
const eq = requireEq();
|
|
710
|
-
const neq = requireNeq();
|
|
711
|
-
const gt = requireGt();
|
|
712
|
-
const gte = requireGte();
|
|
713
|
-
const lt = requireLt();
|
|
714
|
-
const lte = requireLte();
|
|
715
|
-
const cmp = (a, op, b, loose) => {
|
|
716
|
-
switch (op) {
|
|
717
|
-
case "===":
|
|
718
|
-
if (typeof a === "object") {
|
|
719
|
-
a = a.version;
|
|
720
|
-
}
|
|
721
|
-
if (typeof b === "object") {
|
|
722
|
-
b = b.version;
|
|
723
|
-
}
|
|
724
|
-
return a === b;
|
|
725
|
-
case "!==":
|
|
726
|
-
if (typeof a === "object") {
|
|
727
|
-
a = a.version;
|
|
728
|
-
}
|
|
729
|
-
if (typeof b === "object") {
|
|
730
|
-
b = b.version;
|
|
731
|
-
}
|
|
732
|
-
return a !== b;
|
|
733
|
-
case "":
|
|
734
|
-
case "=":
|
|
735
|
-
case "==":
|
|
736
|
-
return eq(a, b, loose);
|
|
737
|
-
case "!=":
|
|
738
|
-
return neq(a, b, loose);
|
|
739
|
-
case ">":
|
|
740
|
-
return gt(a, b, loose);
|
|
741
|
-
case ">=":
|
|
742
|
-
return gte(a, b, loose);
|
|
743
|
-
case "<":
|
|
744
|
-
return lt(a, b, loose);
|
|
745
|
-
case "<=":
|
|
746
|
-
return lte(a, b, loose);
|
|
747
|
-
default:
|
|
748
|
-
throw new TypeError(`Invalid operator: ${op}`);
|
|
749
|
-
}
|
|
750
|
-
};
|
|
751
|
-
cmp_1 = cmp;
|
|
752
|
-
return cmp_1;
|
|
753
|
-
}
|
|
754
|
-
var coerce_1;
|
|
755
|
-
var hasRequiredCoerce;
|
|
756
|
-
function requireCoerce() {
|
|
757
|
-
if (hasRequiredCoerce) return coerce_1;
|
|
758
|
-
hasRequiredCoerce = 1;
|
|
759
|
-
const SemVer = requireSemver$1();
|
|
760
|
-
const parse = requireParse();
|
|
761
|
-
const { safeRe: re2, t } = requireRe();
|
|
762
|
-
const coerce = (version, options) => {
|
|
763
|
-
if (version instanceof SemVer) {
|
|
764
|
-
return version;
|
|
765
|
-
}
|
|
766
|
-
if (typeof version === "number") {
|
|
767
|
-
version = String(version);
|
|
768
|
-
}
|
|
769
|
-
if (typeof version !== "string") {
|
|
770
|
-
return null;
|
|
771
|
-
}
|
|
772
|
-
options = options || {};
|
|
773
|
-
let match = null;
|
|
774
|
-
if (!options.rtl) {
|
|
775
|
-
match = version.match(options.includePrerelease ? re2[t.COERCEFULL] : re2[t.COERCE]);
|
|
776
|
-
} else {
|
|
777
|
-
const coerceRtlRegex = options.includePrerelease ? re2[t.COERCERTLFULL] : re2[t.COERCERTL];
|
|
778
|
-
let next;
|
|
779
|
-
while ((next = coerceRtlRegex.exec(version)) && (!match || match.index + match[0].length !== version.length)) {
|
|
780
|
-
if (!match || next.index + next[0].length !== match.index + match[0].length) {
|
|
781
|
-
match = next;
|
|
782
|
-
}
|
|
783
|
-
coerceRtlRegex.lastIndex = next.index + next[1].length + next[2].length;
|
|
784
|
-
}
|
|
785
|
-
coerceRtlRegex.lastIndex = -1;
|
|
786
|
-
}
|
|
787
|
-
if (match === null) {
|
|
788
|
-
return null;
|
|
789
|
-
}
|
|
790
|
-
const major = match[2];
|
|
791
|
-
const minor = match[3] || "0";
|
|
792
|
-
const patch = match[4] || "0";
|
|
793
|
-
const prerelease = options.includePrerelease && match[5] ? `-${match[5]}` : "";
|
|
794
|
-
const build = options.includePrerelease && match[6] ? `+${match[6]}` : "";
|
|
795
|
-
return parse(`${major}.${minor}.${patch}${prerelease}${build}`, options);
|
|
796
|
-
};
|
|
797
|
-
coerce_1 = coerce;
|
|
798
|
-
return coerce_1;
|
|
799
|
-
}
|
|
800
|
-
var lrucache;
|
|
801
|
-
var hasRequiredLrucache;
|
|
802
|
-
function requireLrucache() {
|
|
803
|
-
if (hasRequiredLrucache) return lrucache;
|
|
804
|
-
hasRequiredLrucache = 1;
|
|
805
|
-
class LRUCache {
|
|
806
|
-
constructor() {
|
|
807
|
-
this.max = 1e3;
|
|
808
|
-
this.map = /* @__PURE__ */ new Map();
|
|
809
|
-
}
|
|
810
|
-
get(key) {
|
|
811
|
-
const value = this.map.get(key);
|
|
812
|
-
if (value === void 0) {
|
|
813
|
-
return void 0;
|
|
814
|
-
} else {
|
|
815
|
-
this.map.delete(key);
|
|
816
|
-
this.map.set(key, value);
|
|
817
|
-
return value;
|
|
818
|
-
}
|
|
819
|
-
}
|
|
820
|
-
delete(key) {
|
|
821
|
-
return this.map.delete(key);
|
|
822
|
-
}
|
|
823
|
-
set(key, value) {
|
|
824
|
-
const deleted = this.delete(key);
|
|
825
|
-
if (!deleted && value !== void 0) {
|
|
826
|
-
if (this.map.size >= this.max) {
|
|
827
|
-
const firstKey = this.map.keys().next().value;
|
|
828
|
-
this.delete(firstKey);
|
|
829
|
-
}
|
|
830
|
-
this.map.set(key, value);
|
|
831
|
-
}
|
|
832
|
-
return this;
|
|
833
|
-
}
|
|
834
|
-
}
|
|
835
|
-
lrucache = LRUCache;
|
|
836
|
-
return lrucache;
|
|
837
|
-
}
|
|
838
|
-
var range;
|
|
839
|
-
var hasRequiredRange;
|
|
840
|
-
function requireRange() {
|
|
841
|
-
if (hasRequiredRange) return range;
|
|
842
|
-
hasRequiredRange = 1;
|
|
843
|
-
const SPACE_CHARACTERS = /\s+/g;
|
|
844
|
-
class Range {
|
|
845
|
-
constructor(range2, options) {
|
|
846
|
-
options = parseOptions(options);
|
|
847
|
-
if (range2 instanceof Range) {
|
|
848
|
-
if (range2.loose === !!options.loose && range2.includePrerelease === !!options.includePrerelease) {
|
|
849
|
-
return range2;
|
|
850
|
-
} else {
|
|
851
|
-
return new Range(range2.raw, options);
|
|
852
|
-
}
|
|
853
|
-
}
|
|
854
|
-
if (range2 instanceof Comparator) {
|
|
855
|
-
this.raw = range2.value;
|
|
856
|
-
this.set = [[range2]];
|
|
857
|
-
this.formatted = void 0;
|
|
858
|
-
return this;
|
|
859
|
-
}
|
|
860
|
-
this.options = options;
|
|
861
|
-
this.loose = !!options.loose;
|
|
862
|
-
this.includePrerelease = !!options.includePrerelease;
|
|
863
|
-
this.raw = range2.trim().replace(SPACE_CHARACTERS, " ");
|
|
864
|
-
this.set = this.raw.split("||").map((r) => this.parseRange(r.trim())).filter((c) => c.length);
|
|
865
|
-
if (!this.set.length) {
|
|
866
|
-
throw new TypeError(`Invalid SemVer Range: ${this.raw}`);
|
|
867
|
-
}
|
|
868
|
-
if (this.set.length > 1) {
|
|
869
|
-
const first = this.set[0];
|
|
870
|
-
this.set = this.set.filter((c) => !isNullSet(c[0]));
|
|
871
|
-
if (this.set.length === 0) {
|
|
872
|
-
this.set = [first];
|
|
873
|
-
} else if (this.set.length > 1) {
|
|
874
|
-
for (const c of this.set) {
|
|
875
|
-
if (c.length === 1 && isAny(c[0])) {
|
|
876
|
-
this.set = [c];
|
|
877
|
-
break;
|
|
878
|
-
}
|
|
879
|
-
}
|
|
880
|
-
}
|
|
881
|
-
}
|
|
882
|
-
this.formatted = void 0;
|
|
883
|
-
}
|
|
884
|
-
get range() {
|
|
885
|
-
if (this.formatted === void 0) {
|
|
886
|
-
this.formatted = "";
|
|
887
|
-
for (let i = 0; i < this.set.length; i++) {
|
|
888
|
-
if (i > 0) {
|
|
889
|
-
this.formatted += "||";
|
|
890
|
-
}
|
|
891
|
-
const comps = this.set[i];
|
|
892
|
-
for (let k = 0; k < comps.length; k++) {
|
|
893
|
-
if (k > 0) {
|
|
894
|
-
this.formatted += " ";
|
|
895
|
-
}
|
|
896
|
-
this.formatted += comps[k].toString().trim();
|
|
897
|
-
}
|
|
898
|
-
}
|
|
899
|
-
}
|
|
900
|
-
return this.formatted;
|
|
901
|
-
}
|
|
902
|
-
format() {
|
|
903
|
-
return this.range;
|
|
904
|
-
}
|
|
905
|
-
toString() {
|
|
906
|
-
return this.range;
|
|
907
|
-
}
|
|
908
|
-
parseRange(range2) {
|
|
909
|
-
const memoOpts = (this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) | (this.options.loose && FLAG_LOOSE);
|
|
910
|
-
const memoKey = memoOpts + ":" + range2;
|
|
911
|
-
const cached = cache.get(memoKey);
|
|
912
|
-
if (cached) {
|
|
913
|
-
return cached;
|
|
914
|
-
}
|
|
915
|
-
const loose = this.options.loose;
|
|
916
|
-
const hr = loose ? re2[t.HYPHENRANGELOOSE] : re2[t.HYPHENRANGE];
|
|
917
|
-
range2 = range2.replace(hr, hyphenReplace(this.options.includePrerelease));
|
|
918
|
-
debug("hyphen replace", range2);
|
|
919
|
-
range2 = range2.replace(re2[t.COMPARATORTRIM], comparatorTrimReplace);
|
|
920
|
-
debug("comparator trim", range2);
|
|
921
|
-
range2 = range2.replace(re2[t.TILDETRIM], tildeTrimReplace);
|
|
922
|
-
debug("tilde trim", range2);
|
|
923
|
-
range2 = range2.replace(re2[t.CARETTRIM], caretTrimReplace);
|
|
924
|
-
debug("caret trim", range2);
|
|
925
|
-
let rangeList = range2.split(" ").map((comp) => parseComparator(comp, this.options)).join(" ").split(/\s+/).map((comp) => replaceGTE0(comp, this.options));
|
|
926
|
-
if (loose) {
|
|
927
|
-
rangeList = rangeList.filter((comp) => {
|
|
928
|
-
debug("loose invalid filter", comp, this.options);
|
|
929
|
-
return !!comp.match(re2[t.COMPARATORLOOSE]);
|
|
930
|
-
});
|
|
931
|
-
}
|
|
932
|
-
debug("range list", rangeList);
|
|
933
|
-
const rangeMap = /* @__PURE__ */ new Map();
|
|
934
|
-
const comparators = rangeList.map((comp) => new Comparator(comp, this.options));
|
|
935
|
-
for (const comp of comparators) {
|
|
936
|
-
if (isNullSet(comp)) {
|
|
937
|
-
return [comp];
|
|
938
|
-
}
|
|
939
|
-
rangeMap.set(comp.value, comp);
|
|
940
|
-
}
|
|
941
|
-
if (rangeMap.size > 1 && rangeMap.has("")) {
|
|
942
|
-
rangeMap.delete("");
|
|
943
|
-
}
|
|
944
|
-
const result = [...rangeMap.values()];
|
|
945
|
-
cache.set(memoKey, result);
|
|
946
|
-
return result;
|
|
947
|
-
}
|
|
948
|
-
intersects(range2, options) {
|
|
949
|
-
if (!(range2 instanceof Range)) {
|
|
950
|
-
throw new TypeError("a Range is required");
|
|
951
|
-
}
|
|
952
|
-
return this.set.some((thisComparators) => {
|
|
953
|
-
return isSatisfiable(thisComparators, options) && range2.set.some((rangeComparators) => {
|
|
954
|
-
return isSatisfiable(rangeComparators, options) && thisComparators.every((thisComparator) => {
|
|
955
|
-
return rangeComparators.every((rangeComparator) => {
|
|
956
|
-
return thisComparator.intersects(rangeComparator, options);
|
|
957
|
-
});
|
|
958
|
-
});
|
|
959
|
-
});
|
|
960
|
-
});
|
|
961
|
-
}
|
|
962
|
-
// if ANY of the sets match ALL of its comparators, then pass
|
|
963
|
-
test(version) {
|
|
964
|
-
if (!version) {
|
|
965
|
-
return false;
|
|
966
|
-
}
|
|
967
|
-
if (typeof version === "string") {
|
|
968
|
-
try {
|
|
969
|
-
version = new SemVer(version, this.options);
|
|
970
|
-
} catch (er) {
|
|
971
|
-
return false;
|
|
972
|
-
}
|
|
973
|
-
}
|
|
974
|
-
for (let i = 0; i < this.set.length; i++) {
|
|
975
|
-
if (testSet(this.set[i], version, this.options)) {
|
|
976
|
-
return true;
|
|
977
|
-
}
|
|
978
|
-
}
|
|
979
|
-
return false;
|
|
980
|
-
}
|
|
981
|
-
}
|
|
982
|
-
range = Range;
|
|
983
|
-
const LRU = requireLrucache();
|
|
984
|
-
const cache = new LRU();
|
|
985
|
-
const parseOptions = requireParseOptions();
|
|
986
|
-
const Comparator = requireComparator();
|
|
987
|
-
const debug = requireDebug();
|
|
988
|
-
const SemVer = requireSemver$1();
|
|
989
|
-
const {
|
|
990
|
-
safeRe: re2,
|
|
991
|
-
t,
|
|
992
|
-
comparatorTrimReplace,
|
|
993
|
-
tildeTrimReplace,
|
|
994
|
-
caretTrimReplace
|
|
995
|
-
} = requireRe();
|
|
996
|
-
const { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = requireConstants();
|
|
997
|
-
const isNullSet = (c) => c.value === "<0.0.0-0";
|
|
998
|
-
const isAny = (c) => c.value === "";
|
|
999
|
-
const isSatisfiable = (comparators, options) => {
|
|
1000
|
-
let result = true;
|
|
1001
|
-
const remainingComparators = comparators.slice();
|
|
1002
|
-
let testComparator = remainingComparators.pop();
|
|
1003
|
-
while (result && remainingComparators.length) {
|
|
1004
|
-
result = remainingComparators.every((otherComparator) => {
|
|
1005
|
-
return testComparator.intersects(otherComparator, options);
|
|
1006
|
-
});
|
|
1007
|
-
testComparator = remainingComparators.pop();
|
|
1008
|
-
}
|
|
1009
|
-
return result;
|
|
1010
|
-
};
|
|
1011
|
-
const parseComparator = (comp, options) => {
|
|
1012
|
-
debug("comp", comp, options);
|
|
1013
|
-
comp = replaceCarets(comp, options);
|
|
1014
|
-
debug("caret", comp);
|
|
1015
|
-
comp = replaceTildes(comp, options);
|
|
1016
|
-
debug("tildes", comp);
|
|
1017
|
-
comp = replaceXRanges(comp, options);
|
|
1018
|
-
debug("xrange", comp);
|
|
1019
|
-
comp = replaceStars(comp, options);
|
|
1020
|
-
debug("stars", comp);
|
|
1021
|
-
return comp;
|
|
1022
|
-
};
|
|
1023
|
-
const isX = (id) => !id || id.toLowerCase() === "x" || id === "*";
|
|
1024
|
-
const replaceTildes = (comp, options) => {
|
|
1025
|
-
return comp.trim().split(/\s+/).map((c) => replaceTilde(c, options)).join(" ");
|
|
1026
|
-
};
|
|
1027
|
-
const replaceTilde = (comp, options) => {
|
|
1028
|
-
const r = options.loose ? re2[t.TILDELOOSE] : re2[t.TILDE];
|
|
1029
|
-
return comp.replace(r, (_, M, m, p, pr) => {
|
|
1030
|
-
debug("tilde", comp, _, M, m, p, pr);
|
|
1031
|
-
let ret;
|
|
1032
|
-
if (isX(M)) {
|
|
1033
|
-
ret = "";
|
|
1034
|
-
} else if (isX(m)) {
|
|
1035
|
-
ret = `>=${M}.0.0 <${+M + 1}.0.0-0`;
|
|
1036
|
-
} else if (isX(p)) {
|
|
1037
|
-
ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0`;
|
|
1038
|
-
} else if (pr) {
|
|
1039
|
-
debug("replaceTilde pr", pr);
|
|
1040
|
-
ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`;
|
|
1041
|
-
} else {
|
|
1042
|
-
ret = `>=${M}.${m}.${p} <${M}.${+m + 1}.0-0`;
|
|
1043
|
-
}
|
|
1044
|
-
debug("tilde return", ret);
|
|
1045
|
-
return ret;
|
|
1046
|
-
});
|
|
1047
|
-
};
|
|
1048
|
-
const replaceCarets = (comp, options) => {
|
|
1049
|
-
return comp.trim().split(/\s+/).map((c) => replaceCaret(c, options)).join(" ");
|
|
1050
|
-
};
|
|
1051
|
-
const replaceCaret = (comp, options) => {
|
|
1052
|
-
debug("caret", comp, options);
|
|
1053
|
-
const r = options.loose ? re2[t.CARETLOOSE] : re2[t.CARET];
|
|
1054
|
-
const z = options.includePrerelease ? "-0" : "";
|
|
1055
|
-
return comp.replace(r, (_, M, m, p, pr) => {
|
|
1056
|
-
debug("caret", comp, _, M, m, p, pr);
|
|
1057
|
-
let ret;
|
|
1058
|
-
if (isX(M)) {
|
|
1059
|
-
ret = "";
|
|
1060
|
-
} else if (isX(m)) {
|
|
1061
|
-
ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0`;
|
|
1062
|
-
} else if (isX(p)) {
|
|
1063
|
-
if (M === "0") {
|
|
1064
|
-
ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0`;
|
|
1065
|
-
} else {
|
|
1066
|
-
ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0`;
|
|
1067
|
-
}
|
|
1068
|
-
} else if (pr) {
|
|
1069
|
-
debug("replaceCaret pr", pr);
|
|
1070
|
-
if (M === "0") {
|
|
1071
|
-
if (m === "0") {
|
|
1072
|
-
ret = `>=${M}.${m}.${p}-${pr} <${M}.${m}.${+p + 1}-0`;
|
|
1073
|
-
} else {
|
|
1074
|
-
ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`;
|
|
1075
|
-
}
|
|
1076
|
-
} else {
|
|
1077
|
-
ret = `>=${M}.${m}.${p}-${pr} <${+M + 1}.0.0-0`;
|
|
1078
|
-
}
|
|
1079
|
-
} else {
|
|
1080
|
-
debug("no pr");
|
|
1081
|
-
if (M === "0") {
|
|
1082
|
-
if (m === "0") {
|
|
1083
|
-
ret = `>=${M}.${m}.${p}${z} <${M}.${m}.${+p + 1}-0`;
|
|
1084
|
-
} else {
|
|
1085
|
-
ret = `>=${M}.${m}.${p}${z} <${M}.${+m + 1}.0-0`;
|
|
1086
|
-
}
|
|
1087
|
-
} else {
|
|
1088
|
-
ret = `>=${M}.${m}.${p} <${+M + 1}.0.0-0`;
|
|
1089
|
-
}
|
|
1090
|
-
}
|
|
1091
|
-
debug("caret return", ret);
|
|
1092
|
-
return ret;
|
|
1093
|
-
});
|
|
1094
|
-
};
|
|
1095
|
-
const replaceXRanges = (comp, options) => {
|
|
1096
|
-
debug("replaceXRanges", comp, options);
|
|
1097
|
-
return comp.split(/\s+/).map((c) => replaceXRange(c, options)).join(" ");
|
|
1098
|
-
};
|
|
1099
|
-
const replaceXRange = (comp, options) => {
|
|
1100
|
-
comp = comp.trim();
|
|
1101
|
-
const r = options.loose ? re2[t.XRANGELOOSE] : re2[t.XRANGE];
|
|
1102
|
-
return comp.replace(r, (ret, gtlt, M, m, p, pr) => {
|
|
1103
|
-
debug("xRange", comp, ret, gtlt, M, m, p, pr);
|
|
1104
|
-
const xM = isX(M);
|
|
1105
|
-
const xm = xM || isX(m);
|
|
1106
|
-
const xp = xm || isX(p);
|
|
1107
|
-
const anyX = xp;
|
|
1108
|
-
if (gtlt === "=" && anyX) {
|
|
1109
|
-
gtlt = "";
|
|
1110
|
-
}
|
|
1111
|
-
pr = options.includePrerelease ? "-0" : "";
|
|
1112
|
-
if (xM) {
|
|
1113
|
-
if (gtlt === ">" || gtlt === "<") {
|
|
1114
|
-
ret = "<0.0.0-0";
|
|
1115
|
-
} else {
|
|
1116
|
-
ret = "*";
|
|
1117
|
-
}
|
|
1118
|
-
} else if (gtlt && anyX) {
|
|
1119
|
-
if (xm) {
|
|
1120
|
-
m = 0;
|
|
1121
|
-
}
|
|
1122
|
-
p = 0;
|
|
1123
|
-
if (gtlt === ">") {
|
|
1124
|
-
gtlt = ">=";
|
|
1125
|
-
if (xm) {
|
|
1126
|
-
M = +M + 1;
|
|
1127
|
-
m = 0;
|
|
1128
|
-
p = 0;
|
|
1129
|
-
} else {
|
|
1130
|
-
m = +m + 1;
|
|
1131
|
-
p = 0;
|
|
1132
|
-
}
|
|
1133
|
-
} else if (gtlt === "<=") {
|
|
1134
|
-
gtlt = "<";
|
|
1135
|
-
if (xm) {
|
|
1136
|
-
M = +M + 1;
|
|
1137
|
-
} else {
|
|
1138
|
-
m = +m + 1;
|
|
1139
|
-
}
|
|
1140
|
-
}
|
|
1141
|
-
if (gtlt === "<") {
|
|
1142
|
-
pr = "-0";
|
|
1143
|
-
}
|
|
1144
|
-
ret = `${gtlt + M}.${m}.${p}${pr}`;
|
|
1145
|
-
} else if (xm) {
|
|
1146
|
-
ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0`;
|
|
1147
|
-
} else if (xp) {
|
|
1148
|
-
ret = `>=${M}.${m}.0${pr} <${M}.${+m + 1}.0-0`;
|
|
1149
|
-
}
|
|
1150
|
-
debug("xRange return", ret);
|
|
1151
|
-
return ret;
|
|
1152
|
-
});
|
|
1153
|
-
};
|
|
1154
|
-
const replaceStars = (comp, options) => {
|
|
1155
|
-
debug("replaceStars", comp, options);
|
|
1156
|
-
return comp.trim().replace(re2[t.STAR], "");
|
|
1157
|
-
};
|
|
1158
|
-
const replaceGTE0 = (comp, options) => {
|
|
1159
|
-
debug("replaceGTE0", comp, options);
|
|
1160
|
-
return comp.trim().replace(re2[options.includePrerelease ? t.GTE0PRE : t.GTE0], "");
|
|
1161
|
-
};
|
|
1162
|
-
const hyphenReplace = (incPr) => ($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr) => {
|
|
1163
|
-
if (isX(fM)) {
|
|
1164
|
-
from = "";
|
|
1165
|
-
} else if (isX(fm)) {
|
|
1166
|
-
from = `>=${fM}.0.0${incPr ? "-0" : ""}`;
|
|
1167
|
-
} else if (isX(fp)) {
|
|
1168
|
-
from = `>=${fM}.${fm}.0${incPr ? "-0" : ""}`;
|
|
1169
|
-
} else if (fpr) {
|
|
1170
|
-
from = `>=${from}`;
|
|
1171
|
-
} else {
|
|
1172
|
-
from = `>=${from}${incPr ? "-0" : ""}`;
|
|
1173
|
-
}
|
|
1174
|
-
if (isX(tM)) {
|
|
1175
|
-
to = "";
|
|
1176
|
-
} else if (isX(tm)) {
|
|
1177
|
-
to = `<${+tM + 1}.0.0-0`;
|
|
1178
|
-
} else if (isX(tp)) {
|
|
1179
|
-
to = `<${tM}.${+tm + 1}.0-0`;
|
|
1180
|
-
} else if (tpr) {
|
|
1181
|
-
to = `<=${tM}.${tm}.${tp}-${tpr}`;
|
|
1182
|
-
} else if (incPr) {
|
|
1183
|
-
to = `<${tM}.${tm}.${+tp + 1}-0`;
|
|
1184
|
-
} else {
|
|
1185
|
-
to = `<=${to}`;
|
|
1186
|
-
}
|
|
1187
|
-
return `${from} ${to}`.trim();
|
|
1188
|
-
};
|
|
1189
|
-
const testSet = (set, version, options) => {
|
|
1190
|
-
for (let i = 0; i < set.length; i++) {
|
|
1191
|
-
if (!set[i].test(version)) {
|
|
1192
|
-
return false;
|
|
1193
|
-
}
|
|
1194
|
-
}
|
|
1195
|
-
if (version.prerelease.length && !options.includePrerelease) {
|
|
1196
|
-
for (let i = 0; i < set.length; i++) {
|
|
1197
|
-
debug(set[i].semver);
|
|
1198
|
-
if (set[i].semver === Comparator.ANY) {
|
|
1199
|
-
continue;
|
|
1200
|
-
}
|
|
1201
|
-
if (set[i].semver.prerelease.length > 0) {
|
|
1202
|
-
const allowed = set[i].semver;
|
|
1203
|
-
if (allowed.major === version.major && allowed.minor === version.minor && allowed.patch === version.patch) {
|
|
1204
|
-
return true;
|
|
1205
|
-
}
|
|
1206
|
-
}
|
|
1207
|
-
}
|
|
1208
|
-
return false;
|
|
1209
|
-
}
|
|
1210
|
-
return true;
|
|
1211
|
-
};
|
|
1212
|
-
return range;
|
|
1213
|
-
}
|
|
1214
|
-
var comparator;
|
|
1215
|
-
var hasRequiredComparator;
|
|
1216
|
-
function requireComparator() {
|
|
1217
|
-
if (hasRequiredComparator) return comparator;
|
|
1218
|
-
hasRequiredComparator = 1;
|
|
1219
|
-
const ANY = Symbol("SemVer ANY");
|
|
1220
|
-
class Comparator {
|
|
1221
|
-
static get ANY() {
|
|
1222
|
-
return ANY;
|
|
1223
|
-
}
|
|
1224
|
-
constructor(comp, options) {
|
|
1225
|
-
options = parseOptions(options);
|
|
1226
|
-
if (comp instanceof Comparator) {
|
|
1227
|
-
if (comp.loose === !!options.loose) {
|
|
1228
|
-
return comp;
|
|
1229
|
-
} else {
|
|
1230
|
-
comp = comp.value;
|
|
1231
|
-
}
|
|
1232
|
-
}
|
|
1233
|
-
comp = comp.trim().split(/\s+/).join(" ");
|
|
1234
|
-
debug("comparator", comp, options);
|
|
1235
|
-
this.options = options;
|
|
1236
|
-
this.loose = !!options.loose;
|
|
1237
|
-
this.parse(comp);
|
|
1238
|
-
if (this.semver === ANY) {
|
|
1239
|
-
this.value = "";
|
|
1240
|
-
} else {
|
|
1241
|
-
this.value = this.operator + this.semver.version;
|
|
1242
|
-
}
|
|
1243
|
-
debug("comp", this);
|
|
1244
|
-
}
|
|
1245
|
-
parse(comp) {
|
|
1246
|
-
const r = this.options.loose ? re2[t.COMPARATORLOOSE] : re2[t.COMPARATOR];
|
|
1247
|
-
const m = comp.match(r);
|
|
1248
|
-
if (!m) {
|
|
1249
|
-
throw new TypeError(`Invalid comparator: ${comp}`);
|
|
1250
|
-
}
|
|
1251
|
-
this.operator = m[1] !== void 0 ? m[1] : "";
|
|
1252
|
-
if (this.operator === "=") {
|
|
1253
|
-
this.operator = "";
|
|
1254
|
-
}
|
|
1255
|
-
if (!m[2]) {
|
|
1256
|
-
this.semver = ANY;
|
|
1257
|
-
} else {
|
|
1258
|
-
this.semver = new SemVer(m[2], this.options.loose);
|
|
1259
|
-
}
|
|
1260
|
-
}
|
|
1261
|
-
toString() {
|
|
1262
|
-
return this.value;
|
|
1263
|
-
}
|
|
1264
|
-
test(version) {
|
|
1265
|
-
debug("Comparator.test", version, this.options.loose);
|
|
1266
|
-
if (this.semver === ANY || version === ANY) {
|
|
1267
|
-
return true;
|
|
1268
|
-
}
|
|
1269
|
-
if (typeof version === "string") {
|
|
1270
|
-
try {
|
|
1271
|
-
version = new SemVer(version, this.options);
|
|
1272
|
-
} catch (er) {
|
|
1273
|
-
return false;
|
|
1274
|
-
}
|
|
1275
|
-
}
|
|
1276
|
-
return cmp(version, this.operator, this.semver, this.options);
|
|
1277
|
-
}
|
|
1278
|
-
intersects(comp, options) {
|
|
1279
|
-
if (!(comp instanceof Comparator)) {
|
|
1280
|
-
throw new TypeError("a Comparator is required");
|
|
1281
|
-
}
|
|
1282
|
-
if (this.operator === "") {
|
|
1283
|
-
if (this.value === "") {
|
|
1284
|
-
return true;
|
|
1285
|
-
}
|
|
1286
|
-
return new Range(comp.value, options).test(this.value);
|
|
1287
|
-
} else if (comp.operator === "") {
|
|
1288
|
-
if (comp.value === "") {
|
|
1289
|
-
return true;
|
|
1290
|
-
}
|
|
1291
|
-
return new Range(this.value, options).test(comp.semver);
|
|
1292
|
-
}
|
|
1293
|
-
options = parseOptions(options);
|
|
1294
|
-
if (options.includePrerelease && (this.value === "<0.0.0-0" || comp.value === "<0.0.0-0")) {
|
|
1295
|
-
return false;
|
|
1296
|
-
}
|
|
1297
|
-
if (!options.includePrerelease && (this.value.startsWith("<0.0.0") || comp.value.startsWith("<0.0.0"))) {
|
|
1298
|
-
return false;
|
|
1299
|
-
}
|
|
1300
|
-
if (this.operator.startsWith(">") && comp.operator.startsWith(">")) {
|
|
1301
|
-
return true;
|
|
1302
|
-
}
|
|
1303
|
-
if (this.operator.startsWith("<") && comp.operator.startsWith("<")) {
|
|
1304
|
-
return true;
|
|
1305
|
-
}
|
|
1306
|
-
if (this.semver.version === comp.semver.version && this.operator.includes("=") && comp.operator.includes("=")) {
|
|
1307
|
-
return true;
|
|
1308
|
-
}
|
|
1309
|
-
if (cmp(this.semver, "<", comp.semver, options) && this.operator.startsWith(">") && comp.operator.startsWith("<")) {
|
|
1310
|
-
return true;
|
|
1311
|
-
}
|
|
1312
|
-
if (cmp(this.semver, ">", comp.semver, options) && this.operator.startsWith("<") && comp.operator.startsWith(">")) {
|
|
1313
|
-
return true;
|
|
1314
|
-
}
|
|
1315
|
-
return false;
|
|
1316
|
-
}
|
|
1317
|
-
}
|
|
1318
|
-
comparator = Comparator;
|
|
1319
|
-
const parseOptions = requireParseOptions();
|
|
1320
|
-
const { safeRe: re2, t } = requireRe();
|
|
1321
|
-
const cmp = requireCmp();
|
|
1322
|
-
const debug = requireDebug();
|
|
1323
|
-
const SemVer = requireSemver$1();
|
|
1324
|
-
const Range = requireRange();
|
|
1325
|
-
return comparator;
|
|
1326
|
-
}
|
|
1327
|
-
var satisfies_1;
|
|
1328
|
-
var hasRequiredSatisfies;
|
|
1329
|
-
function requireSatisfies() {
|
|
1330
|
-
if (hasRequiredSatisfies) return satisfies_1;
|
|
1331
|
-
hasRequiredSatisfies = 1;
|
|
1332
|
-
const Range = requireRange();
|
|
1333
|
-
const satisfies = (version, range2, options) => {
|
|
1334
|
-
try {
|
|
1335
|
-
range2 = new Range(range2, options);
|
|
1336
|
-
} catch (er) {
|
|
1337
|
-
return false;
|
|
1338
|
-
}
|
|
1339
|
-
return range2.test(version);
|
|
1340
|
-
};
|
|
1341
|
-
satisfies_1 = satisfies;
|
|
1342
|
-
return satisfies_1;
|
|
1343
|
-
}
|
|
1344
|
-
var toComparators_1;
|
|
1345
|
-
var hasRequiredToComparators;
|
|
1346
|
-
function requireToComparators() {
|
|
1347
|
-
if (hasRequiredToComparators) return toComparators_1;
|
|
1348
|
-
hasRequiredToComparators = 1;
|
|
1349
|
-
const Range = requireRange();
|
|
1350
|
-
const toComparators = (range2, options) => new Range(range2, options).set.map((comp) => comp.map((c) => c.value).join(" ").trim().split(" "));
|
|
1351
|
-
toComparators_1 = toComparators;
|
|
1352
|
-
return toComparators_1;
|
|
1353
|
-
}
|
|
1354
|
-
var maxSatisfying_1;
|
|
1355
|
-
var hasRequiredMaxSatisfying;
|
|
1356
|
-
function requireMaxSatisfying() {
|
|
1357
|
-
if (hasRequiredMaxSatisfying) return maxSatisfying_1;
|
|
1358
|
-
hasRequiredMaxSatisfying = 1;
|
|
1359
|
-
const SemVer = requireSemver$1();
|
|
1360
|
-
const Range = requireRange();
|
|
1361
|
-
const maxSatisfying = (versions, range2, options) => {
|
|
1362
|
-
let max = null;
|
|
1363
|
-
let maxSV = null;
|
|
1364
|
-
let rangeObj = null;
|
|
1365
|
-
try {
|
|
1366
|
-
rangeObj = new Range(range2, options);
|
|
1367
|
-
} catch (er) {
|
|
1368
|
-
return null;
|
|
1369
|
-
}
|
|
1370
|
-
versions.forEach((v) => {
|
|
1371
|
-
if (rangeObj.test(v)) {
|
|
1372
|
-
if (!max || maxSV.compare(v) === -1) {
|
|
1373
|
-
max = v;
|
|
1374
|
-
maxSV = new SemVer(max, options);
|
|
1375
|
-
}
|
|
1376
|
-
}
|
|
1377
|
-
});
|
|
1378
|
-
return max;
|
|
1379
|
-
};
|
|
1380
|
-
maxSatisfying_1 = maxSatisfying;
|
|
1381
|
-
return maxSatisfying_1;
|
|
1382
|
-
}
|
|
1383
|
-
var minSatisfying_1;
|
|
1384
|
-
var hasRequiredMinSatisfying;
|
|
1385
|
-
function requireMinSatisfying() {
|
|
1386
|
-
if (hasRequiredMinSatisfying) return minSatisfying_1;
|
|
1387
|
-
hasRequiredMinSatisfying = 1;
|
|
1388
|
-
const SemVer = requireSemver$1();
|
|
1389
|
-
const Range = requireRange();
|
|
1390
|
-
const minSatisfying = (versions, range2, options) => {
|
|
1391
|
-
let min = null;
|
|
1392
|
-
let minSV = null;
|
|
1393
|
-
let rangeObj = null;
|
|
1394
|
-
try {
|
|
1395
|
-
rangeObj = new Range(range2, options);
|
|
1396
|
-
} catch (er) {
|
|
1397
|
-
return null;
|
|
1398
|
-
}
|
|
1399
|
-
versions.forEach((v) => {
|
|
1400
|
-
if (rangeObj.test(v)) {
|
|
1401
|
-
if (!min || minSV.compare(v) === 1) {
|
|
1402
|
-
min = v;
|
|
1403
|
-
minSV = new SemVer(min, options);
|
|
1404
|
-
}
|
|
1405
|
-
}
|
|
1406
|
-
});
|
|
1407
|
-
return min;
|
|
1408
|
-
};
|
|
1409
|
-
minSatisfying_1 = minSatisfying;
|
|
1410
|
-
return minSatisfying_1;
|
|
1411
|
-
}
|
|
1412
|
-
var minVersion_1;
|
|
1413
|
-
var hasRequiredMinVersion;
|
|
1414
|
-
function requireMinVersion() {
|
|
1415
|
-
if (hasRequiredMinVersion) return minVersion_1;
|
|
1416
|
-
hasRequiredMinVersion = 1;
|
|
1417
|
-
const SemVer = requireSemver$1();
|
|
1418
|
-
const Range = requireRange();
|
|
1419
|
-
const gt = requireGt();
|
|
1420
|
-
const minVersion = (range2, loose) => {
|
|
1421
|
-
range2 = new Range(range2, loose);
|
|
1422
|
-
let minver = new SemVer("0.0.0");
|
|
1423
|
-
if (range2.test(minver)) {
|
|
1424
|
-
return minver;
|
|
1425
|
-
}
|
|
1426
|
-
minver = new SemVer("0.0.0-0");
|
|
1427
|
-
if (range2.test(minver)) {
|
|
1428
|
-
return minver;
|
|
1429
|
-
}
|
|
1430
|
-
minver = null;
|
|
1431
|
-
for (let i = 0; i < range2.set.length; ++i) {
|
|
1432
|
-
const comparators = range2.set[i];
|
|
1433
|
-
let setMin = null;
|
|
1434
|
-
comparators.forEach((comparator2) => {
|
|
1435
|
-
const compver = new SemVer(comparator2.semver.version);
|
|
1436
|
-
switch (comparator2.operator) {
|
|
1437
|
-
case ">":
|
|
1438
|
-
if (compver.prerelease.length === 0) {
|
|
1439
|
-
compver.patch++;
|
|
1440
|
-
} else {
|
|
1441
|
-
compver.prerelease.push(0);
|
|
1442
|
-
}
|
|
1443
|
-
compver.raw = compver.format();
|
|
1444
|
-
/* fallthrough */
|
|
1445
|
-
case "":
|
|
1446
|
-
case ">=":
|
|
1447
|
-
if (!setMin || gt(compver, setMin)) {
|
|
1448
|
-
setMin = compver;
|
|
1449
|
-
}
|
|
1450
|
-
break;
|
|
1451
|
-
case "<":
|
|
1452
|
-
case "<=":
|
|
1453
|
-
break;
|
|
1454
|
-
/* istanbul ignore next */
|
|
1455
|
-
default:
|
|
1456
|
-
throw new Error(`Unexpected operation: ${comparator2.operator}`);
|
|
1457
|
-
}
|
|
1458
|
-
});
|
|
1459
|
-
if (setMin && (!minver || gt(minver, setMin))) {
|
|
1460
|
-
minver = setMin;
|
|
1461
|
-
}
|
|
1462
|
-
}
|
|
1463
|
-
if (minver && range2.test(minver)) {
|
|
1464
|
-
return minver;
|
|
1465
|
-
}
|
|
1466
|
-
return null;
|
|
1467
|
-
};
|
|
1468
|
-
minVersion_1 = minVersion;
|
|
1469
|
-
return minVersion_1;
|
|
1470
|
-
}
|
|
1471
|
-
var valid;
|
|
1472
|
-
var hasRequiredValid;
|
|
1473
|
-
function requireValid() {
|
|
1474
|
-
if (hasRequiredValid) return valid;
|
|
1475
|
-
hasRequiredValid = 1;
|
|
1476
|
-
const Range = requireRange();
|
|
1477
|
-
const validRange = (range2, options) => {
|
|
1478
|
-
try {
|
|
1479
|
-
return new Range(range2, options).range || "*";
|
|
1480
|
-
} catch (er) {
|
|
1481
|
-
return null;
|
|
1482
|
-
}
|
|
1483
|
-
};
|
|
1484
|
-
valid = validRange;
|
|
1485
|
-
return valid;
|
|
1486
|
-
}
|
|
1487
|
-
var outside_1;
|
|
1488
|
-
var hasRequiredOutside;
|
|
1489
|
-
function requireOutside() {
|
|
1490
|
-
if (hasRequiredOutside) return outside_1;
|
|
1491
|
-
hasRequiredOutside = 1;
|
|
1492
|
-
const SemVer = requireSemver$1();
|
|
1493
|
-
const Comparator = requireComparator();
|
|
1494
|
-
const { ANY } = Comparator;
|
|
1495
|
-
const Range = requireRange();
|
|
1496
|
-
const satisfies = requireSatisfies();
|
|
1497
|
-
const gt = requireGt();
|
|
1498
|
-
const lt = requireLt();
|
|
1499
|
-
const lte = requireLte();
|
|
1500
|
-
const gte = requireGte();
|
|
1501
|
-
const outside = (version, range2, hilo, options) => {
|
|
1502
|
-
version = new SemVer(version, options);
|
|
1503
|
-
range2 = new Range(range2, options);
|
|
1504
|
-
let gtfn, ltefn, ltfn, comp, ecomp;
|
|
1505
|
-
switch (hilo) {
|
|
1506
|
-
case ">":
|
|
1507
|
-
gtfn = gt;
|
|
1508
|
-
ltefn = lte;
|
|
1509
|
-
ltfn = lt;
|
|
1510
|
-
comp = ">";
|
|
1511
|
-
ecomp = ">=";
|
|
1512
|
-
break;
|
|
1513
|
-
case "<":
|
|
1514
|
-
gtfn = lt;
|
|
1515
|
-
ltefn = gte;
|
|
1516
|
-
ltfn = gt;
|
|
1517
|
-
comp = "<";
|
|
1518
|
-
ecomp = "<=";
|
|
1519
|
-
break;
|
|
1520
|
-
default:
|
|
1521
|
-
throw new TypeError('Must provide a hilo val of "<" or ">"');
|
|
1522
|
-
}
|
|
1523
|
-
if (satisfies(version, range2, options)) {
|
|
1524
|
-
return false;
|
|
1525
|
-
}
|
|
1526
|
-
for (let i = 0; i < range2.set.length; ++i) {
|
|
1527
|
-
const comparators = range2.set[i];
|
|
1528
|
-
let high = null;
|
|
1529
|
-
let low = null;
|
|
1530
|
-
comparators.forEach((comparator2) => {
|
|
1531
|
-
if (comparator2.semver === ANY) {
|
|
1532
|
-
comparator2 = new Comparator(">=0.0.0");
|
|
1533
|
-
}
|
|
1534
|
-
high = high || comparator2;
|
|
1535
|
-
low = low || comparator2;
|
|
1536
|
-
if (gtfn(comparator2.semver, high.semver, options)) {
|
|
1537
|
-
high = comparator2;
|
|
1538
|
-
} else if (ltfn(comparator2.semver, low.semver, options)) {
|
|
1539
|
-
low = comparator2;
|
|
1540
|
-
}
|
|
1541
|
-
});
|
|
1542
|
-
if (high.operator === comp || high.operator === ecomp) {
|
|
1543
|
-
return false;
|
|
1544
|
-
}
|
|
1545
|
-
if ((!low.operator || low.operator === comp) && ltefn(version, low.semver)) {
|
|
1546
|
-
return false;
|
|
1547
|
-
} else if (low.operator === ecomp && ltfn(version, low.semver)) {
|
|
1548
|
-
return false;
|
|
1549
|
-
}
|
|
1550
|
-
}
|
|
1551
|
-
return true;
|
|
1552
|
-
};
|
|
1553
|
-
outside_1 = outside;
|
|
1554
|
-
return outside_1;
|
|
1555
|
-
}
|
|
1556
|
-
var gtr_1;
|
|
1557
|
-
var hasRequiredGtr;
|
|
1558
|
-
function requireGtr() {
|
|
1559
|
-
if (hasRequiredGtr) return gtr_1;
|
|
1560
|
-
hasRequiredGtr = 1;
|
|
1561
|
-
const outside = requireOutside();
|
|
1562
|
-
const gtr = (version, range2, options) => outside(version, range2, ">", options);
|
|
1563
|
-
gtr_1 = gtr;
|
|
1564
|
-
return gtr_1;
|
|
1565
|
-
}
|
|
1566
|
-
var ltr_1;
|
|
1567
|
-
var hasRequiredLtr;
|
|
1568
|
-
function requireLtr() {
|
|
1569
|
-
if (hasRequiredLtr) return ltr_1;
|
|
1570
|
-
hasRequiredLtr = 1;
|
|
1571
|
-
const outside = requireOutside();
|
|
1572
|
-
const ltr = (version, range2, options) => outside(version, range2, "<", options);
|
|
1573
|
-
ltr_1 = ltr;
|
|
1574
|
-
return ltr_1;
|
|
1575
|
-
}
|
|
1576
|
-
var intersects_1;
|
|
1577
|
-
var hasRequiredIntersects;
|
|
1578
|
-
function requireIntersects() {
|
|
1579
|
-
if (hasRequiredIntersects) return intersects_1;
|
|
1580
|
-
hasRequiredIntersects = 1;
|
|
1581
|
-
const Range = requireRange();
|
|
1582
|
-
const intersects = (r1, r2, options) => {
|
|
1583
|
-
r1 = new Range(r1, options);
|
|
1584
|
-
r2 = new Range(r2, options);
|
|
1585
|
-
return r1.intersects(r2, options);
|
|
1586
|
-
};
|
|
1587
|
-
intersects_1 = intersects;
|
|
1588
|
-
return intersects_1;
|
|
1589
|
-
}
|
|
1590
|
-
var simplify;
|
|
1591
|
-
var hasRequiredSimplify;
|
|
1592
|
-
function requireSimplify() {
|
|
1593
|
-
if (hasRequiredSimplify) return simplify;
|
|
1594
|
-
hasRequiredSimplify = 1;
|
|
1595
|
-
const satisfies = requireSatisfies();
|
|
1596
|
-
const compare = requireCompare();
|
|
1597
|
-
simplify = (versions, range2, options) => {
|
|
1598
|
-
const set = [];
|
|
1599
|
-
let first = null;
|
|
1600
|
-
let prev = null;
|
|
1601
|
-
const v = versions.sort((a, b) => compare(a, b, options));
|
|
1602
|
-
for (const version of v) {
|
|
1603
|
-
const included = satisfies(version, range2, options);
|
|
1604
|
-
if (included) {
|
|
1605
|
-
prev = version;
|
|
1606
|
-
if (!first) {
|
|
1607
|
-
first = version;
|
|
1608
|
-
}
|
|
1609
|
-
} else {
|
|
1610
|
-
if (prev) {
|
|
1611
|
-
set.push([first, prev]);
|
|
1612
|
-
}
|
|
1613
|
-
prev = null;
|
|
1614
|
-
first = null;
|
|
1615
|
-
}
|
|
1616
|
-
}
|
|
1617
|
-
if (first) {
|
|
1618
|
-
set.push([first, null]);
|
|
1619
|
-
}
|
|
1620
|
-
const ranges = [];
|
|
1621
|
-
for (const [min, max] of set) {
|
|
1622
|
-
if (min === max) {
|
|
1623
|
-
ranges.push(min);
|
|
1624
|
-
} else if (!max && min === v[0]) {
|
|
1625
|
-
ranges.push("*");
|
|
1626
|
-
} else if (!max) {
|
|
1627
|
-
ranges.push(`>=${min}`);
|
|
1628
|
-
} else if (min === v[0]) {
|
|
1629
|
-
ranges.push(`<=${max}`);
|
|
1630
|
-
} else {
|
|
1631
|
-
ranges.push(`${min} - ${max}`);
|
|
1632
|
-
}
|
|
1633
|
-
}
|
|
1634
|
-
const simplified = ranges.join(" || ");
|
|
1635
|
-
const original = typeof range2.raw === "string" ? range2.raw : String(range2);
|
|
1636
|
-
return simplified.length < original.length ? simplified : range2;
|
|
1637
|
-
};
|
|
1638
|
-
return simplify;
|
|
1639
|
-
}
|
|
1640
|
-
var subset_1;
|
|
1641
|
-
var hasRequiredSubset;
|
|
1642
|
-
function requireSubset() {
|
|
1643
|
-
if (hasRequiredSubset) return subset_1;
|
|
1644
|
-
hasRequiredSubset = 1;
|
|
1645
|
-
const Range = requireRange();
|
|
1646
|
-
const Comparator = requireComparator();
|
|
1647
|
-
const { ANY } = Comparator;
|
|
1648
|
-
const satisfies = requireSatisfies();
|
|
1649
|
-
const compare = requireCompare();
|
|
1650
|
-
const subset = (sub, dom, options = {}) => {
|
|
1651
|
-
if (sub === dom) {
|
|
1652
|
-
return true;
|
|
1653
|
-
}
|
|
1654
|
-
sub = new Range(sub, options);
|
|
1655
|
-
dom = new Range(dom, options);
|
|
1656
|
-
let sawNonNull = false;
|
|
1657
|
-
OUTER: for (const simpleSub of sub.set) {
|
|
1658
|
-
for (const simpleDom of dom.set) {
|
|
1659
|
-
const isSub = simpleSubset(simpleSub, simpleDom, options);
|
|
1660
|
-
sawNonNull = sawNonNull || isSub !== null;
|
|
1661
|
-
if (isSub) {
|
|
1662
|
-
continue OUTER;
|
|
1663
|
-
}
|
|
1664
|
-
}
|
|
1665
|
-
if (sawNonNull) {
|
|
1666
|
-
return false;
|
|
1667
|
-
}
|
|
1668
|
-
}
|
|
1669
|
-
return true;
|
|
1670
|
-
};
|
|
1671
|
-
const minimumVersionWithPreRelease = [new Comparator(">=0.0.0-0")];
|
|
1672
|
-
const minimumVersion = [new Comparator(">=0.0.0")];
|
|
1673
|
-
const simpleSubset = (sub, dom, options) => {
|
|
1674
|
-
if (sub === dom) {
|
|
1675
|
-
return true;
|
|
1676
|
-
}
|
|
1677
|
-
if (sub.length === 1 && sub[0].semver === ANY) {
|
|
1678
|
-
if (dom.length === 1 && dom[0].semver === ANY) {
|
|
1679
|
-
return true;
|
|
1680
|
-
} else if (options.includePrerelease) {
|
|
1681
|
-
sub = minimumVersionWithPreRelease;
|
|
1682
|
-
} else {
|
|
1683
|
-
sub = minimumVersion;
|
|
1684
|
-
}
|
|
1685
|
-
}
|
|
1686
|
-
if (dom.length === 1 && dom[0].semver === ANY) {
|
|
1687
|
-
if (options.includePrerelease) {
|
|
1688
|
-
return true;
|
|
1689
|
-
} else {
|
|
1690
|
-
dom = minimumVersion;
|
|
1691
|
-
}
|
|
1692
|
-
}
|
|
1693
|
-
const eqSet = /* @__PURE__ */ new Set();
|
|
1694
|
-
let gt, lt;
|
|
1695
|
-
for (const c of sub) {
|
|
1696
|
-
if (c.operator === ">" || c.operator === ">=") {
|
|
1697
|
-
gt = higherGT(gt, c, options);
|
|
1698
|
-
} else if (c.operator === "<" || c.operator === "<=") {
|
|
1699
|
-
lt = lowerLT(lt, c, options);
|
|
1700
|
-
} else {
|
|
1701
|
-
eqSet.add(c.semver);
|
|
1702
|
-
}
|
|
1703
|
-
}
|
|
1704
|
-
if (eqSet.size > 1) {
|
|
1705
|
-
return null;
|
|
1706
|
-
}
|
|
1707
|
-
let gtltComp;
|
|
1708
|
-
if (gt && lt) {
|
|
1709
|
-
gtltComp = compare(gt.semver, lt.semver, options);
|
|
1710
|
-
if (gtltComp > 0) {
|
|
1711
|
-
return null;
|
|
1712
|
-
} else if (gtltComp === 0 && (gt.operator !== ">=" || lt.operator !== "<=")) {
|
|
1713
|
-
return null;
|
|
1714
|
-
}
|
|
1715
|
-
}
|
|
1716
|
-
for (const eq of eqSet) {
|
|
1717
|
-
if (gt && !satisfies(eq, String(gt), options)) {
|
|
1718
|
-
return null;
|
|
1719
|
-
}
|
|
1720
|
-
if (lt && !satisfies(eq, String(lt), options)) {
|
|
1721
|
-
return null;
|
|
1722
|
-
}
|
|
1723
|
-
for (const c of dom) {
|
|
1724
|
-
if (!satisfies(eq, String(c), options)) {
|
|
1725
|
-
return false;
|
|
1726
|
-
}
|
|
1727
|
-
}
|
|
1728
|
-
return true;
|
|
1729
|
-
}
|
|
1730
|
-
let higher, lower;
|
|
1731
|
-
let hasDomLT, hasDomGT;
|
|
1732
|
-
let needDomLTPre = lt && !options.includePrerelease && lt.semver.prerelease.length ? lt.semver : false;
|
|
1733
|
-
let needDomGTPre = gt && !options.includePrerelease && gt.semver.prerelease.length ? gt.semver : false;
|
|
1734
|
-
if (needDomLTPre && needDomLTPre.prerelease.length === 1 && lt.operator === "<" && needDomLTPre.prerelease[0] === 0) {
|
|
1735
|
-
needDomLTPre = false;
|
|
1736
|
-
}
|
|
1737
|
-
for (const c of dom) {
|
|
1738
|
-
hasDomGT = hasDomGT || c.operator === ">" || c.operator === ">=";
|
|
1739
|
-
hasDomLT = hasDomLT || c.operator === "<" || c.operator === "<=";
|
|
1740
|
-
if (gt) {
|
|
1741
|
-
if (needDomGTPre) {
|
|
1742
|
-
if (c.semver.prerelease && c.semver.prerelease.length && c.semver.major === needDomGTPre.major && c.semver.minor === needDomGTPre.minor && c.semver.patch === needDomGTPre.patch) {
|
|
1743
|
-
needDomGTPre = false;
|
|
1744
|
-
}
|
|
1745
|
-
}
|
|
1746
|
-
if (c.operator === ">" || c.operator === ">=") {
|
|
1747
|
-
higher = higherGT(gt, c, options);
|
|
1748
|
-
if (higher === c && higher !== gt) {
|
|
1749
|
-
return false;
|
|
1750
|
-
}
|
|
1751
|
-
} else if (gt.operator === ">=" && !satisfies(gt.semver, String(c), options)) {
|
|
1752
|
-
return false;
|
|
1753
|
-
}
|
|
1754
|
-
}
|
|
1755
|
-
if (lt) {
|
|
1756
|
-
if (needDomLTPre) {
|
|
1757
|
-
if (c.semver.prerelease && c.semver.prerelease.length && c.semver.major === needDomLTPre.major && c.semver.minor === needDomLTPre.minor && c.semver.patch === needDomLTPre.patch) {
|
|
1758
|
-
needDomLTPre = false;
|
|
1759
|
-
}
|
|
1760
|
-
}
|
|
1761
|
-
if (c.operator === "<" || c.operator === "<=") {
|
|
1762
|
-
lower = lowerLT(lt, c, options);
|
|
1763
|
-
if (lower === c && lower !== lt) {
|
|
1764
|
-
return false;
|
|
1765
|
-
}
|
|
1766
|
-
} else if (lt.operator === "<=" && !satisfies(lt.semver, String(c), options)) {
|
|
1767
|
-
return false;
|
|
1768
|
-
}
|
|
1769
|
-
}
|
|
1770
|
-
if (!c.operator && (lt || gt) && gtltComp !== 0) {
|
|
1771
|
-
return false;
|
|
1772
|
-
}
|
|
1773
|
-
}
|
|
1774
|
-
if (gt && hasDomLT && !lt && gtltComp !== 0) {
|
|
1775
|
-
return false;
|
|
1776
|
-
}
|
|
1777
|
-
if (lt && hasDomGT && !gt && gtltComp !== 0) {
|
|
1778
|
-
return false;
|
|
1779
|
-
}
|
|
1780
|
-
if (needDomGTPre || needDomLTPre) {
|
|
1781
|
-
return false;
|
|
1782
|
-
}
|
|
1783
|
-
return true;
|
|
1784
|
-
};
|
|
1785
|
-
const higherGT = (a, b, options) => {
|
|
1786
|
-
if (!a) {
|
|
1787
|
-
return b;
|
|
1788
|
-
}
|
|
1789
|
-
const comp = compare(a.semver, b.semver, options);
|
|
1790
|
-
return comp > 0 ? a : comp < 0 ? b : b.operator === ">" && a.operator === ">=" ? b : a;
|
|
1791
|
-
};
|
|
1792
|
-
const lowerLT = (a, b, options) => {
|
|
1793
|
-
if (!a) {
|
|
1794
|
-
return b;
|
|
1795
|
-
}
|
|
1796
|
-
const comp = compare(a.semver, b.semver, options);
|
|
1797
|
-
return comp < 0 ? a : comp > 0 ? b : b.operator === "<" && a.operator === "<=" ? b : a;
|
|
1798
|
-
};
|
|
1799
|
-
subset_1 = subset;
|
|
1800
|
-
return subset_1;
|
|
1801
|
-
}
|
|
1802
|
-
var semver$1;
|
|
1803
|
-
var hasRequiredSemver;
|
|
1804
|
-
function requireSemver() {
|
|
1805
|
-
if (hasRequiredSemver) return semver$1;
|
|
1806
|
-
hasRequiredSemver = 1;
|
|
1807
|
-
const internalRe = requireRe();
|
|
1808
|
-
const constants2 = requireConstants();
|
|
1809
|
-
const SemVer = requireSemver$1();
|
|
1810
|
-
const identifiers2 = requireIdentifiers();
|
|
1811
|
-
const parse = requireParse();
|
|
1812
|
-
const valid2 = requireValid$1();
|
|
1813
|
-
const clean = requireClean();
|
|
1814
|
-
const inc = requireInc();
|
|
1815
|
-
const diff = requireDiff();
|
|
1816
|
-
const major = requireMajor();
|
|
1817
|
-
const minor = requireMinor();
|
|
1818
|
-
const patch = requirePatch();
|
|
1819
|
-
const prerelease = requirePrerelease();
|
|
1820
|
-
const compare = requireCompare();
|
|
1821
|
-
const rcompare = requireRcompare();
|
|
1822
|
-
const compareLoose = requireCompareLoose();
|
|
1823
|
-
const compareBuild = requireCompareBuild();
|
|
1824
|
-
const sort = requireSort();
|
|
1825
|
-
const rsort = requireRsort();
|
|
1826
|
-
const gt = requireGt();
|
|
1827
|
-
const lt = requireLt();
|
|
1828
|
-
const eq = requireEq();
|
|
1829
|
-
const neq = requireNeq();
|
|
1830
|
-
const gte = requireGte();
|
|
1831
|
-
const lte = requireLte();
|
|
1832
|
-
const cmp = requireCmp();
|
|
1833
|
-
const coerce = requireCoerce();
|
|
1834
|
-
const Comparator = requireComparator();
|
|
1835
|
-
const Range = requireRange();
|
|
1836
|
-
const satisfies = requireSatisfies();
|
|
1837
|
-
const toComparators = requireToComparators();
|
|
1838
|
-
const maxSatisfying = requireMaxSatisfying();
|
|
1839
|
-
const minSatisfying = requireMinSatisfying();
|
|
1840
|
-
const minVersion = requireMinVersion();
|
|
1841
|
-
const validRange = requireValid();
|
|
1842
|
-
const outside = requireOutside();
|
|
1843
|
-
const gtr = requireGtr();
|
|
1844
|
-
const ltr = requireLtr();
|
|
1845
|
-
const intersects = requireIntersects();
|
|
1846
|
-
const simplifyRange = requireSimplify();
|
|
1847
|
-
const subset = requireSubset();
|
|
1848
|
-
semver$1 = {
|
|
1849
|
-
parse,
|
|
1850
|
-
valid: valid2,
|
|
1851
|
-
clean,
|
|
1852
|
-
inc,
|
|
1853
|
-
diff,
|
|
1854
|
-
major,
|
|
1855
|
-
minor,
|
|
1856
|
-
patch,
|
|
1857
|
-
prerelease,
|
|
1858
|
-
compare,
|
|
1859
|
-
rcompare,
|
|
1860
|
-
compareLoose,
|
|
1861
|
-
compareBuild,
|
|
1862
|
-
sort,
|
|
1863
|
-
rsort,
|
|
1864
|
-
gt,
|
|
1865
|
-
lt,
|
|
1866
|
-
eq,
|
|
1867
|
-
neq,
|
|
1868
|
-
gte,
|
|
1869
|
-
lte,
|
|
1870
|
-
cmp,
|
|
1871
|
-
coerce,
|
|
1872
|
-
Comparator,
|
|
1873
|
-
Range,
|
|
1874
|
-
satisfies,
|
|
1875
|
-
toComparators,
|
|
1876
|
-
maxSatisfying,
|
|
1877
|
-
minSatisfying,
|
|
1878
|
-
minVersion,
|
|
1879
|
-
validRange,
|
|
1880
|
-
outside,
|
|
1881
|
-
gtr,
|
|
1882
|
-
ltr,
|
|
1883
|
-
intersects,
|
|
1884
|
-
simplifyRange,
|
|
1885
|
-
subset,
|
|
1886
|
-
SemVer,
|
|
1887
|
-
re: internalRe.re,
|
|
1888
|
-
src: internalRe.src,
|
|
1889
|
-
tokens: internalRe.t,
|
|
1890
|
-
SEMVER_SPEC_VERSION: constants2.SEMVER_SPEC_VERSION,
|
|
1891
|
-
RELEASE_TYPES: constants2.RELEASE_TYPES,
|
|
1892
|
-
compareIdentifiers: identifiers2.compareIdentifiers,
|
|
1893
|
-
rcompareIdentifiers: identifiers2.rcompareIdentifiers
|
|
1894
|
-
};
|
|
1895
|
-
return semver$1;
|
|
1896
|
-
}
|
|
1897
|
-
var semverExports = requireSemver();
|
|
1898
|
-
const semver = /* @__PURE__ */ getDefaultExportFromCjs(semverExports);
|
|
1899
|
-
const install = async ({ kernel, shell, terminal, args }) => {
|
|
1900
|
-
const [packageArg, registryArg, reinstallArg] = args;
|
|
1901
|
-
if (!packageArg) {
|
|
1902
|
-
terminal.writeln(chalk.red("Usage: install <package-name>[@version]"));
|
|
1903
|
-
return 1;
|
|
1904
|
-
}
|
|
1905
|
-
const spec = packageArg.match(/(@[^/]+\/[^@]+|[^@]+)(?:@([^/]+))?/);
|
|
1906
|
-
if (!spec) {
|
|
1907
|
-
terminal.writeln(chalk.red("Invalid package name format"));
|
|
1908
|
-
return 1;
|
|
1909
|
-
}
|
|
1910
|
-
const registry = registryArg || shell.env.get("REGISTRY") || "https://registry.npmjs.org";
|
|
1911
|
-
const packageName = spec[1];
|
|
1912
|
-
let version = spec[2] || "latest";
|
|
1913
|
-
if (!packageName) {
|
|
1914
|
-
terminal.writeln(chalk.red("Invalid package name format"));
|
|
1915
|
-
return 1;
|
|
1916
|
-
}
|
|
1917
|
-
const url = `${registry}/${packageName}`;
|
|
1918
|
-
const packageInfo = await globalThis.fetch(url);
|
|
1919
|
-
const data = await packageInfo.json();
|
|
1920
|
-
if (!data.versions || !data["dist-tags"]) {
|
|
1921
|
-
terminal.writeln(chalk.red(`No versions found for ${packageName}`));
|
|
1922
|
-
return 1;
|
|
1923
|
-
}
|
|
1924
|
-
if (version === "latest") version = data["dist-tags"].latest;
|
|
1925
|
-
else version = semver.maxSatisfying(Object.keys(data.versions), version) || version;
|
|
1926
|
-
if (reinstallArg) {
|
|
1927
|
-
const pkgData = JSON.parse(await kernel.filesystem.fs.readFile(path.join("/usr/lib", packageName, version, "package", "package.json"), "utf-8"));
|
|
1928
|
-
for (const bin in pkgData.bin) await kernel.filesystem.fs.unlink(path.join("/usr/bin", bin));
|
|
1929
|
-
await kernel.filesystem.fs.rm(path.join("/usr/lib", packageName, version), { recursive: true, force: true });
|
|
1930
|
-
}
|
|
1931
|
-
const packagePath = path.join("/usr/lib", packageName, version, "package", "package.json");
|
|
1932
|
-
if (await kernel.filesystem.fs.exists(packagePath)) {
|
|
1933
|
-
terminal.writeln(chalk.green(`${packageName} v${version} is already installed`));
|
|
1934
|
-
return 0;
|
|
1935
|
-
}
|
|
1936
|
-
terminal.writeln(`Installing ${data.name} v${version} from ${registry}...`);
|
|
1937
|
-
const tarballUrl = data.versions[version]?.dist?.tarball;
|
|
1938
|
-
const tarballChecksum = data.versions[version]?.dist?.shasum?.toLowerCase();
|
|
1939
|
-
if (!tarballUrl || !tarballChecksum) {
|
|
1940
|
-
terminal.writeln(chalk.red(`No tarball URL or checksum found for ${packageName} v${version}`));
|
|
1941
|
-
return 1;
|
|
1942
|
-
}
|
|
1943
|
-
const tarball = await globalThis.fetch(tarballUrl);
|
|
1944
|
-
const arrayBuffer = await tarball.arrayBuffer();
|
|
1945
|
-
const hashBuffer = await crypto.subtle.digest("SHA-1", arrayBuffer);
|
|
1946
|
-
const hashArray = Array.from(new Uint8Array(hashBuffer));
|
|
1947
|
-
const downloadChecksum = hashArray.map((b) => b.toString(16).padStart(2, "0")).join("");
|
|
1948
|
-
if (downloadChecksum !== tarballChecksum) {
|
|
1949
|
-
terminal.writeln(chalk.red(`Checksum verification failed. Expected ${tarballChecksum} but got ${downloadChecksum}`));
|
|
1950
|
-
return 1;
|
|
1951
|
-
}
|
|
1952
|
-
const tarballFilename = `${data.name.replace("@", "").replace("/", "-")}-${version}.tar.gz`;
|
|
1953
|
-
await kernel.filesystem.fs.writeFile(`/tmp/${tarballFilename}`, new Uint8Array(arrayBuffer));
|
|
1954
|
-
const extractPath = `/usr/lib/${data.name}/${version}`;
|
|
1955
|
-
if (await kernel.filesystem.fs.exists(extractPath)) await kernel.filesystem.fs.rm(extractPath, { recursive: true });
|
|
1956
|
-
await kernel.filesystem.fs.mkdir(extractPath, { mode: 493, recursive: true });
|
|
1957
|
-
await kernel.filesystem.extractTarball(`/tmp/${tarballFilename}`, extractPath);
|
|
1958
|
-
await kernel.filesystem.fs.unlink(`/tmp/${tarballFilename}`);
|
|
1959
|
-
terminal.writeln(chalk.green(`Installed ${data.name} v${version} to ${extractPath}`));
|
|
1960
|
-
const packageData = await kernel.filesystem.fs.readFile(packagePath, "utf-8");
|
|
1961
|
-
const packageJson = JSON.parse(packageData);
|
|
1962
|
-
try {
|
|
1963
|
-
if (packageJson.bin) {
|
|
1964
|
-
if (typeof packageJson.bin === "string") {
|
|
1965
|
-
const binPath = path.join("/usr/lib", packageName, version, "package", packageJson.bin);
|
|
1966
|
-
if (!await kernel.filesystem.fs.exists(binPath)) {
|
|
1967
|
-
terminal.writeln(chalk.red(`${binPath} does not exist`));
|
|
1968
|
-
return 1;
|
|
1969
|
-
}
|
|
1970
|
-
await kernel.filesystem.fs.symlink(binPath, path.join("/usr/bin", packageJson.name));
|
|
1971
|
-
terminal.writeln(chalk.green(`Linked ${packageJson.name} to ${path.join("/usr/bin", packageJson.name)}`));
|
|
1972
|
-
} else if (typeof packageJson.bin === "object") {
|
|
1973
|
-
for (const bin in packageJson.bin) {
|
|
1974
|
-
const binPath = path.join("/usr/lib", packageName, version, "package", packageJson.bin[bin]);
|
|
1975
|
-
if (!await kernel.filesystem.fs.exists(binPath)) {
|
|
1976
|
-
terminal.writeln(chalk.red(`${binPath} does not exist`));
|
|
1977
|
-
return 1;
|
|
1978
|
-
}
|
|
1979
|
-
await kernel.filesystem.fs.symlink(binPath, path.join("/usr/bin", bin));
|
|
1980
|
-
terminal.writeln(chalk.green(`Linked ${bin} to ${path.join("/usr/bin", bin)}`));
|
|
1981
|
-
}
|
|
1982
|
-
}
|
|
1983
|
-
}
|
|
1984
|
-
} catch (error) {
|
|
1985
|
-
terminal.writeln(chalk.red(`Failed to link bins for ${packageName}@${version}: ${error}`));
|
|
1986
|
-
}
|
|
1987
|
-
if (packageJson.dependencies) {
|
|
1988
|
-
for (const dependency in packageJson.dependencies) {
|
|
1989
|
-
const packageSpec = `${dependency}${packageJson.dependencies[dependency] ? `@${packageJson.dependencies[dependency]}` : ""}`;
|
|
1990
|
-
await install({ kernel, shell, terminal, args: [packageSpec, registryArg] });
|
|
1991
|
-
}
|
|
1992
|
-
}
|
|
1993
|
-
};
|
|
1994
|
-
export {
|
|
1995
|
-
install as default
|
|
1996
|
-
};
|
|
1997
|
-
//# sourceMappingURL=install-C64fBUI2.js.map
|