@hot-updater/aws 0.35.10 → 0.35.12
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/dist/lambda/index.cjs +682 -2701
- package/package.json +8 -8
package/dist/lambda/index.cjs
CHANGED
|
@@ -1,44 +1,41 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
//#region \0rolldown/runtime.js
|
|
3
|
-
var __create
|
|
4
|
-
var __defProp
|
|
5
|
-
var __getOwnPropDesc
|
|
6
|
-
var __getOwnPropNames
|
|
7
|
-
var __getProtoOf
|
|
8
|
-
var __hasOwnProp
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames$1(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
3
|
+
var __create = Object.create;
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
12
11
|
key = keys[i];
|
|
13
|
-
if (!__hasOwnProp
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
14
13
|
get: ((k) => from[k]).bind(null, key),
|
|
15
|
-
enumerable: !(desc = __getOwnPropDesc
|
|
14
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
16
15
|
});
|
|
17
16
|
}
|
|
18
17
|
return to;
|
|
19
18
|
};
|
|
20
|
-
var __toESM
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
21
20
|
value: mod,
|
|
22
21
|
enumerable: true
|
|
23
22
|
}) : target, mod));
|
|
24
23
|
//#endregion
|
|
25
|
-
let node_path = require("node:path");
|
|
26
|
-
node_path = __toESM$1(node_path);
|
|
27
24
|
let node_crypto = require("node:crypto");
|
|
28
|
-
node_crypto = __toESM
|
|
25
|
+
node_crypto = __toESM(node_crypto);
|
|
29
26
|
let _aws_sdk_client_cloudfront = require("@aws-sdk/client-cloudfront");
|
|
30
27
|
let _aws_sdk_client_s3 = require("@aws-sdk/client-s3");
|
|
31
28
|
let fs_promises = require("fs/promises");
|
|
32
|
-
fs_promises = __toESM
|
|
29
|
+
fs_promises = __toESM(fs_promises);
|
|
33
30
|
let path = require("path");
|
|
34
|
-
path = __toESM
|
|
31
|
+
path = __toESM(path);
|
|
35
32
|
let _aws_sdk_lib_storage = require("@aws-sdk/lib-storage");
|
|
36
33
|
let _aws_sdk_s3_request_presigner = require("@aws-sdk/s3-request-presigner");
|
|
37
34
|
let _aws_sdk_client_ssm = require("@aws-sdk/client-ssm");
|
|
38
35
|
let _aws_sdk_cloudfront_signer = require("@aws-sdk/cloudfront-signer");
|
|
39
36
|
//#endregion
|
|
40
37
|
//#region ../../packages/server/dist/version.mjs
|
|
41
|
-
const HOT_UPDATER_SERVER_VERSION = "0.35.
|
|
38
|
+
const HOT_UPDATER_SERVER_VERSION = "0.35.12";
|
|
42
39
|
//#endregion
|
|
43
40
|
//#region ../../packages/server/dist/internalRouter.mjs
|
|
44
41
|
const normalizePath = (path) => {
|
|
@@ -91,1387 +88,350 @@ function findRoute(router, method, path) {
|
|
|
91
88
|
}
|
|
92
89
|
}
|
|
93
90
|
//#endregion
|
|
94
|
-
//#region ../../node_modules/.pnpm/
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
})
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/internal/re.js
|
|
125
|
-
var require_re$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
|
|
126
|
-
const { MAX_SAFE_COMPONENT_LENGTH, MAX_SAFE_BUILD_LENGTH, MAX_LENGTH } = require_constants$1();
|
|
127
|
-
const debug = require_debug$1();
|
|
128
|
-
exports = module.exports = {};
|
|
129
|
-
const re = exports.re = [];
|
|
130
|
-
const safeRe = exports.safeRe = [];
|
|
131
|
-
const src = exports.src = [];
|
|
132
|
-
const safeSrc = exports.safeSrc = [];
|
|
133
|
-
const t = exports.t = {};
|
|
134
|
-
let R = 0;
|
|
135
|
-
const LETTERDASHNUMBER = "[a-zA-Z0-9-]";
|
|
136
|
-
const safeRegexReplacements = [
|
|
137
|
-
["\\s", 1],
|
|
138
|
-
["\\d", MAX_LENGTH],
|
|
139
|
-
[LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH]
|
|
91
|
+
//#region ../../node_modules/.pnpm/verkit@0.3.2/node_modules/verkit/dist/index.js
|
|
92
|
+
const LETTER_DASH_NUMBER$1 = "[a-zA-Z0-9-]";
|
|
93
|
+
const NUMERIC_IDENTIFIER$1 = String.raw`0|[1-9]\d*`;
|
|
94
|
+
const NUMERIC_IDENTIFIER_LOOSE$1 = String.raw`\d+`;
|
|
95
|
+
const NON_NUMERIC_IDENTIFIER$1 = String.raw`\d*[a-zA-Z-]${LETTER_DASH_NUMBER$1}*`;
|
|
96
|
+
const MAIN_VERSION$1 = String.raw`(${NUMERIC_IDENTIFIER$1})\.(${NUMERIC_IDENTIFIER$1})\.(${NUMERIC_IDENTIFIER$1})`;
|
|
97
|
+
const MAIN_VERSION_LOOSE$1 = String.raw`(${NUMERIC_IDENTIFIER_LOOSE$1})\.(${NUMERIC_IDENTIFIER_LOOSE$1})\.(${NUMERIC_IDENTIFIER_LOOSE$1})`;
|
|
98
|
+
const PRERELEASE_IDENTIFIER$1 = `(?:${NON_NUMERIC_IDENTIFIER$1}|${NUMERIC_IDENTIFIER$1})`;
|
|
99
|
+
const PRERELEASE_IDENTIFIER_LOOSE$1 = `(?:${NON_NUMERIC_IDENTIFIER$1}|${NUMERIC_IDENTIFIER_LOOSE$1})`;
|
|
100
|
+
const PRERELEASE$1 = String.raw`(?:-(${PRERELEASE_IDENTIFIER$1}(?:\.${PRERELEASE_IDENTIFIER$1})*))`;
|
|
101
|
+
const PRERELEASE_LOOSE$1 = String.raw`(?:-?(${PRERELEASE_IDENTIFIER_LOOSE$1}(?:\.${PRERELEASE_IDENTIFIER_LOOSE$1})*))`;
|
|
102
|
+
const BUILD_IDENTIFIER$1 = `${LETTER_DASH_NUMBER$1}+`;
|
|
103
|
+
const BUILD$1 = String.raw`(?:\+(${BUILD_IDENTIFIER$1}(?:\.${BUILD_IDENTIFIER$1})*))`;
|
|
104
|
+
const FULL_PLAIN$1 = `v?${MAIN_VERSION$1}${PRERELEASE$1}?${BUILD$1}?`;
|
|
105
|
+
const LOOSE_PLAIN$1 = String.raw`[v=\s]*${MAIN_VERSION_LOOSE$1}${PRERELEASE_LOOSE$1}?${BUILD$1}?`;
|
|
106
|
+
const GREATER_LESS_THAN$1 = "((?:<|>)?=?)";
|
|
107
|
+
const XRANGE_IDENTIFIER$1 = String.raw`${NUMERIC_IDENTIFIER$1}|x|X|\*`;
|
|
108
|
+
const XRANGE_IDENTIFIER_LOOSE$1 = String.raw`${NUMERIC_IDENTIFIER_LOOSE$1}|x|X|\*`;
|
|
109
|
+
const XRANGE_PLAIN$1 = String.raw`[v=\s]*(${XRANGE_IDENTIFIER$1})(?:\.(${XRANGE_IDENTIFIER$1})(?:\.(${XRANGE_IDENTIFIER$1})(?:${PRERELEASE$1})?${BUILD$1}?)?)?`;
|
|
110
|
+
const XRANGE_PLAIN_LOOSE$1 = String.raw`[v=\s]*(${XRANGE_IDENTIFIER_LOOSE$1})(?:\.(${XRANGE_IDENTIFIER_LOOSE$1})(?:\.(${XRANGE_IDENTIFIER_LOOSE$1})(?:${PRERELEASE_LOOSE$1})?${BUILD$1}?)?)?`;
|
|
111
|
+
const LONE_TILDE$1 = "(?:~>?)";
|
|
112
|
+
const LONE_CARET$1 = String.raw`(?:\^)`;
|
|
113
|
+
const COERCE_PLAIN$1 = String.raw`(^|[^\d])(\d{1,${16}})(?:\.(\d{1,${16}}))?(?:\.(\d{1,${16}}))?`;
|
|
114
|
+
const COERCE$1 = String.raw`${COERCE_PLAIN$1}(?:$|[^\d])`;
|
|
115
|
+
const COERCE_FULL$1 = String.raw`${COERCE_PLAIN$1}(?:${PRERELEASE$1})?(?:${BUILD$1})?(?:$|[^\d])`;
|
|
116
|
+
function makeSafeRegexSource$1(source) {
|
|
117
|
+
const replacements = [
|
|
118
|
+
[String.raw`\s`, 1],
|
|
119
|
+
[String.raw`\d`, 256],
|
|
120
|
+
[LETTER_DASH_NUMBER$1, 250]
|
|
140
121
|
];
|
|
141
|
-
const
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
exports.comparatorTrimReplace = "$1$2$3";
|
|
196
|
-
createToken("HYPHENRANGE", `^\\s*(${src[t.XRANGEPLAIN]})\\s+-\\s+(${src[t.XRANGEPLAIN]})\\s*$`);
|
|
197
|
-
createToken("HYPHENRANGELOOSE", `^\\s*(${src[t.XRANGEPLAINLOOSE]})\\s+-\\s+(${src[t.XRANGEPLAINLOOSE]})\\s*$`);
|
|
198
|
-
createToken("STAR", "(<|>)?=?\\s*\\*");
|
|
199
|
-
createToken("GTE0", "^\\s*>=\\s*0\\.0\\.0\\s*$");
|
|
200
|
-
createToken("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$");
|
|
201
|
-
}));
|
|
202
|
-
//#endregion
|
|
203
|
-
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/internal/parse-options.js
|
|
204
|
-
var require_parse_options$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
|
|
205
|
-
const looseOption = Object.freeze({ loose: true });
|
|
206
|
-
const emptyOpts = Object.freeze({});
|
|
207
|
-
const parseOptions = (options) => {
|
|
208
|
-
if (!options) return emptyOpts;
|
|
209
|
-
if (typeof options !== "object") return looseOption;
|
|
210
|
-
return options;
|
|
211
|
-
};
|
|
212
|
-
module.exports = parseOptions;
|
|
213
|
-
}));
|
|
214
|
-
//#endregion
|
|
215
|
-
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/internal/identifiers.js
|
|
216
|
-
var require_identifiers$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
|
|
217
|
-
const numeric = /^[0-9]+$/;
|
|
218
|
-
const compareIdentifiers = (a, b) => {
|
|
219
|
-
if (typeof a === "number" && typeof b === "number") return a === b ? 0 : a < b ? -1 : 1;
|
|
220
|
-
const anum = numeric.test(a);
|
|
221
|
-
const bnum = numeric.test(b);
|
|
222
|
-
if (anum && bnum) {
|
|
223
|
-
a = +a;
|
|
224
|
-
b = +b;
|
|
225
|
-
}
|
|
226
|
-
return a === b ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a < b ? -1 : 1;
|
|
227
|
-
};
|
|
228
|
-
const rcompareIdentifiers = (a, b) => compareIdentifiers(b, a);
|
|
229
|
-
module.exports = {
|
|
230
|
-
compareIdentifiers,
|
|
231
|
-
rcompareIdentifiers
|
|
232
|
-
};
|
|
233
|
-
}));
|
|
234
|
-
//#endregion
|
|
235
|
-
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/classes/semver.js
|
|
236
|
-
var require_semver$2 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
|
|
237
|
-
const debug = require_debug$1();
|
|
238
|
-
const { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants$1();
|
|
239
|
-
const { safeRe: re, t } = require_re$1();
|
|
240
|
-
const parseOptions = require_parse_options$1();
|
|
241
|
-
const { compareIdentifiers } = require_identifiers$1();
|
|
242
|
-
const isPrereleaseIdentifier = (prerelease, identifier) => {
|
|
243
|
-
const identifiers = identifier.split(".");
|
|
244
|
-
if (identifiers.length > prerelease.length) return false;
|
|
245
|
-
for (let i = 0; i < identifiers.length; i++) if (compareIdentifiers(prerelease[i], identifiers[i]) !== 0) return false;
|
|
246
|
-
return true;
|
|
247
|
-
};
|
|
248
|
-
module.exports = class SemVer {
|
|
249
|
-
constructor(version, options) {
|
|
250
|
-
options = parseOptions(options);
|
|
251
|
-
if (version instanceof SemVer) if (version.loose === !!options.loose && version.includePrerelease === !!options.includePrerelease) return version;
|
|
252
|
-
else version = version.version;
|
|
253
|
-
else if (typeof version !== "string") throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version}".`);
|
|
254
|
-
if (version.length > MAX_LENGTH) throw new TypeError(`version is longer than ${MAX_LENGTH} characters`);
|
|
255
|
-
debug("SemVer", version, options);
|
|
256
|
-
this.options = options;
|
|
257
|
-
this.loose = !!options.loose;
|
|
258
|
-
this.includePrerelease = !!options.includePrerelease;
|
|
259
|
-
const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]);
|
|
260
|
-
if (!m) throw new TypeError(`Invalid Version: ${version}`);
|
|
261
|
-
this.raw = version;
|
|
262
|
-
this.major = +m[1];
|
|
263
|
-
this.minor = +m[2];
|
|
264
|
-
this.patch = +m[3];
|
|
265
|
-
if (this.major > MAX_SAFE_INTEGER || this.major < 0) throw new TypeError("Invalid major version");
|
|
266
|
-
if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) throw new TypeError("Invalid minor version");
|
|
267
|
-
if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) throw new TypeError("Invalid patch version");
|
|
268
|
-
if (!m[4]) this.prerelease = [];
|
|
269
|
-
else this.prerelease = m[4].split(".").map((id) => {
|
|
270
|
-
if (/^[0-9]+$/.test(id)) {
|
|
271
|
-
const num = +id;
|
|
272
|
-
if (num >= 0 && num < MAX_SAFE_INTEGER) return num;
|
|
273
|
-
}
|
|
274
|
-
return id;
|
|
275
|
-
});
|
|
276
|
-
this.build = m[5] ? m[5].split(".") : [];
|
|
277
|
-
this.format();
|
|
278
|
-
}
|
|
279
|
-
format() {
|
|
280
|
-
this.version = `${this.major}.${this.minor}.${this.patch}`;
|
|
281
|
-
if (this.prerelease.length) this.version += `-${this.prerelease.join(".")}`;
|
|
282
|
-
return this.version;
|
|
283
|
-
}
|
|
284
|
-
toString() {
|
|
285
|
-
return this.version;
|
|
286
|
-
}
|
|
287
|
-
compare(other) {
|
|
288
|
-
debug("SemVer.compare", this.version, this.options, other);
|
|
289
|
-
if (!(other instanceof SemVer)) {
|
|
290
|
-
if (typeof other === "string" && other === this.version) return 0;
|
|
291
|
-
other = new SemVer(other, this.options);
|
|
292
|
-
}
|
|
293
|
-
if (other.version === this.version) return 0;
|
|
294
|
-
return this.compareMain(other) || this.comparePre(other);
|
|
295
|
-
}
|
|
296
|
-
compareMain(other) {
|
|
297
|
-
if (!(other instanceof SemVer)) other = new SemVer(other, this.options);
|
|
298
|
-
if (this.major < other.major) return -1;
|
|
299
|
-
if (this.major > other.major) return 1;
|
|
300
|
-
if (this.minor < other.minor) return -1;
|
|
301
|
-
if (this.minor > other.minor) return 1;
|
|
302
|
-
if (this.patch < other.patch) return -1;
|
|
303
|
-
if (this.patch > other.patch) return 1;
|
|
304
|
-
return 0;
|
|
305
|
-
}
|
|
306
|
-
comparePre(other) {
|
|
307
|
-
if (!(other instanceof SemVer)) other = new SemVer(other, this.options);
|
|
308
|
-
if (this.prerelease.length && !other.prerelease.length) return -1;
|
|
309
|
-
else if (!this.prerelease.length && other.prerelease.length) return 1;
|
|
310
|
-
else if (!this.prerelease.length && !other.prerelease.length) return 0;
|
|
311
|
-
let i = 0;
|
|
312
|
-
do {
|
|
313
|
-
const a = this.prerelease[i];
|
|
314
|
-
const b = other.prerelease[i];
|
|
315
|
-
debug("prerelease compare", i, a, b);
|
|
316
|
-
if (a === void 0 && b === void 0) return 0;
|
|
317
|
-
else if (b === void 0) return 1;
|
|
318
|
-
else if (a === void 0) return -1;
|
|
319
|
-
else if (a === b) continue;
|
|
320
|
-
else return compareIdentifiers(a, b);
|
|
321
|
-
} while (++i);
|
|
322
|
-
}
|
|
323
|
-
compareBuild(other) {
|
|
324
|
-
if (!(other instanceof SemVer)) other = new SemVer(other, this.options);
|
|
325
|
-
let i = 0;
|
|
326
|
-
do {
|
|
327
|
-
const a = this.build[i];
|
|
328
|
-
const b = other.build[i];
|
|
329
|
-
debug("build compare", i, a, b);
|
|
330
|
-
if (a === void 0 && b === void 0) return 0;
|
|
331
|
-
else if (b === void 0) return 1;
|
|
332
|
-
else if (a === void 0) return -1;
|
|
333
|
-
else if (a === b) continue;
|
|
334
|
-
else return compareIdentifiers(a, b);
|
|
335
|
-
} while (++i);
|
|
336
|
-
}
|
|
337
|
-
inc(release, identifier, identifierBase) {
|
|
338
|
-
if (release.startsWith("pre")) {
|
|
339
|
-
if (!identifier && identifierBase === false) throw new Error("invalid increment argument: identifier is empty");
|
|
340
|
-
if (identifier) {
|
|
341
|
-
const match = `-${identifier}`.match(this.options.loose ? re[t.PRERELEASELOOSE] : re[t.PRERELEASE]);
|
|
342
|
-
if (!match || match[1] !== identifier) throw new Error(`invalid identifier: ${identifier}`);
|
|
343
|
-
}
|
|
344
|
-
}
|
|
345
|
-
switch (release) {
|
|
346
|
-
case "premajor":
|
|
347
|
-
this.prerelease.length = 0;
|
|
348
|
-
this.patch = 0;
|
|
349
|
-
this.minor = 0;
|
|
350
|
-
this.major++;
|
|
351
|
-
this.inc("pre", identifier, identifierBase);
|
|
352
|
-
break;
|
|
353
|
-
case "preminor":
|
|
354
|
-
this.prerelease.length = 0;
|
|
355
|
-
this.patch = 0;
|
|
356
|
-
this.minor++;
|
|
357
|
-
this.inc("pre", identifier, identifierBase);
|
|
358
|
-
break;
|
|
359
|
-
case "prepatch":
|
|
360
|
-
this.prerelease.length = 0;
|
|
361
|
-
this.inc("patch", identifier, identifierBase);
|
|
362
|
-
this.inc("pre", identifier, identifierBase);
|
|
363
|
-
break;
|
|
364
|
-
case "prerelease":
|
|
365
|
-
if (this.prerelease.length === 0) this.inc("patch", identifier, identifierBase);
|
|
366
|
-
this.inc("pre", identifier, identifierBase);
|
|
367
|
-
break;
|
|
368
|
-
case "release":
|
|
369
|
-
if (this.prerelease.length === 0) throw new Error(`version ${this.raw} is not a prerelease`);
|
|
370
|
-
this.prerelease.length = 0;
|
|
371
|
-
break;
|
|
372
|
-
case "major":
|
|
373
|
-
if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) this.major++;
|
|
374
|
-
this.minor = 0;
|
|
375
|
-
this.patch = 0;
|
|
376
|
-
this.prerelease = [];
|
|
377
|
-
break;
|
|
378
|
-
case "minor":
|
|
379
|
-
if (this.patch !== 0 || this.prerelease.length === 0) this.minor++;
|
|
380
|
-
this.patch = 0;
|
|
381
|
-
this.prerelease = [];
|
|
382
|
-
break;
|
|
383
|
-
case "patch":
|
|
384
|
-
if (this.prerelease.length === 0) this.patch++;
|
|
385
|
-
this.prerelease = [];
|
|
386
|
-
break;
|
|
387
|
-
case "pre": {
|
|
388
|
-
const base = Number(identifierBase) ? 1 : 0;
|
|
389
|
-
if (this.prerelease.length === 0) this.prerelease = [base];
|
|
390
|
-
else {
|
|
391
|
-
let i = this.prerelease.length;
|
|
392
|
-
while (--i >= 0) if (typeof this.prerelease[i] === "number") {
|
|
393
|
-
this.prerelease[i]++;
|
|
394
|
-
i = -2;
|
|
395
|
-
}
|
|
396
|
-
if (i === -1) {
|
|
397
|
-
if (identifier === this.prerelease.join(".") && identifierBase === false) throw new Error("invalid increment argument: identifier already exists");
|
|
398
|
-
this.prerelease.push(base);
|
|
399
|
-
}
|
|
400
|
-
}
|
|
401
|
-
if (identifier) {
|
|
402
|
-
let prerelease = [identifier, base];
|
|
403
|
-
if (identifierBase === false) prerelease = [identifier];
|
|
404
|
-
if (isPrereleaseIdentifier(this.prerelease, identifier)) {
|
|
405
|
-
const prereleaseBase = this.prerelease[identifier.split(".").length];
|
|
406
|
-
if (isNaN(prereleaseBase)) this.prerelease = prerelease;
|
|
407
|
-
} else this.prerelease = prerelease;
|
|
408
|
-
}
|
|
409
|
-
break;
|
|
410
|
-
}
|
|
411
|
-
default: throw new Error(`invalid increment argument: ${release}`);
|
|
412
|
-
}
|
|
413
|
-
this.raw = this.format();
|
|
414
|
-
if (this.build.length) this.raw += `+${this.build.join(".")}`;
|
|
415
|
-
return this;
|
|
416
|
-
}
|
|
417
|
-
};
|
|
418
|
-
}));
|
|
419
|
-
//#endregion
|
|
420
|
-
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/parse.js
|
|
421
|
-
var require_parse$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
|
|
422
|
-
const SemVer = require_semver$2();
|
|
423
|
-
const parse = (version, options, throwErrors = false) => {
|
|
424
|
-
if (version instanceof SemVer) return version;
|
|
425
|
-
try {
|
|
426
|
-
return new SemVer(version, options);
|
|
427
|
-
} catch (er) {
|
|
428
|
-
if (!throwErrors) return null;
|
|
429
|
-
throw er;
|
|
430
|
-
}
|
|
431
|
-
};
|
|
432
|
-
module.exports = parse;
|
|
433
|
-
}));
|
|
434
|
-
//#endregion
|
|
435
|
-
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/valid.js
|
|
436
|
-
var require_valid$3 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
|
|
437
|
-
const parse = require_parse$1();
|
|
438
|
-
const valid = (version, options) => {
|
|
439
|
-
const v = parse(version, options);
|
|
440
|
-
return v ? v.version : null;
|
|
441
|
-
};
|
|
442
|
-
module.exports = valid;
|
|
443
|
-
}));
|
|
444
|
-
//#endregion
|
|
445
|
-
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/clean.js
|
|
446
|
-
var require_clean$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
|
|
447
|
-
const parse = require_parse$1();
|
|
448
|
-
const clean = (version, options) => {
|
|
449
|
-
const s = parse(version.trim().replace(/^[=v]+/, ""), options);
|
|
450
|
-
return s ? s.version : null;
|
|
451
|
-
};
|
|
452
|
-
module.exports = clean;
|
|
453
|
-
}));
|
|
454
|
-
//#endregion
|
|
455
|
-
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/inc.js
|
|
456
|
-
var require_inc$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
|
|
457
|
-
const SemVer = require_semver$2();
|
|
458
|
-
const inc = (version, release, options, identifier, identifierBase) => {
|
|
459
|
-
if (typeof options === "string") {
|
|
460
|
-
identifierBase = identifier;
|
|
461
|
-
identifier = options;
|
|
462
|
-
options = void 0;
|
|
463
|
-
}
|
|
464
|
-
try {
|
|
465
|
-
return new SemVer(version instanceof SemVer ? version.version : version, options).inc(release, identifier, identifierBase).version;
|
|
466
|
-
} catch (er) {
|
|
467
|
-
return null;
|
|
468
|
-
}
|
|
469
|
-
};
|
|
470
|
-
module.exports = inc;
|
|
471
|
-
}));
|
|
472
|
-
//#endregion
|
|
473
|
-
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/diff.js
|
|
474
|
-
var require_diff$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
|
|
475
|
-
const parse = require_parse$1();
|
|
476
|
-
const diff = (version1, version2) => {
|
|
477
|
-
const v1 = parse(version1, null, true);
|
|
478
|
-
const v2 = parse(version2, null, true);
|
|
479
|
-
const comparison = v1.compare(v2);
|
|
480
|
-
if (comparison === 0) return null;
|
|
481
|
-
const v1Higher = comparison > 0;
|
|
482
|
-
const highVersion = v1Higher ? v1 : v2;
|
|
483
|
-
const lowVersion = v1Higher ? v2 : v1;
|
|
484
|
-
const highHasPre = !!highVersion.prerelease.length;
|
|
485
|
-
if (!!lowVersion.prerelease.length && !highHasPre) {
|
|
486
|
-
if (!lowVersion.patch && !lowVersion.minor) return "major";
|
|
487
|
-
if (lowVersion.compareMain(highVersion) === 0) {
|
|
488
|
-
if (lowVersion.minor && !lowVersion.patch) return "minor";
|
|
489
|
-
return "patch";
|
|
490
|
-
}
|
|
491
|
-
}
|
|
492
|
-
const prefix = highHasPre ? "pre" : "";
|
|
493
|
-
if (v1.major !== v2.major) return prefix + "major";
|
|
494
|
-
if (v1.minor !== v2.minor) return prefix + "minor";
|
|
495
|
-
if (v1.patch !== v2.patch) return prefix + "patch";
|
|
496
|
-
return "prerelease";
|
|
497
|
-
};
|
|
498
|
-
module.exports = diff;
|
|
499
|
-
}));
|
|
500
|
-
//#endregion
|
|
501
|
-
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/major.js
|
|
502
|
-
var require_major$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
|
|
503
|
-
const SemVer = require_semver$2();
|
|
504
|
-
const major = (a, loose) => new SemVer(a, loose).major;
|
|
505
|
-
module.exports = major;
|
|
506
|
-
}));
|
|
507
|
-
//#endregion
|
|
508
|
-
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/minor.js
|
|
509
|
-
var require_minor$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
|
|
510
|
-
const SemVer = require_semver$2();
|
|
511
|
-
const minor = (a, loose) => new SemVer(a, loose).minor;
|
|
512
|
-
module.exports = minor;
|
|
513
|
-
}));
|
|
514
|
-
//#endregion
|
|
515
|
-
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/patch.js
|
|
516
|
-
var require_patch$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
|
|
517
|
-
const SemVer = require_semver$2();
|
|
518
|
-
const patch = (a, loose) => new SemVer(a, loose).patch;
|
|
519
|
-
module.exports = patch;
|
|
520
|
-
}));
|
|
521
|
-
//#endregion
|
|
522
|
-
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/prerelease.js
|
|
523
|
-
var require_prerelease$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
|
|
524
|
-
const parse = require_parse$1();
|
|
525
|
-
const prerelease = (version, options) => {
|
|
526
|
-
const parsed = parse(version, options);
|
|
527
|
-
return parsed && parsed.prerelease.length ? parsed.prerelease : null;
|
|
528
|
-
};
|
|
529
|
-
module.exports = prerelease;
|
|
530
|
-
}));
|
|
531
|
-
//#endregion
|
|
532
|
-
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/compare.js
|
|
533
|
-
var require_compare$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
|
|
534
|
-
const SemVer = require_semver$2();
|
|
535
|
-
const compare = (a, b, loose) => new SemVer(a, loose).compare(new SemVer(b, loose));
|
|
536
|
-
module.exports = compare;
|
|
537
|
-
}));
|
|
538
|
-
//#endregion
|
|
539
|
-
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/rcompare.js
|
|
540
|
-
var require_rcompare$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
|
|
541
|
-
const compare = require_compare$1();
|
|
542
|
-
const rcompare = (a, b, loose) => compare(b, a, loose);
|
|
543
|
-
module.exports = rcompare;
|
|
544
|
-
}));
|
|
545
|
-
//#endregion
|
|
546
|
-
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/compare-loose.js
|
|
547
|
-
var require_compare_loose$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
|
|
548
|
-
const compare = require_compare$1();
|
|
549
|
-
const compareLoose = (a, b) => compare(a, b, true);
|
|
550
|
-
module.exports = compareLoose;
|
|
551
|
-
}));
|
|
552
|
-
//#endregion
|
|
553
|
-
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/compare-build.js
|
|
554
|
-
var require_compare_build$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
|
|
555
|
-
const SemVer = require_semver$2();
|
|
556
|
-
const compareBuild = (a, b, loose) => {
|
|
557
|
-
const versionA = new SemVer(a, loose);
|
|
558
|
-
const versionB = new SemVer(b, loose);
|
|
559
|
-
return versionA.compare(versionB) || versionA.compareBuild(versionB);
|
|
560
|
-
};
|
|
561
|
-
module.exports = compareBuild;
|
|
562
|
-
}));
|
|
563
|
-
//#endregion
|
|
564
|
-
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/sort.js
|
|
565
|
-
var require_sort$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
|
|
566
|
-
const compareBuild = require_compare_build$1();
|
|
567
|
-
const sort = (list, loose) => list.sort((a, b) => compareBuild(a, b, loose));
|
|
568
|
-
module.exports = sort;
|
|
569
|
-
}));
|
|
570
|
-
//#endregion
|
|
571
|
-
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/rsort.js
|
|
572
|
-
var require_rsort$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
|
|
573
|
-
const compareBuild = require_compare_build$1();
|
|
574
|
-
const rsort = (list, loose) => list.sort((a, b) => compareBuild(b, a, loose));
|
|
575
|
-
module.exports = rsort;
|
|
576
|
-
}));
|
|
577
|
-
//#endregion
|
|
578
|
-
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/gt.js
|
|
579
|
-
var require_gt$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
|
|
580
|
-
const compare = require_compare$1();
|
|
581
|
-
const gt = (a, b, loose) => compare(a, b, loose) > 0;
|
|
582
|
-
module.exports = gt;
|
|
583
|
-
}));
|
|
584
|
-
//#endregion
|
|
585
|
-
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/lt.js
|
|
586
|
-
var require_lt$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
|
|
587
|
-
const compare = require_compare$1();
|
|
588
|
-
const lt = (a, b, loose) => compare(a, b, loose) < 0;
|
|
589
|
-
module.exports = lt;
|
|
590
|
-
}));
|
|
591
|
-
//#endregion
|
|
592
|
-
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/eq.js
|
|
593
|
-
var require_eq$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
|
|
594
|
-
const compare = require_compare$1();
|
|
595
|
-
const eq = (a, b, loose) => compare(a, b, loose) === 0;
|
|
596
|
-
module.exports = eq;
|
|
597
|
-
}));
|
|
598
|
-
//#endregion
|
|
599
|
-
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/neq.js
|
|
600
|
-
var require_neq$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
|
|
601
|
-
const compare = require_compare$1();
|
|
602
|
-
const neq = (a, b, loose) => compare(a, b, loose) !== 0;
|
|
603
|
-
module.exports = neq;
|
|
604
|
-
}));
|
|
605
|
-
//#endregion
|
|
606
|
-
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/gte.js
|
|
607
|
-
var require_gte$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
|
|
608
|
-
const compare = require_compare$1();
|
|
609
|
-
const gte = (a, b, loose) => compare(a, b, loose) >= 0;
|
|
610
|
-
module.exports = gte;
|
|
611
|
-
}));
|
|
612
|
-
//#endregion
|
|
613
|
-
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/lte.js
|
|
614
|
-
var require_lte$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
|
|
615
|
-
const compare = require_compare$1();
|
|
616
|
-
const lte = (a, b, loose) => compare(a, b, loose) <= 0;
|
|
617
|
-
module.exports = lte;
|
|
618
|
-
}));
|
|
619
|
-
//#endregion
|
|
620
|
-
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/cmp.js
|
|
621
|
-
var require_cmp$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
|
|
622
|
-
const eq = require_eq$1();
|
|
623
|
-
const neq = require_neq$1();
|
|
624
|
-
const gt = require_gt$1();
|
|
625
|
-
const gte = require_gte$1();
|
|
626
|
-
const lt = require_lt$1();
|
|
627
|
-
const lte = require_lte$1();
|
|
628
|
-
const cmp = (a, op, b, loose) => {
|
|
629
|
-
switch (op) {
|
|
630
|
-
case "===":
|
|
631
|
-
if (typeof a === "object") a = a.version;
|
|
632
|
-
if (typeof b === "object") b = b.version;
|
|
633
|
-
return a === b;
|
|
634
|
-
case "!==":
|
|
635
|
-
if (typeof a === "object") a = a.version;
|
|
636
|
-
if (typeof b === "object") b = b.version;
|
|
637
|
-
return a !== b;
|
|
638
|
-
case "":
|
|
639
|
-
case "=":
|
|
640
|
-
case "==": return eq(a, b, loose);
|
|
641
|
-
case "!=": return neq(a, b, loose);
|
|
642
|
-
case ">": return gt(a, b, loose);
|
|
643
|
-
case ">=": return gte(a, b, loose);
|
|
644
|
-
case "<": return lt(a, b, loose);
|
|
645
|
-
case "<=": return lte(a, b, loose);
|
|
646
|
-
default: throw new TypeError(`Invalid operator: ${op}`);
|
|
647
|
-
}
|
|
648
|
-
};
|
|
649
|
-
module.exports = cmp;
|
|
650
|
-
}));
|
|
651
|
-
//#endregion
|
|
652
|
-
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/coerce.js
|
|
653
|
-
var require_coerce$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
|
|
654
|
-
const SemVer = require_semver$2();
|
|
655
|
-
const parse = require_parse$1();
|
|
656
|
-
const { safeRe: re, t } = require_re$1();
|
|
657
|
-
const coerce = (version, options) => {
|
|
658
|
-
if (version instanceof SemVer) return version;
|
|
659
|
-
if (typeof version === "number") version = String(version);
|
|
660
|
-
if (typeof version !== "string") return null;
|
|
661
|
-
options = options || {};
|
|
662
|
-
let match = null;
|
|
663
|
-
if (!options.rtl) match = version.match(options.includePrerelease ? re[t.COERCEFULL] : re[t.COERCE]);
|
|
664
|
-
else {
|
|
665
|
-
const coerceRtlRegex = options.includePrerelease ? re[t.COERCERTLFULL] : re[t.COERCERTL];
|
|
666
|
-
let next;
|
|
667
|
-
while ((next = coerceRtlRegex.exec(version)) && (!match || match.index + match[0].length !== version.length)) {
|
|
668
|
-
if (!match || next.index + next[0].length !== match.index + match[0].length) match = next;
|
|
669
|
-
coerceRtlRegex.lastIndex = next.index + next[1].length + next[2].length;
|
|
670
|
-
}
|
|
671
|
-
coerceRtlRegex.lastIndex = -1;
|
|
672
|
-
}
|
|
673
|
-
if (match === null) return null;
|
|
674
|
-
const major = match[2];
|
|
675
|
-
return parse(`${major}.${match[3] || "0"}.${match[4] || "0"}${options.includePrerelease && match[5] ? `-${match[5]}` : ""}${options.includePrerelease && match[6] ? `+${match[6]}` : ""}`, options);
|
|
676
|
-
};
|
|
677
|
-
module.exports = coerce;
|
|
678
|
-
}));
|
|
679
|
-
//#endregion
|
|
680
|
-
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/truncate.js
|
|
681
|
-
var require_truncate$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
|
|
682
|
-
const parse = require_parse$1();
|
|
683
|
-
const constants = require_constants$1();
|
|
684
|
-
const SemVer = require_semver$2();
|
|
685
|
-
const truncate = (version, truncation, options) => {
|
|
686
|
-
if (!constants.RELEASE_TYPES.includes(truncation)) return null;
|
|
687
|
-
const clonedVersion = cloneInputVersion(version, options);
|
|
688
|
-
return clonedVersion && doTruncation(clonedVersion, truncation);
|
|
689
|
-
};
|
|
690
|
-
const cloneInputVersion = (version, options) => {
|
|
691
|
-
return parse(version instanceof SemVer ? version.version : version, options);
|
|
692
|
-
};
|
|
693
|
-
const doTruncation = (version, truncation) => {
|
|
694
|
-
if (isPrerelease(truncation)) return version.version;
|
|
695
|
-
version.prerelease = [];
|
|
696
|
-
switch (truncation) {
|
|
697
|
-
case "major":
|
|
698
|
-
version.minor = 0;
|
|
699
|
-
version.patch = 0;
|
|
700
|
-
break;
|
|
701
|
-
case "minor":
|
|
702
|
-
version.patch = 0;
|
|
703
|
-
break;
|
|
704
|
-
}
|
|
705
|
-
return version.format();
|
|
706
|
-
};
|
|
707
|
-
const isPrerelease = (type) => {
|
|
708
|
-
return type.startsWith("pre");
|
|
122
|
+
for (const [token, maximum] of replacements) source = source.split(`${token}*`).join(`${token}{0,${maximum}}`).split(`${token}+`).join(`${token}{1,${maximum}}`);
|
|
123
|
+
return source;
|
|
124
|
+
}
|
|
125
|
+
function safeRegex$1(source, flags) {
|
|
126
|
+
return new RegExp(makeSafeRegexSource$1(source), flags);
|
|
127
|
+
}
|
|
128
|
+
const NUMERIC$1$1 = /^\d+$/;
|
|
129
|
+
function compareIdentifiers$1(left, right) {
|
|
130
|
+
if (typeof left === "number" && typeof right === "number") return left === right ? 0 : left < right ? -1 : 1;
|
|
131
|
+
const leftNumeric = NUMERIC$1$1.test(String(left));
|
|
132
|
+
const rightNumeric = NUMERIC$1$1.test(String(right));
|
|
133
|
+
const normalizedLeft = leftNumeric ? Number(left) : left;
|
|
134
|
+
const normalizedRight = rightNumeric ? Number(right) : right;
|
|
135
|
+
return normalizedLeft === normalizedRight ? 0 : leftNumeric && !rightNumeric ? -1 : rightNumeric && !leftNumeric ? 1 : normalizedLeft < normalizedRight ? -1 : 1;
|
|
136
|
+
}
|
|
137
|
+
const FULL$1 = safeRegex$1(`^${FULL_PLAIN$1}$`);
|
|
138
|
+
const LOOSE$1 = safeRegex$1(`^${LOOSE_PLAIN$1}$`);
|
|
139
|
+
safeRegex$1(`^${PRERELEASE$1}$`);
|
|
140
|
+
safeRegex$1(`^${PRERELEASE_LOOSE$1}$`);
|
|
141
|
+
const COERCE_EXACT$1 = safeRegex$1(COERCE$1);
|
|
142
|
+
const COERCE_FULL_EXACT$1 = safeRegex$1(COERCE_FULL$1);
|
|
143
|
+
const NUMERIC$2 = /^\d+$/;
|
|
144
|
+
function formatComparableVersion$1(version) {
|
|
145
|
+
const base = `${version.major}.${version.minor}.${version.patch}`;
|
|
146
|
+
return version.prerelease?.length ? `${base}-${version.prerelease.join(".")}` : base;
|
|
147
|
+
}
|
|
148
|
+
function formatFullVersion$1(version) {
|
|
149
|
+
const comparable = formatComparableVersion$1(version);
|
|
150
|
+
return version.build?.length ? `${comparable}+${version.build.join(".")}` : comparable;
|
|
151
|
+
}
|
|
152
|
+
function parse$1(version, options = {}) {
|
|
153
|
+
if (typeof version !== "string") return version;
|
|
154
|
+
if (version.length > 256) throw new TypeError(`Version exceeds the maximum length of 256 characters`);
|
|
155
|
+
const match = version.trim().match(options.loose ? LOOSE$1 : FULL$1);
|
|
156
|
+
if (!match) throw new TypeError(`Invalid version syntax: ${version}`);
|
|
157
|
+
const major = Number(match[1]);
|
|
158
|
+
const minor = Number(match[2]);
|
|
159
|
+
const patch = Number(match[3]);
|
|
160
|
+
if (major > Number.MAX_SAFE_INTEGER || major < 0) throw new TypeError(`Invalid major version: ${match[1]}`);
|
|
161
|
+
if (minor > Number.MAX_SAFE_INTEGER || minor < 0) throw new TypeError(`Invalid minor version: ${match[2]}`);
|
|
162
|
+
if (patch > Number.MAX_SAFE_INTEGER || patch < 0) throw new TypeError(`Invalid patch version: ${match[3]}`);
|
|
163
|
+
const prerelease = match[4] ? match[4].split(".").map((identifier) => {
|
|
164
|
+
if (NUMERIC$2.test(identifier)) {
|
|
165
|
+
const numeric = Number(identifier);
|
|
166
|
+
if (numeric >= 0 && numeric < Number.MAX_SAFE_INTEGER) return numeric;
|
|
167
|
+
}
|
|
168
|
+
return identifier;
|
|
169
|
+
}) : void 0;
|
|
170
|
+
return {
|
|
171
|
+
build: match[5]?.split("."),
|
|
172
|
+
major,
|
|
173
|
+
minor,
|
|
174
|
+
patch,
|
|
175
|
+
prerelease
|
|
709
176
|
};
|
|
710
|
-
|
|
711
|
-
})
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
177
|
+
}
|
|
178
|
+
function tryParse$1(version, options = {}) {
|
|
179
|
+
try {
|
|
180
|
+
return parse$1(version, options);
|
|
181
|
+
} catch {
|
|
182
|
+
return null;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
function compareMainParsed$1(left, right) {
|
|
186
|
+
return left.major === right.major ? left.minor === right.minor ? left.patch === right.patch ? 0 : left.patch < right.patch ? -1 : 1 : left.minor < right.minor ? -1 : 1 : left.major < right.major ? -1 : 1;
|
|
187
|
+
}
|
|
188
|
+
function comparePrereleaseParsed$1(left, right) {
|
|
189
|
+
const leftPrerelease = left.prerelease;
|
|
190
|
+
const rightPrerelease = right.prerelease;
|
|
191
|
+
if (leftPrerelease?.length && !rightPrerelease?.length) return -1;
|
|
192
|
+
if (!leftPrerelease?.length && rightPrerelease?.length) return 1;
|
|
193
|
+
if (!leftPrerelease?.length && !rightPrerelease?.length) return 0;
|
|
194
|
+
for (let index = 0;; index++) {
|
|
195
|
+
const leftIdentifier = leftPrerelease?.[index];
|
|
196
|
+
const rightIdentifier = rightPrerelease?.[index];
|
|
197
|
+
if (leftIdentifier === void 0 && rightIdentifier === void 0) return 0;
|
|
198
|
+
if (rightIdentifier === void 0) return 1;
|
|
199
|
+
if (leftIdentifier === void 0) return -1;
|
|
200
|
+
if (leftIdentifier !== rightIdentifier) return compareIdentifiers$1(leftIdentifier, rightIdentifier);
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
function compareParsed$1(left, right) {
|
|
204
|
+
return compareMainParsed$1(left, right) || comparePrereleaseParsed$1(left, right);
|
|
205
|
+
}
|
|
206
|
+
function coerceParsedVersion$1(value, options = {}) {
|
|
207
|
+
if (typeof value === "object") return value;
|
|
208
|
+
const input = typeof value === "number" ? String(value) : value;
|
|
209
|
+
if (typeof input !== "string") return null;
|
|
210
|
+
let match = null;
|
|
211
|
+
if (options.rtl) {
|
|
212
|
+
const expression = safeRegex$1(options.includePrerelease ? COERCE_FULL$1 : COERCE$1, "g");
|
|
213
|
+
let next;
|
|
214
|
+
while ((next = expression.exec(input)) && (!match || match.index + match[0].length !== input.length)) {
|
|
215
|
+
if (!match || next.index + next[0].length !== match.index + match[0].length) match = next;
|
|
216
|
+
expression.lastIndex = next.index + next[1].length + next[2].length;
|
|
217
|
+
}
|
|
218
|
+
} else match = (options.includePrerelease ? COERCE_FULL_EXACT$1 : COERCE_EXACT$1).exec(input);
|
|
219
|
+
if (!match) return null;
|
|
220
|
+
const major = match[2];
|
|
221
|
+
return tryParse$1(`${major}.${match[3] || "0"}.${match[4] || "0"}${options.includePrerelease && match[5] ? `-${match[5]}` : ""}${options.includePrerelease && match[6] ? `+${match[6]}` : ""}`, options);
|
|
222
|
+
}
|
|
223
|
+
const STRICT_COMPARATOR$1 = safeRegex$1(String.raw`^${GREATER_LESS_THAN$1}\s*(${FULL_PLAIN$1})$|^$`);
|
|
224
|
+
const LOOSE_COMPARATOR$1$1 = safeRegex$1(String.raw`^${GREATER_LESS_THAN$1}\s*(${LOOSE_PLAIN$1})$|^$`);
|
|
225
|
+
function parseComparator$1(comparator, options = {}) {
|
|
226
|
+
const normalized = comparator.trim().replaceAll(/\s+/g, " ");
|
|
227
|
+
const match = normalized.match(options.loose ? LOOSE_COMPARATOR$1$1 : STRICT_COMPARATOR$1);
|
|
228
|
+
if (!match) throw new TypeError(`Invalid comparator: ${normalized}`);
|
|
229
|
+
const operator = match[1] === "=" ? "" : match[1] || "";
|
|
230
|
+
const version = match[2] ? parse$1(match[2], options) : null;
|
|
231
|
+
return {
|
|
232
|
+
operator,
|
|
233
|
+
options,
|
|
234
|
+
value: version ? `${operator}${formatComparableVersion$1(version)}` : "",
|
|
235
|
+
version
|
|
742
236
|
};
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
}
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
version = new SemVer(version, this.options);
|
|
847
|
-
} catch (er) {
|
|
848
|
-
return false;
|
|
237
|
+
}
|
|
238
|
+
function testParsedComparator$1(comparator, version) {
|
|
239
|
+
if (!comparator.version) return true;
|
|
240
|
+
const comparison = compareParsed$1(version, comparator.version);
|
|
241
|
+
switch (comparator.operator) {
|
|
242
|
+
case "": return comparison === 0;
|
|
243
|
+
case ">": return comparison > 0;
|
|
244
|
+
case ">=": return comparison >= 0;
|
|
245
|
+
case "<": return comparison < 0;
|
|
246
|
+
case "<=": return comparison <= 0;
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
function comparatorAllowsPrerelease$1(comparator, version) {
|
|
250
|
+
const allowed = comparator.version;
|
|
251
|
+
return allowed !== null && !!allowed.prerelease?.length && allowed.major === version.major && allowed.minor === version.minor && allowed.patch === version.patch;
|
|
252
|
+
}
|
|
253
|
+
function testComparatorSet$1(set, version, options) {
|
|
254
|
+
if (set.some((comparator) => !testParsedComparator$1(comparator, version))) return false;
|
|
255
|
+
return !version.prerelease?.length || !!options.includePrerelease || set.some((comparator) => comparatorAllowsPrerelease$1(comparator, version));
|
|
256
|
+
}
|
|
257
|
+
function compare(left, right, options = {}) {
|
|
258
|
+
return compareParsed$1(parse$1(left, options), parse$1(right, options));
|
|
259
|
+
}
|
|
260
|
+
function isGreaterOrEqual(left, right, options = {}) {
|
|
261
|
+
return compare(left, right, options) >= 0;
|
|
262
|
+
}
|
|
263
|
+
const BUILD_STRIP$1 = new RegExp(BUILD$1, "g");
|
|
264
|
+
const BUILD_SAFE$1 = safeRegex$1(BUILD$1);
|
|
265
|
+
const STRICT_HYPHEN$1 = safeRegex$1(String.raw`^\s*(${XRANGE_PLAIN$1})\s+-\s+(${XRANGE_PLAIN$1})\s*$`);
|
|
266
|
+
const LOOSE_HYPHEN$1 = safeRegex$1(String.raw`^\s*(${XRANGE_PLAIN_LOOSE$1})\s+-\s+(${XRANGE_PLAIN_LOOSE$1})\s*$`);
|
|
267
|
+
const COMPARATOR_TRIM$1 = safeRegex$1(String.raw`(\s*)${GREATER_LESS_THAN$1}\s*(${LOOSE_PLAIN$1}|${XRANGE_PLAIN$1})`, "g");
|
|
268
|
+
const TILDE_TRIM$1 = safeRegex$1(String.raw`(\s*)${LONE_TILDE$1}\s+`, "g");
|
|
269
|
+
const CARET_TRIM$1 = safeRegex$1(String.raw`(\s*)${LONE_CARET$1}\s+`, "g");
|
|
270
|
+
const STRICT_TILDE$1 = safeRegex$1(`^${LONE_TILDE$1}${XRANGE_PLAIN$1}$`);
|
|
271
|
+
const LOOSE_TILDE$1 = safeRegex$1(`^${LONE_TILDE$1}${XRANGE_PLAIN_LOOSE$1}$`);
|
|
272
|
+
const STRICT_CARET$1 = safeRegex$1(`^${LONE_CARET$1}${XRANGE_PLAIN$1}$`);
|
|
273
|
+
const LOOSE_CARET$1 = safeRegex$1(`^${LONE_CARET$1}${XRANGE_PLAIN_LOOSE$1}$`);
|
|
274
|
+
const STRICT_XRANGE$1 = safeRegex$1(String.raw`^${GREATER_LESS_THAN$1}\s*${XRANGE_PLAIN$1}$`);
|
|
275
|
+
const LOOSE_XRANGE$1 = safeRegex$1(String.raw`^${GREATER_LESS_THAN$1}\s*${XRANGE_PLAIN_LOOSE$1}$`);
|
|
276
|
+
const STAR$1 = safeRegex$1(String.raw`(<|>)?=?\s*\*`);
|
|
277
|
+
const GTE_ZERO$1 = /^\s*>=\s*0\.0\.0\s*$/;
|
|
278
|
+
const GTE_ZERO_PRERELEASE$1 = /^\s*>=\s*0\.0\.0-0\s*$/;
|
|
279
|
+
const LOOSE_COMPARATOR$2 = safeRegex$1(String.raw`^${GREATER_LESS_THAN$1}\s*(${LOOSE_PLAIN$1})$|^$`);
|
|
280
|
+
function isWildcard$1(value) {
|
|
281
|
+
return !value || String(value).toLowerCase() === "x" || String(value) === "*";
|
|
282
|
+
}
|
|
283
|
+
function hasInvalidWildcardOrder$1(major, minor, patch) {
|
|
284
|
+
return isWildcard$1(major) && !isWildcard$1(minor) || isWildcard$1(minor) && Boolean(patch) && !isWildcard$1(patch);
|
|
285
|
+
}
|
|
286
|
+
function replaceTilde$1(comparator, options) {
|
|
287
|
+
const expression = options.loose ? LOOSE_TILDE$1 : STRICT_TILDE$1;
|
|
288
|
+
const lowerPrerelease = options.includePrerelease ? "-0" : "";
|
|
289
|
+
return comparator.replace(expression, (_match, major, minor, patch, prerelease) => {
|
|
290
|
+
if (isWildcard$1(major)) return "";
|
|
291
|
+
if (isWildcard$1(minor)) return `>=${major}.0.0${lowerPrerelease} <${Number(major) + 1}.0.0-0`;
|
|
292
|
+
if (isWildcard$1(patch)) return `>=${major}.${minor}.0${lowerPrerelease} <${major}.${Number(minor) + 1}.0-0`;
|
|
293
|
+
return prerelease ? `>=${major}.${minor}.${patch}-${prerelease} <${major}.${Number(minor) + 1}.0-0` : `>=${major}.${minor}.${patch} <${major}.${Number(minor) + 1}.0-0`;
|
|
294
|
+
});
|
|
295
|
+
}
|
|
296
|
+
function replaceTildes$1(comparator, options) {
|
|
297
|
+
return comparator.trim().split(/\s+/).map((part) => replaceTilde$1(part, options)).join(" ");
|
|
298
|
+
}
|
|
299
|
+
function replaceCaret$1(comparator, options) {
|
|
300
|
+
const expression = options.loose ? LOOSE_CARET$1 : STRICT_CARET$1;
|
|
301
|
+
const lowerPrerelease = options.includePrerelease ? "-0" : "";
|
|
302
|
+
return comparator.replace(expression, (_match, major, minor, patch, prerelease) => {
|
|
303
|
+
if (isWildcard$1(major)) return "";
|
|
304
|
+
if (isWildcard$1(minor)) return `>=${major}.0.0${lowerPrerelease} <${Number(major) + 1}.0.0-0`;
|
|
305
|
+
if (isWildcard$1(patch)) return major === "0" ? `>=${major}.${minor}.0${lowerPrerelease} <${major}.${Number(minor) + 1}.0-0` : `>=${major}.${minor}.0${lowerPrerelease} <${Number(major) + 1}.0.0-0`;
|
|
306
|
+
if (prerelease) return major === "0" ? minor === "0" ? `>=${major}.${minor}.${patch}-${prerelease} <${major}.${minor}.${Number(patch) + 1}-0` : `>=${major}.${minor}.${patch}-${prerelease} <${major}.${Number(minor) + 1}.0-0` : `>=${major}.${minor}.${patch}-${prerelease} <${Number(major) + 1}.0.0-0`;
|
|
307
|
+
return major === "0" ? minor === "0" ? `>=${major}.${minor}.${patch} <${major}.${minor}.${Number(patch) + 1}-0` : `>=${major}.${minor}.${patch} <${major}.${Number(minor) + 1}.0-0` : `>=${major}.${minor}.${patch} <${Number(major) + 1}.0.0-0`;
|
|
308
|
+
});
|
|
309
|
+
}
|
|
310
|
+
function replaceCarets$1(comparator, options) {
|
|
311
|
+
return comparator.trim().split(/\s+/).map((part) => replaceCaret$1(part, options)).join(" ");
|
|
312
|
+
}
|
|
313
|
+
function replaceXRange$1(comparator, options) {
|
|
314
|
+
const expression = options.loose ? LOOSE_XRANGE$1 : STRICT_XRANGE$1;
|
|
315
|
+
return comparator.trim().replace(expression, (match, rawOperator, rawMajor, rawMinor, rawPatch) => {
|
|
316
|
+
let operator = rawOperator;
|
|
317
|
+
let major = rawMajor;
|
|
318
|
+
let minor = rawMinor;
|
|
319
|
+
let patch = rawPatch;
|
|
320
|
+
if (hasInvalidWildcardOrder$1(String(major), minor === void 0 ? void 0 : String(minor), patch === void 0 ? void 0 : String(patch))) return comparator;
|
|
321
|
+
const wildcardMajor = isWildcard$1(major);
|
|
322
|
+
const wildcardMinor = wildcardMajor || isWildcard$1(minor);
|
|
323
|
+
const wildcardPatch = wildcardMinor || isWildcard$1(patch);
|
|
324
|
+
if (operator === "=" && wildcardPatch) operator = "";
|
|
325
|
+
if (wildcardMajor) return operator === ">" || operator === "<" ? "<0.0.0-0" : "*";
|
|
326
|
+
let prerelease = options.includePrerelease ? "-0" : "";
|
|
327
|
+
if (operator && wildcardPatch) {
|
|
328
|
+
if (wildcardMinor) minor = 0;
|
|
329
|
+
patch = 0;
|
|
330
|
+
if (operator === ">") {
|
|
331
|
+
operator = ">=";
|
|
332
|
+
if (wildcardMinor) {
|
|
333
|
+
major = Number(major) + 1;
|
|
334
|
+
minor = 0;
|
|
335
|
+
} else minor = Number(minor) + 1;
|
|
336
|
+
} else if (operator === "<=") {
|
|
337
|
+
operator = "<";
|
|
338
|
+
if (wildcardMinor) major = Number(major) + 1;
|
|
339
|
+
else minor = Number(minor) + 1;
|
|
849
340
|
}
|
|
850
|
-
|
|
851
|
-
return
|
|
852
|
-
}
|
|
853
|
-
};
|
|
854
|
-
const cache = new (require_lrucache$1())();
|
|
855
|
-
const parseOptions = require_parse_options$1();
|
|
856
|
-
const Comparator = require_comparator$1();
|
|
857
|
-
const debug = require_debug$1();
|
|
858
|
-
const SemVer = require_semver$2();
|
|
859
|
-
const { safeRe: re, src, t, comparatorTrimReplace, tildeTrimReplace, caretTrimReplace } = require_re$1();
|
|
860
|
-
const { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = require_constants$1();
|
|
861
|
-
const BUILDSTRIPRE = new RegExp(src[t.BUILD], "g");
|
|
862
|
-
const isNullSet = (c) => c.value === "<0.0.0-0";
|
|
863
|
-
const isAny = (c) => c.value === "";
|
|
864
|
-
const isSatisfiable = (comparators, options) => {
|
|
865
|
-
let result = true;
|
|
866
|
-
const remainingComparators = comparators.slice();
|
|
867
|
-
let testComparator = remainingComparators.pop();
|
|
868
|
-
while (result && remainingComparators.length) {
|
|
869
|
-
result = remainingComparators.every((otherComparator) => {
|
|
870
|
-
return testComparator.intersects(otherComparator, options);
|
|
871
|
-
});
|
|
872
|
-
testComparator = remainingComparators.pop();
|
|
341
|
+
if (operator === "<") prerelease = "-0";
|
|
342
|
+
return `${operator}${major}.${minor}.${patch}${prerelease}`;
|
|
873
343
|
}
|
|
874
|
-
return
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
debug("tilde", comp, _, M, m, p, pr);
|
|
898
|
-
let ret;
|
|
899
|
-
if (isX(M)) ret = "";
|
|
900
|
-
else if (isX(m)) ret = `>=${M}.0.0 <${+M + 1}.0.0-0`;
|
|
901
|
-
else if (isX(p)) ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0`;
|
|
902
|
-
else if (pr) {
|
|
903
|
-
debug("replaceTilde pr", pr);
|
|
904
|
-
ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`;
|
|
905
|
-
} else ret = `>=${M}.${m}.${p} <${M}.${+m + 1}.0-0`;
|
|
906
|
-
debug("tilde return", ret);
|
|
907
|
-
return ret;
|
|
908
|
-
});
|
|
909
|
-
};
|
|
910
|
-
const replaceCarets = (comp, options) => {
|
|
911
|
-
return comp.trim().split(/\s+/).map((c) => replaceCaret(c, options)).join(" ");
|
|
912
|
-
};
|
|
913
|
-
const replaceCaret = (comp, options) => {
|
|
914
|
-
debug("caret", comp, options);
|
|
915
|
-
const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET];
|
|
916
|
-
const z = options.includePrerelease ? "-0" : "";
|
|
917
|
-
return comp.replace(r, (_, M, m, p, pr) => {
|
|
918
|
-
debug("caret", comp, _, M, m, p, pr);
|
|
919
|
-
let ret;
|
|
920
|
-
if (isX(M)) ret = "";
|
|
921
|
-
else if (isX(m)) ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0`;
|
|
922
|
-
else if (isX(p)) if (M === "0") ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0`;
|
|
923
|
-
else ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0`;
|
|
924
|
-
else if (pr) {
|
|
925
|
-
debug("replaceCaret pr", pr);
|
|
926
|
-
if (M === "0") if (m === "0") ret = `>=${M}.${m}.${p}-${pr} <${M}.${m}.${+p + 1}-0`;
|
|
927
|
-
else ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`;
|
|
928
|
-
else ret = `>=${M}.${m}.${p}-${pr} <${+M + 1}.0.0-0`;
|
|
929
|
-
} else {
|
|
930
|
-
debug("no pr");
|
|
931
|
-
if (M === "0") if (m === "0") ret = `>=${M}.${m}.${p} <${M}.${m}.${+p + 1}-0`;
|
|
932
|
-
else ret = `>=${M}.${m}.${p} <${M}.${+m + 1}.0-0`;
|
|
933
|
-
else ret = `>=${M}.${m}.${p} <${+M + 1}.0.0-0`;
|
|
934
|
-
}
|
|
935
|
-
debug("caret return", ret);
|
|
936
|
-
return ret;
|
|
937
|
-
});
|
|
938
|
-
};
|
|
939
|
-
const replaceXRanges = (comp, options) => {
|
|
940
|
-
debug("replaceXRanges", comp, options);
|
|
941
|
-
return comp.split(/\s+/).map((c) => replaceXRange(c, options)).join(" ");
|
|
942
|
-
};
|
|
943
|
-
const replaceXRange = (comp, options) => {
|
|
944
|
-
comp = comp.trim();
|
|
945
|
-
const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE];
|
|
946
|
-
return comp.replace(r, (ret, gtlt, M, m, p, pr) => {
|
|
947
|
-
debug("xRange", comp, ret, gtlt, M, m, p, pr);
|
|
948
|
-
if (invalidXRangeOrder(M, m, p)) return comp;
|
|
949
|
-
const xM = isX(M);
|
|
950
|
-
const xm = xM || isX(m);
|
|
951
|
-
const xp = xm || isX(p);
|
|
952
|
-
const anyX = xp;
|
|
953
|
-
if (gtlt === "=" && anyX) gtlt = "";
|
|
954
|
-
pr = options.includePrerelease ? "-0" : "";
|
|
955
|
-
if (xM) if (gtlt === ">" || gtlt === "<") ret = "<0.0.0-0";
|
|
956
|
-
else ret = "*";
|
|
957
|
-
else if (gtlt && anyX) {
|
|
958
|
-
if (xm) m = 0;
|
|
959
|
-
p = 0;
|
|
960
|
-
if (gtlt === ">") {
|
|
961
|
-
gtlt = ">=";
|
|
962
|
-
if (xm) {
|
|
963
|
-
M = +M + 1;
|
|
964
|
-
m = 0;
|
|
965
|
-
p = 0;
|
|
966
|
-
} else {
|
|
967
|
-
m = +m + 1;
|
|
968
|
-
p = 0;
|
|
969
|
-
}
|
|
970
|
-
} else if (gtlt === "<=") {
|
|
971
|
-
gtlt = "<";
|
|
972
|
-
if (xm) M = +M + 1;
|
|
973
|
-
else m = +m + 1;
|
|
974
|
-
}
|
|
975
|
-
if (gtlt === "<") pr = "-0";
|
|
976
|
-
ret = `${gtlt + M}.${m}.${p}${pr}`;
|
|
977
|
-
} else if (xm) ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0`;
|
|
978
|
-
else if (xp) ret = `>=${M}.${m}.0${pr} <${M}.${+m + 1}.0-0`;
|
|
979
|
-
debug("xRange return", ret);
|
|
980
|
-
return ret;
|
|
981
|
-
});
|
|
982
|
-
};
|
|
983
|
-
const replaceStars = (comp, options) => {
|
|
984
|
-
debug("replaceStars", comp, options);
|
|
985
|
-
return comp.trim().replace(re[t.STAR], "");
|
|
986
|
-
};
|
|
987
|
-
const replaceGTE0 = (comp, options) => {
|
|
988
|
-
debug("replaceGTE0", comp, options);
|
|
989
|
-
return comp.trim().replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], "");
|
|
990
|
-
};
|
|
991
|
-
const hyphenReplace = (incPr) => ($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr) => {
|
|
992
|
-
if (isX(fM)) from = "";
|
|
993
|
-
else if (isX(fm)) from = `>=${fM}.0.0${incPr ? "-0" : ""}`;
|
|
994
|
-
else if (isX(fp)) from = `>=${fM}.${fm}.0${incPr ? "-0" : ""}`;
|
|
995
|
-
else if (fpr) from = `>=${from}`;
|
|
996
|
-
else from = `>=${from}${incPr ? "-0" : ""}`;
|
|
997
|
-
if (isX(tM)) to = "";
|
|
998
|
-
else if (isX(tm)) to = `<${+tM + 1}.0.0-0`;
|
|
999
|
-
else if (isX(tp)) to = `<${tM}.${+tm + 1}.0-0`;
|
|
1000
|
-
else if (tpr) to = `<=${tM}.${tm}.${tp}-${tpr}`;
|
|
1001
|
-
else if (incPr) to = `<${tM}.${tm}.${+tp + 1}-0`;
|
|
344
|
+
if (wildcardMinor) return `>=${major}.0.0${prerelease} <${Number(major) + 1}.0.0-0`;
|
|
345
|
+
if (wildcardPatch) return `>=${major}.${minor}.0${prerelease} <${major}.${Number(minor) + 1}.0-0`;
|
|
346
|
+
return match;
|
|
347
|
+
});
|
|
348
|
+
}
|
|
349
|
+
function replaceXRanges$1(comparator, options) {
|
|
350
|
+
return comparator.split(/\s+/).map((part) => replaceXRange$1(part, options)).join(" ");
|
|
351
|
+
}
|
|
352
|
+
function replaceHyphenRange$1(range, options) {
|
|
353
|
+
const expression = options.loose ? LOOSE_HYPHEN$1 : STRICT_HYPHEN$1;
|
|
354
|
+
return range.replace(expression, (_match, rawFrom, fromMajor, fromMinor, fromPatch, fromPrerelease, _fromBuild, rawTo, toMajor, toMinor, toPatch, toPrerelease) => {
|
|
355
|
+
let from = rawFrom;
|
|
356
|
+
let to = rawTo;
|
|
357
|
+
if (isWildcard$1(fromMajor)) from = "";
|
|
358
|
+
else if (isWildcard$1(fromMinor)) from = `>=${fromMajor}.0.0${options.includePrerelease ? "-0" : ""}`;
|
|
359
|
+
else if (isWildcard$1(fromPatch)) from = `>=${fromMajor}.${fromMinor}.0${options.includePrerelease ? "-0" : ""}`;
|
|
360
|
+
else if (fromPrerelease) from = `>=${from}`;
|
|
361
|
+
else from = `>=${from}${options.includePrerelease ? "-0" : ""}`;
|
|
362
|
+
if (isWildcard$1(toMajor)) to = "";
|
|
363
|
+
else if (isWildcard$1(toMinor)) to = `<${Number(toMajor) + 1}.0.0-0`;
|
|
364
|
+
else if (isWildcard$1(toPatch)) to = `<${toMajor}.${Number(toMinor) + 1}.0-0`;
|
|
365
|
+
else if (toPrerelease) to = `<=${toMajor}.${toMinor}.${toPatch}-${toPrerelease}`;
|
|
366
|
+
else if (options.includePrerelease) to = `<${toMajor}.${toMinor}.${Number(toPatch) + 1}-0`;
|
|
1002
367
|
else to = `<=${to}`;
|
|
1003
368
|
return `${from} ${to}`.trim();
|
|
1004
|
-
};
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
})
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
comp = comp.trim().split(/\s+/).join(" ");
|
|
1034
|
-
debug("comparator", comp, options);
|
|
1035
|
-
this.options = options;
|
|
1036
|
-
this.loose = !!options.loose;
|
|
1037
|
-
this.parse(comp);
|
|
1038
|
-
if (this.semver === ANY) this.value = "";
|
|
1039
|
-
else this.value = this.operator + this.semver.version;
|
|
1040
|
-
debug("comp", this);
|
|
1041
|
-
}
|
|
1042
|
-
parse(comp) {
|
|
1043
|
-
const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR];
|
|
1044
|
-
const m = comp.match(r);
|
|
1045
|
-
if (!m) throw new TypeError(`Invalid comparator: ${comp}`);
|
|
1046
|
-
this.operator = m[1] !== void 0 ? m[1] : "";
|
|
1047
|
-
if (this.operator === "=") this.operator = "";
|
|
1048
|
-
if (!m[2]) this.semver = ANY;
|
|
1049
|
-
else this.semver = new SemVer(m[2], this.options.loose);
|
|
1050
|
-
}
|
|
1051
|
-
toString() {
|
|
1052
|
-
return this.value;
|
|
1053
|
-
}
|
|
1054
|
-
test(version) {
|
|
1055
|
-
debug("Comparator.test", version, this.options.loose);
|
|
1056
|
-
if (this.semver === ANY || version === ANY) return true;
|
|
1057
|
-
if (typeof version === "string") try {
|
|
1058
|
-
version = new SemVer(version, this.options);
|
|
1059
|
-
} catch (er) {
|
|
1060
|
-
return false;
|
|
1061
|
-
}
|
|
1062
|
-
return cmp(version, this.operator, this.semver, this.options);
|
|
1063
|
-
}
|
|
1064
|
-
intersects(comp, options) {
|
|
1065
|
-
if (!(comp instanceof Comparator)) throw new TypeError("a Comparator is required");
|
|
1066
|
-
if (this.operator === "") {
|
|
1067
|
-
if (this.value === "") return true;
|
|
1068
|
-
return new Range(comp.value, options).test(this.value);
|
|
1069
|
-
} else if (comp.operator === "") {
|
|
1070
|
-
if (comp.value === "") return true;
|
|
1071
|
-
return new Range(this.value, options).test(comp.semver);
|
|
1072
|
-
}
|
|
1073
|
-
options = parseOptions(options);
|
|
1074
|
-
if (options.includePrerelease && (this.value === "<0.0.0-0" || comp.value === "<0.0.0-0")) return false;
|
|
1075
|
-
if (!options.includePrerelease && (this.value.startsWith("<0.0.0") || comp.value.startsWith("<0.0.0"))) return false;
|
|
1076
|
-
if (this.operator.startsWith(">") && comp.operator.startsWith(">")) return true;
|
|
1077
|
-
if (this.operator.startsWith("<") && comp.operator.startsWith("<")) return true;
|
|
1078
|
-
if (this.semver.version === comp.semver.version && this.operator.includes("=") && comp.operator.includes("=")) return true;
|
|
1079
|
-
if (cmp(this.semver, "<", comp.semver, options) && this.operator.startsWith(">") && comp.operator.startsWith("<")) return true;
|
|
1080
|
-
if (cmp(this.semver, ">", comp.semver, options) && this.operator.startsWith("<") && comp.operator.startsWith(">")) return true;
|
|
1081
|
-
return false;
|
|
1082
|
-
}
|
|
1083
|
-
};
|
|
1084
|
-
const parseOptions = require_parse_options$1();
|
|
1085
|
-
const { safeRe: re, t } = require_re$1();
|
|
1086
|
-
const cmp = require_cmp$1();
|
|
1087
|
-
const debug = require_debug$1();
|
|
1088
|
-
const SemVer = require_semver$2();
|
|
1089
|
-
const Range = require_range$1();
|
|
1090
|
-
}));
|
|
1091
|
-
//#endregion
|
|
1092
|
-
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/satisfies.js
|
|
1093
|
-
var require_satisfies$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
|
|
1094
|
-
const Range = require_range$1();
|
|
1095
|
-
const satisfies = (version, range, options) => {
|
|
1096
|
-
try {
|
|
1097
|
-
range = new Range(range, options);
|
|
1098
|
-
} catch (er) {
|
|
1099
|
-
return false;
|
|
1100
|
-
}
|
|
1101
|
-
return range.test(version);
|
|
1102
|
-
};
|
|
1103
|
-
module.exports = satisfies;
|
|
1104
|
-
}));
|
|
1105
|
-
//#endregion
|
|
1106
|
-
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/ranges/to-comparators.js
|
|
1107
|
-
var require_to_comparators$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
|
|
1108
|
-
const Range = require_range$1();
|
|
1109
|
-
const toComparators = (range, options) => new Range(range, options).set.map((comp) => comp.map((c) => c.value).join(" ").trim().split(" "));
|
|
1110
|
-
module.exports = toComparators;
|
|
1111
|
-
}));
|
|
1112
|
-
//#endregion
|
|
1113
|
-
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/ranges/max-satisfying.js
|
|
1114
|
-
var require_max_satisfying$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
|
|
1115
|
-
const SemVer = require_semver$2();
|
|
1116
|
-
const Range = require_range$1();
|
|
1117
|
-
const maxSatisfying = (versions, range, options) => {
|
|
1118
|
-
let max = null;
|
|
1119
|
-
let maxSV = null;
|
|
1120
|
-
let rangeObj = null;
|
|
1121
|
-
try {
|
|
1122
|
-
rangeObj = new Range(range, options);
|
|
1123
|
-
} catch (er) {
|
|
1124
|
-
return null;
|
|
1125
|
-
}
|
|
1126
|
-
versions.forEach((v) => {
|
|
1127
|
-
if (rangeObj.test(v)) {
|
|
1128
|
-
if (!max || maxSV.compare(v) === -1) {
|
|
1129
|
-
max = v;
|
|
1130
|
-
maxSV = new SemVer(max, options);
|
|
1131
|
-
}
|
|
1132
|
-
}
|
|
1133
|
-
});
|
|
1134
|
-
return max;
|
|
1135
|
-
};
|
|
1136
|
-
module.exports = maxSatisfying;
|
|
1137
|
-
}));
|
|
1138
|
-
//#endregion
|
|
1139
|
-
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/ranges/min-satisfying.js
|
|
1140
|
-
var require_min_satisfying$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
|
|
1141
|
-
const SemVer = require_semver$2();
|
|
1142
|
-
const Range = require_range$1();
|
|
1143
|
-
const minSatisfying = (versions, range, options) => {
|
|
1144
|
-
let min = null;
|
|
1145
|
-
let minSV = null;
|
|
1146
|
-
let rangeObj = null;
|
|
1147
|
-
try {
|
|
1148
|
-
rangeObj = new Range(range, options);
|
|
1149
|
-
} catch (er) {
|
|
1150
|
-
return null;
|
|
369
|
+
});
|
|
370
|
+
}
|
|
371
|
+
function expandComparator$1(comparator, options) {
|
|
372
|
+
return replaceXRanges$1(replaceTildes$1(replaceCarets$1(comparator.replace(BUILD_SAFE$1, ""), options), options), options).trim().replace(STAR$1, "");
|
|
373
|
+
}
|
|
374
|
+
function parseSimpleRange$1(input, options) {
|
|
375
|
+
let parts = replaceHyphenRange$1(input.replace(BUILD_STRIP$1, ""), options).replace(COMPARATOR_TRIM$1, "$1$2$3").replace(TILDE_TRIM$1, "$1~").replace(CARET_TRIM$1, "$1^").split(" ").map((part) => expandComparator$1(part, options)).join(" ").split(/\s+/).map((part) => part.trim().replace(options.includePrerelease ? GTE_ZERO_PRERELEASE$1 : GTE_ZERO$1, ""));
|
|
376
|
+
if (options.loose) parts = parts.filter((part) => LOOSE_COMPARATOR$2.test(part));
|
|
377
|
+
const unique = /* @__PURE__ */ new Map();
|
|
378
|
+
for (const comparator of parts.map((part) => parseComparator$1(part, options))) {
|
|
379
|
+
if (comparator.value === "<0.0.0-0") return [comparator];
|
|
380
|
+
unique.set(comparator.value, comparator);
|
|
381
|
+
}
|
|
382
|
+
if (unique.size > 1) unique.delete("");
|
|
383
|
+
return [...unique.values()];
|
|
384
|
+
}
|
|
385
|
+
function parseRange$1(range, options = {}) {
|
|
386
|
+
if (typeof range !== "string") return range;
|
|
387
|
+
const parsedOptions = { ...options };
|
|
388
|
+
const raw = range.trim().replaceAll(/\s+/g, " ");
|
|
389
|
+
let sets = raw.split("||").map((part) => parseSimpleRange$1(part.trim(), parsedOptions)).filter((set) => set.length);
|
|
390
|
+
if (!sets.length) throw new TypeError(`Range contains no valid comparator sets: ${raw}`);
|
|
391
|
+
if (sets.length > 1) {
|
|
392
|
+
const first = sets[0];
|
|
393
|
+
sets = sets.filter((set) => set[0]?.value !== "<0.0.0-0");
|
|
394
|
+
if (!sets.length) sets = [first];
|
|
395
|
+
else if (sets.length > 1) {
|
|
396
|
+
const any = sets.find((set) => set.length === 1 && set[0]?.value === "");
|
|
397
|
+
if (any) sets = [any];
|
|
1151
398
|
}
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
}
|
|
1159
|
-
});
|
|
1160
|
-
return min;
|
|
399
|
+
}
|
|
400
|
+
return {
|
|
401
|
+
normalized: sets.map((set) => set.map((comparator) => comparator.value).join(" ")).join("||"),
|
|
402
|
+
options: parsedOptions,
|
|
403
|
+
raw,
|
|
404
|
+
sets
|
|
1161
405
|
};
|
|
1162
|
-
|
|
1163
|
-
})
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
const SemVer = require_semver$2();
|
|
1168
|
-
const Range = require_range$1();
|
|
1169
|
-
const gt = require_gt$1();
|
|
1170
|
-
const minVersion = (range, loose) => {
|
|
1171
|
-
range = new Range(range, loose);
|
|
1172
|
-
let minver = new SemVer("0.0.0");
|
|
1173
|
-
if (range.test(minver)) return minver;
|
|
1174
|
-
minver = new SemVer("0.0.0-0");
|
|
1175
|
-
if (range.test(minver)) return minver;
|
|
1176
|
-
minver = null;
|
|
1177
|
-
for (let i = 0; i < range.set.length; ++i) {
|
|
1178
|
-
const comparators = range.set[i];
|
|
1179
|
-
let setMin = null;
|
|
1180
|
-
comparators.forEach((comparator) => {
|
|
1181
|
-
const compver = new SemVer(comparator.semver.version);
|
|
1182
|
-
switch (comparator.operator) {
|
|
1183
|
-
case ">":
|
|
1184
|
-
if (compver.prerelease.length === 0) compver.patch++;
|
|
1185
|
-
else compver.prerelease.push(0);
|
|
1186
|
-
compver.raw = compver.format();
|
|
1187
|
-
case "":
|
|
1188
|
-
case ">=":
|
|
1189
|
-
if (!setMin || gt(compver, setMin)) setMin = compver;
|
|
1190
|
-
break;
|
|
1191
|
-
case "<":
|
|
1192
|
-
case "<=": break;
|
|
1193
|
-
default: throw new Error(`Unexpected operation: ${comparator.operator}`);
|
|
1194
|
-
}
|
|
1195
|
-
});
|
|
1196
|
-
if (setMin && (!minver || gt(minver, setMin))) minver = setMin;
|
|
1197
|
-
}
|
|
1198
|
-
if (minver && range.test(minver)) return minver;
|
|
406
|
+
}
|
|
407
|
+
function tryParseRange$1(range, options = {}) {
|
|
408
|
+
try {
|
|
409
|
+
return parseRange$1(range, options);
|
|
410
|
+
} catch {
|
|
1199
411
|
return null;
|
|
1200
|
-
}
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
const
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
const { ANY } = Comparator;
|
|
1222
|
-
const Range = require_range$1();
|
|
1223
|
-
const satisfies = require_satisfies$1();
|
|
1224
|
-
const gt = require_gt$1();
|
|
1225
|
-
const lt = require_lt$1();
|
|
1226
|
-
const lte = require_lte$1();
|
|
1227
|
-
const gte = require_gte$1();
|
|
1228
|
-
const outside = (version, range, hilo, options) => {
|
|
1229
|
-
version = new SemVer(version, options);
|
|
1230
|
-
range = new Range(range, options);
|
|
1231
|
-
let gtfn, ltefn, ltfn, comp, ecomp;
|
|
1232
|
-
switch (hilo) {
|
|
1233
|
-
case ">":
|
|
1234
|
-
gtfn = gt;
|
|
1235
|
-
ltefn = lte;
|
|
1236
|
-
ltfn = lt;
|
|
1237
|
-
comp = ">";
|
|
1238
|
-
ecomp = ">=";
|
|
1239
|
-
break;
|
|
1240
|
-
case "<":
|
|
1241
|
-
gtfn = lt;
|
|
1242
|
-
ltefn = gte;
|
|
1243
|
-
ltfn = gt;
|
|
1244
|
-
comp = "<";
|
|
1245
|
-
ecomp = "<=";
|
|
1246
|
-
break;
|
|
1247
|
-
default: throw new TypeError("Must provide a hilo val of \"<\" or \">\"");
|
|
1248
|
-
}
|
|
1249
|
-
if (satisfies(version, range, options)) return false;
|
|
1250
|
-
for (let i = 0; i < range.set.length; ++i) {
|
|
1251
|
-
const comparators = range.set[i];
|
|
1252
|
-
let high = null;
|
|
1253
|
-
let low = null;
|
|
1254
|
-
comparators.forEach((comparator) => {
|
|
1255
|
-
if (comparator.semver === ANY) comparator = new Comparator(">=0.0.0");
|
|
1256
|
-
high = high || comparator;
|
|
1257
|
-
low = low || comparator;
|
|
1258
|
-
if (gtfn(comparator.semver, high.semver, options)) high = comparator;
|
|
1259
|
-
else if (ltfn(comparator.semver, low.semver, options)) low = comparator;
|
|
1260
|
-
});
|
|
1261
|
-
if (high.operator === comp || high.operator === ecomp) return false;
|
|
1262
|
-
if ((!low.operator || low.operator === comp) && ltefn(version, low.semver)) return false;
|
|
1263
|
-
else if (low.operator === ecomp && ltfn(version, low.semver)) return false;
|
|
1264
|
-
}
|
|
1265
|
-
return true;
|
|
1266
|
-
};
|
|
1267
|
-
module.exports = outside;
|
|
1268
|
-
}));
|
|
1269
|
-
//#endregion
|
|
1270
|
-
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/ranges/gtr.js
|
|
1271
|
-
var require_gtr$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
|
|
1272
|
-
const outside = require_outside$1();
|
|
1273
|
-
const gtr = (version, range, options) => outside(version, range, ">", options);
|
|
1274
|
-
module.exports = gtr;
|
|
1275
|
-
}));
|
|
1276
|
-
//#endregion
|
|
1277
|
-
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/ranges/ltr.js
|
|
1278
|
-
var require_ltr$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
|
|
1279
|
-
const outside = require_outside$1();
|
|
1280
|
-
const ltr = (version, range, options) => outside(version, range, "<", options);
|
|
1281
|
-
module.exports = ltr;
|
|
1282
|
-
}));
|
|
1283
|
-
//#endregion
|
|
1284
|
-
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/ranges/intersects.js
|
|
1285
|
-
var require_intersects$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
|
|
1286
|
-
const Range = require_range$1();
|
|
1287
|
-
const intersects = (r1, r2, options) => {
|
|
1288
|
-
r1 = new Range(r1, options);
|
|
1289
|
-
r2 = new Range(r2, options);
|
|
1290
|
-
return r1.intersects(r2, options);
|
|
1291
|
-
};
|
|
1292
|
-
module.exports = intersects;
|
|
1293
|
-
}));
|
|
1294
|
-
//#endregion
|
|
1295
|
-
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/ranges/simplify.js
|
|
1296
|
-
var require_simplify$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
|
|
1297
|
-
const satisfies = require_satisfies$1();
|
|
1298
|
-
const compare = require_compare$1();
|
|
1299
|
-
module.exports = (versions, range, options) => {
|
|
1300
|
-
const set = [];
|
|
1301
|
-
let first = null;
|
|
1302
|
-
let prev = null;
|
|
1303
|
-
const v = versions.sort((a, b) => compare(a, b, options));
|
|
1304
|
-
for (const version of v) if (satisfies(version, range, options)) {
|
|
1305
|
-
prev = version;
|
|
1306
|
-
if (!first) first = version;
|
|
1307
|
-
} else {
|
|
1308
|
-
if (prev) set.push([first, prev]);
|
|
1309
|
-
prev = null;
|
|
1310
|
-
first = null;
|
|
1311
|
-
}
|
|
1312
|
-
if (first) set.push([first, null]);
|
|
1313
|
-
const ranges = [];
|
|
1314
|
-
for (const [min, max] of set) if (min === max) ranges.push(min);
|
|
1315
|
-
else if (!max && min === v[0]) ranges.push("*");
|
|
1316
|
-
else if (!max) ranges.push(`>=${min}`);
|
|
1317
|
-
else if (min === v[0]) ranges.push(`<=${max}`);
|
|
1318
|
-
else ranges.push(`${min} - ${max}`);
|
|
1319
|
-
const simplified = ranges.join(" || ");
|
|
1320
|
-
const original = typeof range.raw === "string" ? range.raw : String(range);
|
|
1321
|
-
return simplified.length < original.length ? simplified : range;
|
|
1322
|
-
};
|
|
1323
|
-
}));
|
|
1324
|
-
//#endregion
|
|
1325
|
-
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/ranges/subset.js
|
|
1326
|
-
var require_subset$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
|
|
1327
|
-
const Range = require_range$1();
|
|
1328
|
-
const Comparator = require_comparator$1();
|
|
1329
|
-
const { ANY } = Comparator;
|
|
1330
|
-
const satisfies = require_satisfies$1();
|
|
1331
|
-
const compare = require_compare$1();
|
|
1332
|
-
const subset = (sub, dom, options = {}) => {
|
|
1333
|
-
if (sub === dom) return true;
|
|
1334
|
-
sub = new Range(sub, options);
|
|
1335
|
-
dom = new Range(dom, options);
|
|
1336
|
-
let sawNonNull = false;
|
|
1337
|
-
OUTER: for (const simpleSub of sub.set) {
|
|
1338
|
-
for (const simpleDom of dom.set) {
|
|
1339
|
-
const isSub = simpleSubset(simpleSub, simpleDom, options);
|
|
1340
|
-
sawNonNull = sawNonNull || isSub !== null;
|
|
1341
|
-
if (isSub) continue OUTER;
|
|
1342
|
-
}
|
|
1343
|
-
if (sawNonNull) return false;
|
|
1344
|
-
}
|
|
1345
|
-
return true;
|
|
1346
|
-
};
|
|
1347
|
-
const minimumVersionWithPreRelease = [new Comparator(">=0.0.0-0")];
|
|
1348
|
-
const minimumVersion = [new Comparator(">=0.0.0")];
|
|
1349
|
-
const simpleSubset = (sub, dom, options) => {
|
|
1350
|
-
if (sub === dom) return true;
|
|
1351
|
-
if (sub.length === 1 && sub[0].semver === ANY) if (dom.length === 1 && dom[0].semver === ANY) return true;
|
|
1352
|
-
else if (options.includePrerelease) sub = minimumVersionWithPreRelease;
|
|
1353
|
-
else sub = minimumVersion;
|
|
1354
|
-
if (dom.length === 1 && dom[0].semver === ANY) if (options.includePrerelease) return true;
|
|
1355
|
-
else dom = minimumVersion;
|
|
1356
|
-
const eqSet = /* @__PURE__ */ new Set();
|
|
1357
|
-
let gt, lt;
|
|
1358
|
-
for (const c of sub) if (c.operator === ">" || c.operator === ">=") gt = higherGT(gt, c, options);
|
|
1359
|
-
else if (c.operator === "<" || c.operator === "<=") lt = lowerLT(lt, c, options);
|
|
1360
|
-
else eqSet.add(c.semver);
|
|
1361
|
-
if (eqSet.size > 1) return null;
|
|
1362
|
-
let gtltComp;
|
|
1363
|
-
if (gt && lt) {
|
|
1364
|
-
gtltComp = compare(gt.semver, lt.semver, options);
|
|
1365
|
-
if (gtltComp > 0) return null;
|
|
1366
|
-
else if (gtltComp === 0 && (gt.operator !== ">=" || lt.operator !== "<=")) return null;
|
|
1367
|
-
}
|
|
1368
|
-
for (const eq of eqSet) {
|
|
1369
|
-
if (gt && !satisfies(eq, String(gt), options)) return null;
|
|
1370
|
-
if (lt && !satisfies(eq, String(lt), options)) return null;
|
|
1371
|
-
for (const c of dom) if (!satisfies(eq, String(c), options)) return false;
|
|
1372
|
-
return true;
|
|
1373
|
-
}
|
|
1374
|
-
let higher, lower;
|
|
1375
|
-
let hasDomLT, hasDomGT;
|
|
1376
|
-
let needDomLTPre = lt && !options.includePrerelease && lt.semver.prerelease.length ? lt.semver : false;
|
|
1377
|
-
let needDomGTPre = gt && !options.includePrerelease && gt.semver.prerelease.length ? gt.semver : false;
|
|
1378
|
-
if (needDomLTPre && needDomLTPre.prerelease.length === 1 && lt.operator === "<" && needDomLTPre.prerelease[0] === 0) needDomLTPre = false;
|
|
1379
|
-
for (const c of dom) {
|
|
1380
|
-
hasDomGT = hasDomGT || c.operator === ">" || c.operator === ">=";
|
|
1381
|
-
hasDomLT = hasDomLT || c.operator === "<" || c.operator === "<=";
|
|
1382
|
-
if (gt) {
|
|
1383
|
-
if (needDomGTPre) {
|
|
1384
|
-
if (c.semver.prerelease && c.semver.prerelease.length && c.semver.major === needDomGTPre.major && c.semver.minor === needDomGTPre.minor && c.semver.patch === needDomGTPre.patch) needDomGTPre = false;
|
|
1385
|
-
}
|
|
1386
|
-
if (c.operator === ">" || c.operator === ">=") {
|
|
1387
|
-
higher = higherGT(gt, c, options);
|
|
1388
|
-
if (higher === c && higher !== gt) return false;
|
|
1389
|
-
} else if (gt.operator === ">=" && !c.test(gt.semver)) return false;
|
|
1390
|
-
}
|
|
1391
|
-
if (lt) {
|
|
1392
|
-
if (needDomLTPre) {
|
|
1393
|
-
if (c.semver.prerelease && c.semver.prerelease.length && c.semver.major === needDomLTPre.major && c.semver.minor === needDomLTPre.minor && c.semver.patch === needDomLTPre.patch) needDomLTPre = false;
|
|
1394
|
-
}
|
|
1395
|
-
if (c.operator === "<" || c.operator === "<=") {
|
|
1396
|
-
lower = lowerLT(lt, c, options);
|
|
1397
|
-
if (lower === c && lower !== lt) return false;
|
|
1398
|
-
} else if (lt.operator === "<=" && !c.test(lt.semver)) return false;
|
|
1399
|
-
}
|
|
1400
|
-
if (!c.operator && (lt || gt) && gtltComp !== 0) return false;
|
|
1401
|
-
}
|
|
1402
|
-
if (gt && hasDomLT && !lt && gtltComp !== 0) return false;
|
|
1403
|
-
if (lt && hasDomGT && !gt && gtltComp !== 0) return false;
|
|
1404
|
-
if (needDomGTPre || needDomLTPre) return false;
|
|
1405
|
-
return true;
|
|
1406
|
-
};
|
|
1407
|
-
const higherGT = (a, b, options) => {
|
|
1408
|
-
if (!a) return b;
|
|
1409
|
-
const comp = compare(a.semver, b.semver, options);
|
|
1410
|
-
return comp > 0 ? a : comp < 0 ? b : b.operator === ">" && a.operator === ">=" ? b : a;
|
|
1411
|
-
};
|
|
1412
|
-
const lowerLT = (a, b, options) => {
|
|
1413
|
-
if (!a) return b;
|
|
1414
|
-
const comp = compare(a.semver, b.semver, options);
|
|
1415
|
-
return comp < 0 ? a : comp > 0 ? b : b.operator === "<" && a.operator === "<=" ? b : a;
|
|
1416
|
-
};
|
|
1417
|
-
module.exports = subset;
|
|
1418
|
-
}));
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
function testParsedRange$1(range, version) {
|
|
415
|
+
return range.sets.some((set) => testComparatorSet$1(set, version, range.options));
|
|
416
|
+
}
|
|
417
|
+
function testRangeVersion$1(range, version) {
|
|
418
|
+
const parsed = tryParse$1(version, range.options);
|
|
419
|
+
return parsed ? testParsedRange$1(range, parsed) : false;
|
|
420
|
+
}
|
|
421
|
+
function satisfies$1(version, range, options = {}) {
|
|
422
|
+
const parsed = tryParseRange$1(range, options);
|
|
423
|
+
return parsed ? testRangeVersion$1(parsed, version) : false;
|
|
424
|
+
}
|
|
425
|
+
function normalize(version, options = {}) {
|
|
426
|
+
const parsed = tryParse$1(version, options);
|
|
427
|
+
return parsed ? formatComparableVersion$1(parsed) : null;
|
|
428
|
+
}
|
|
429
|
+
function coerce$1(value, options = {}) {
|
|
430
|
+
const parsed = coerceParsedVersion$1(value, options);
|
|
431
|
+
return parsed ? formatFullVersion$1(parsed) : null;
|
|
432
|
+
}
|
|
1419
433
|
//#endregion
|
|
1420
434
|
//#region ../../packages/server/dist/handler.mjs
|
|
1421
|
-
var import_semver$1 = /* @__PURE__ */ __toESM$1((/* @__PURE__ */ __commonJSMin$1(((exports, module) => {
|
|
1422
|
-
const internalRe = require_re$1();
|
|
1423
|
-
const constants = require_constants$1();
|
|
1424
|
-
const SemVer = require_semver$2();
|
|
1425
|
-
const identifiers = require_identifiers$1();
|
|
1426
|
-
module.exports = {
|
|
1427
|
-
parse: require_parse$1(),
|
|
1428
|
-
valid: require_valid$3(),
|
|
1429
|
-
clean: require_clean$1(),
|
|
1430
|
-
inc: require_inc$1(),
|
|
1431
|
-
diff: require_diff$1(),
|
|
1432
|
-
major: require_major$1(),
|
|
1433
|
-
minor: require_minor$1(),
|
|
1434
|
-
patch: require_patch$1(),
|
|
1435
|
-
prerelease: require_prerelease$1(),
|
|
1436
|
-
compare: require_compare$1(),
|
|
1437
|
-
rcompare: require_rcompare$1(),
|
|
1438
|
-
compareLoose: require_compare_loose$1(),
|
|
1439
|
-
compareBuild: require_compare_build$1(),
|
|
1440
|
-
sort: require_sort$1(),
|
|
1441
|
-
rsort: require_rsort$1(),
|
|
1442
|
-
gt: require_gt$1(),
|
|
1443
|
-
lt: require_lt$1(),
|
|
1444
|
-
eq: require_eq$1(),
|
|
1445
|
-
neq: require_neq$1(),
|
|
1446
|
-
gte: require_gte$1(),
|
|
1447
|
-
lte: require_lte$1(),
|
|
1448
|
-
cmp: require_cmp$1(),
|
|
1449
|
-
coerce: require_coerce$1(),
|
|
1450
|
-
truncate: require_truncate$1(),
|
|
1451
|
-
Comparator: require_comparator$1(),
|
|
1452
|
-
Range: require_range$1(),
|
|
1453
|
-
satisfies: require_satisfies$1(),
|
|
1454
|
-
toComparators: require_to_comparators$1(),
|
|
1455
|
-
maxSatisfying: require_max_satisfying$1(),
|
|
1456
|
-
minSatisfying: require_min_satisfying$1(),
|
|
1457
|
-
minVersion: require_min_version$1(),
|
|
1458
|
-
validRange: require_valid$2(),
|
|
1459
|
-
outside: require_outside$1(),
|
|
1460
|
-
gtr: require_gtr$1(),
|
|
1461
|
-
ltr: require_ltr$1(),
|
|
1462
|
-
intersects: require_intersects$1(),
|
|
1463
|
-
simplifyRange: require_simplify$1(),
|
|
1464
|
-
subset: require_subset$1(),
|
|
1465
|
-
SemVer,
|
|
1466
|
-
re: internalRe.re,
|
|
1467
|
-
src: internalRe.src,
|
|
1468
|
-
tokens: internalRe.t,
|
|
1469
|
-
SEMVER_SPEC_VERSION: constants.SEMVER_SPEC_VERSION,
|
|
1470
|
-
RELEASE_TYPES: constants.RELEASE_TYPES,
|
|
1471
|
-
compareIdentifiers: identifiers.compareIdentifiers,
|
|
1472
|
-
rcompareIdentifiers: identifiers.rcompareIdentifiers
|
|
1473
|
-
};
|
|
1474
|
-
})))(), 1);
|
|
1475
435
|
var HandlerBadRequestError = class extends Error {
|
|
1476
436
|
constructor(message) {
|
|
1477
437
|
super(message);
|
|
@@ -1485,8 +445,8 @@ const MAX_BUNDLE_LIST_LIMIT = 100;
|
|
|
1485
445
|
const supportsExplicitNoUpdateResponse = (request) => {
|
|
1486
446
|
const sdkVersion = request.headers.get(SDK_VERSION_HEADER)?.trim();
|
|
1487
447
|
if (!sdkVersion) return false;
|
|
1488
|
-
const normalizedSdkVersion =
|
|
1489
|
-
return normalizedSdkVersion !== null &&
|
|
448
|
+
const normalizedSdkVersion = normalize(sdkVersion);
|
|
449
|
+
return normalizedSdkVersion !== null && isGreaterOrEqual(normalizedSdkVersion, EXPLICIT_NO_UPDATE_MIN_SDK_VERSION);
|
|
1490
450
|
};
|
|
1491
451
|
const serializeUpdateInfo = (updateInfo, request) => {
|
|
1492
452
|
if (updateInfo) return JSON.stringify(updateInfo);
|
|
@@ -3358,8 +2318,8 @@ function getCompressionMimeType(filename) {
|
|
|
3358
2318
|
* @returns Content-Type string (never undefined, falls back to application/octet-stream)
|
|
3359
2319
|
*/
|
|
3360
2320
|
function getContentType(bundlePath) {
|
|
3361
|
-
const filename =
|
|
3362
|
-
return src_default.getType(bundlePath) ?? getCompressionMimeType(filename) ?? "application/octet-stream";
|
|
2321
|
+
const filename = bundlePath.replace(/[\\/]+$/, "").split(/[\\/]/).pop();
|
|
2322
|
+
return src_default.getType(bundlePath) ?? getCompressionMimeType(filename ?? "") ?? "application/octet-stream";
|
|
3363
2323
|
}
|
|
3364
2324
|
//#endregion
|
|
3365
2325
|
//#region ../plugin-core/dist/contentAddressedAssets.mjs
|
|
@@ -4103,9 +3063,9 @@ function createDatabasePlugin(options) {
|
|
|
4103
3063
|
//#endregion
|
|
4104
3064
|
//#region ../plugin-core/dist/semverSatisfies.mjs
|
|
4105
3065
|
const semverSatisfies$1 = (targetAppVersion, currentVersion) => {
|
|
4106
|
-
const currentCoerce =
|
|
3066
|
+
const currentCoerce = coerce$1(currentVersion);
|
|
4107
3067
|
if (!currentCoerce) return false;
|
|
4108
|
-
return
|
|
3068
|
+
return satisfies$1(currentCoerce, targetAppVersion);
|
|
4109
3069
|
};
|
|
4110
3070
|
//#endregion
|
|
4111
3071
|
//#region ../plugin-core/dist/filterCompatibleAppVersions.mjs
|
|
@@ -4190,1321 +3150,341 @@ const createRequestUpdateBundleResolver = (context) => {
|
|
|
4190
3150
|
};
|
|
4191
3151
|
//#endregion
|
|
4192
3152
|
//#region ../js/dist/index.mjs
|
|
4193
|
-
|
|
4194
|
-
|
|
4195
|
-
|
|
4196
|
-
|
|
4197
|
-
|
|
4198
|
-
|
|
4199
|
-
|
|
4200
|
-
|
|
4201
|
-
|
|
4202
|
-
|
|
4203
|
-
|
|
4204
|
-
|
|
4205
|
-
|
|
4206
|
-
|
|
4207
|
-
|
|
4208
|
-
|
|
4209
|
-
}
|
|
4210
|
-
|
|
4211
|
-
|
|
4212
|
-
|
|
4213
|
-
|
|
4214
|
-
|
|
4215
|
-
|
|
4216
|
-
|
|
4217
|
-
|
|
4218
|
-
|
|
4219
|
-
|
|
4220
|
-
|
|
4221
|
-
|
|
4222
|
-
MAX_SAFE_INTEGER,
|
|
4223
|
-
RELEASE_TYPES: [
|
|
4224
|
-
"major",
|
|
4225
|
-
"premajor",
|
|
4226
|
-
"minor",
|
|
4227
|
-
"preminor",
|
|
4228
|
-
"patch",
|
|
4229
|
-
"prepatch",
|
|
4230
|
-
"prerelease"
|
|
4231
|
-
],
|
|
4232
|
-
SEMVER_SPEC_VERSION,
|
|
4233
|
-
FLAG_INCLUDE_PRERELEASE: 1,
|
|
4234
|
-
FLAG_LOOSE: 2
|
|
4235
|
-
};
|
|
4236
|
-
}));
|
|
4237
|
-
var require_debug = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
4238
|
-
module.exports = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => {};
|
|
4239
|
-
}));
|
|
4240
|
-
var require_re = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
4241
|
-
const { MAX_SAFE_COMPONENT_LENGTH, MAX_SAFE_BUILD_LENGTH, MAX_LENGTH } = require_constants();
|
|
4242
|
-
const debug = require_debug();
|
|
4243
|
-
exports = module.exports = {};
|
|
4244
|
-
const re = exports.re = [];
|
|
4245
|
-
const safeRe = exports.safeRe = [];
|
|
4246
|
-
const src = exports.src = [];
|
|
4247
|
-
const safeSrc = exports.safeSrc = [];
|
|
4248
|
-
const t = exports.t = {};
|
|
4249
|
-
let R = 0;
|
|
4250
|
-
const LETTERDASHNUMBER = "[a-zA-Z0-9-]";
|
|
4251
|
-
const safeRegexReplacements = [
|
|
4252
|
-
["\\s", 1],
|
|
4253
|
-
["\\d", MAX_LENGTH],
|
|
4254
|
-
[LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH]
|
|
3153
|
+
const LETTER_DASH_NUMBER = "[a-zA-Z0-9-]";
|
|
3154
|
+
const NUMERIC_IDENTIFIER = String.raw`0|[1-9]\d*`;
|
|
3155
|
+
const NUMERIC_IDENTIFIER_LOOSE = String.raw`\d+`;
|
|
3156
|
+
const NON_NUMERIC_IDENTIFIER = String.raw`\d*[a-zA-Z-]${LETTER_DASH_NUMBER}*`;
|
|
3157
|
+
const MAIN_VERSION = String.raw`(${NUMERIC_IDENTIFIER})\.(${NUMERIC_IDENTIFIER})\.(${NUMERIC_IDENTIFIER})`;
|
|
3158
|
+
const MAIN_VERSION_LOOSE = String.raw`(${NUMERIC_IDENTIFIER_LOOSE})\.(${NUMERIC_IDENTIFIER_LOOSE})\.(${NUMERIC_IDENTIFIER_LOOSE})`;
|
|
3159
|
+
const PRERELEASE_IDENTIFIER = `(?:${NON_NUMERIC_IDENTIFIER}|${NUMERIC_IDENTIFIER})`;
|
|
3160
|
+
const PRERELEASE_IDENTIFIER_LOOSE = `(?:${NON_NUMERIC_IDENTIFIER}|${NUMERIC_IDENTIFIER_LOOSE})`;
|
|
3161
|
+
const PRERELEASE = String.raw`(?:-(${PRERELEASE_IDENTIFIER}(?:\.${PRERELEASE_IDENTIFIER})*))`;
|
|
3162
|
+
const PRERELEASE_LOOSE = String.raw`(?:-?(${PRERELEASE_IDENTIFIER_LOOSE}(?:\.${PRERELEASE_IDENTIFIER_LOOSE})*))`;
|
|
3163
|
+
const BUILD_IDENTIFIER = `${LETTER_DASH_NUMBER}+`;
|
|
3164
|
+
const BUILD = String.raw`(?:\+(${BUILD_IDENTIFIER}(?:\.${BUILD_IDENTIFIER})*))`;
|
|
3165
|
+
const FULL_PLAIN = `v?${MAIN_VERSION}${PRERELEASE}?${BUILD}?`;
|
|
3166
|
+
const LOOSE_PLAIN = String.raw`[v=\s]*${MAIN_VERSION_LOOSE}${PRERELEASE_LOOSE}?${BUILD}?`;
|
|
3167
|
+
const GREATER_LESS_THAN = "((?:<|>)?=?)";
|
|
3168
|
+
const XRANGE_IDENTIFIER = String.raw`${NUMERIC_IDENTIFIER}|x|X|\*`;
|
|
3169
|
+
const XRANGE_IDENTIFIER_LOOSE = String.raw`${NUMERIC_IDENTIFIER_LOOSE}|x|X|\*`;
|
|
3170
|
+
const XRANGE_PLAIN = String.raw`[v=\s]*(${XRANGE_IDENTIFIER})(?:\.(${XRANGE_IDENTIFIER})(?:\.(${XRANGE_IDENTIFIER})(?:${PRERELEASE})?${BUILD}?)?)?`;
|
|
3171
|
+
const XRANGE_PLAIN_LOOSE = String.raw`[v=\s]*(${XRANGE_IDENTIFIER_LOOSE})(?:\.(${XRANGE_IDENTIFIER_LOOSE})(?:\.(${XRANGE_IDENTIFIER_LOOSE})(?:${PRERELEASE_LOOSE})?${BUILD}?)?)?`;
|
|
3172
|
+
const LONE_TILDE = "(?:~>?)";
|
|
3173
|
+
const LONE_CARET = String.raw`(?:\^)`;
|
|
3174
|
+
const COERCE_PLAIN = String.raw`(^|[^\d])(\d{1,${16}})(?:\.(\d{1,${16}}))?(?:\.(\d{1,${16}}))?`;
|
|
3175
|
+
const COERCE = String.raw`${COERCE_PLAIN}(?:$|[^\d])`;
|
|
3176
|
+
const COERCE_FULL = String.raw`${COERCE_PLAIN}(?:${PRERELEASE})?(?:${BUILD})?(?:$|[^\d])`;
|
|
3177
|
+
function makeSafeRegexSource(source) {
|
|
3178
|
+
const replacements = [
|
|
3179
|
+
[String.raw`\s`, 1],
|
|
3180
|
+
[String.raw`\d`, 256],
|
|
3181
|
+
[LETTER_DASH_NUMBER, 250]
|
|
4255
3182
|
];
|
|
4256
|
-
const
|
|
4257
|
-
|
|
4258
|
-
|
|
4259
|
-
|
|
4260
|
-
|
|
4261
|
-
|
|
4262
|
-
|
|
4263
|
-
|
|
4264
|
-
|
|
4265
|
-
|
|
4266
|
-
|
|
4267
|
-
|
|
4268
|
-
|
|
4269
|
-
|
|
4270
|
-
|
|
4271
|
-
|
|
4272
|
-
|
|
4273
|
-
|
|
4274
|
-
|
|
4275
|
-
|
|
4276
|
-
|
|
4277
|
-
|
|
4278
|
-
|
|
4279
|
-
|
|
4280
|
-
|
|
4281
|
-
|
|
4282
|
-
|
|
4283
|
-
|
|
4284
|
-
|
|
4285
|
-
|
|
4286
|
-
|
|
4287
|
-
|
|
4288
|
-
|
|
4289
|
-
|
|
4290
|
-
|
|
4291
|
-
|
|
4292
|
-
|
|
4293
|
-
|
|
4294
|
-
|
|
4295
|
-
|
|
4296
|
-
|
|
4297
|
-
|
|
4298
|
-
|
|
4299
|
-
|
|
4300
|
-
|
|
4301
|
-
|
|
4302
|
-
|
|
4303
|
-
|
|
4304
|
-
|
|
4305
|
-
|
|
4306
|
-
|
|
4307
|
-
|
|
4308
|
-
|
|
4309
|
-
|
|
4310
|
-
exports.comparatorTrimReplace = "$1$2$3";
|
|
4311
|
-
createToken("HYPHENRANGE", `^\\s*(${src[t.XRANGEPLAIN]})\\s+-\\s+(${src[t.XRANGEPLAIN]})\\s*$`);
|
|
4312
|
-
createToken("HYPHENRANGELOOSE", `^\\s*(${src[t.XRANGEPLAINLOOSE]})\\s+-\\s+(${src[t.XRANGEPLAINLOOSE]})\\s*$`);
|
|
4313
|
-
createToken("STAR", "(<|>)?=?\\s*\\*");
|
|
4314
|
-
createToken("GTE0", "^\\s*>=\\s*0\\.0\\.0\\s*$");
|
|
4315
|
-
createToken("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$");
|
|
4316
|
-
}));
|
|
4317
|
-
var require_parse_options = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
4318
|
-
const looseOption = Object.freeze({ loose: true });
|
|
4319
|
-
const emptyOpts = Object.freeze({});
|
|
4320
|
-
const parseOptions = (options) => {
|
|
4321
|
-
if (!options) return emptyOpts;
|
|
4322
|
-
if (typeof options !== "object") return looseOption;
|
|
4323
|
-
return options;
|
|
4324
|
-
};
|
|
4325
|
-
module.exports = parseOptions;
|
|
4326
|
-
}));
|
|
4327
|
-
var require_identifiers = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
4328
|
-
const numeric = /^[0-9]+$/;
|
|
4329
|
-
const compareIdentifiers = (a, b) => {
|
|
4330
|
-
if (typeof a === "number" && typeof b === "number") return a === b ? 0 : a < b ? -1 : 1;
|
|
4331
|
-
const anum = numeric.test(a);
|
|
4332
|
-
const bnum = numeric.test(b);
|
|
4333
|
-
if (anum && bnum) {
|
|
4334
|
-
a = +a;
|
|
4335
|
-
b = +b;
|
|
4336
|
-
}
|
|
4337
|
-
return a === b ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a < b ? -1 : 1;
|
|
4338
|
-
};
|
|
4339
|
-
const rcompareIdentifiers = (a, b) => compareIdentifiers(b, a);
|
|
4340
|
-
module.exports = {
|
|
4341
|
-
compareIdentifiers,
|
|
4342
|
-
rcompareIdentifiers
|
|
4343
|
-
};
|
|
4344
|
-
}));
|
|
4345
|
-
var require_semver$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
4346
|
-
const debug = require_debug();
|
|
4347
|
-
const { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants();
|
|
4348
|
-
const { safeRe: re, t } = require_re();
|
|
4349
|
-
const parseOptions = require_parse_options();
|
|
4350
|
-
const { compareIdentifiers } = require_identifiers();
|
|
4351
|
-
const isPrereleaseIdentifier = (prerelease, identifier) => {
|
|
4352
|
-
const identifiers = identifier.split(".");
|
|
4353
|
-
if (identifiers.length > prerelease.length) return false;
|
|
4354
|
-
for (let i = 0; i < identifiers.length; i++) if (compareIdentifiers(prerelease[i], identifiers[i]) !== 0) return false;
|
|
4355
|
-
return true;
|
|
4356
|
-
};
|
|
4357
|
-
module.exports = class SemVer {
|
|
4358
|
-
constructor(version, options) {
|
|
4359
|
-
options = parseOptions(options);
|
|
4360
|
-
if (version instanceof SemVer) if (version.loose === !!options.loose && version.includePrerelease === !!options.includePrerelease) return version;
|
|
4361
|
-
else version = version.version;
|
|
4362
|
-
else if (typeof version !== "string") throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version}".`);
|
|
4363
|
-
if (version.length > MAX_LENGTH) throw new TypeError(`version is longer than ${MAX_LENGTH} characters`);
|
|
4364
|
-
debug("SemVer", version, options);
|
|
4365
|
-
this.options = options;
|
|
4366
|
-
this.loose = !!options.loose;
|
|
4367
|
-
this.includePrerelease = !!options.includePrerelease;
|
|
4368
|
-
const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]);
|
|
4369
|
-
if (!m) throw new TypeError(`Invalid Version: ${version}`);
|
|
4370
|
-
this.raw = version;
|
|
4371
|
-
this.major = +m[1];
|
|
4372
|
-
this.minor = +m[2];
|
|
4373
|
-
this.patch = +m[3];
|
|
4374
|
-
if (this.major > MAX_SAFE_INTEGER || this.major < 0) throw new TypeError("Invalid major version");
|
|
4375
|
-
if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) throw new TypeError("Invalid minor version");
|
|
4376
|
-
if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) throw new TypeError("Invalid patch version");
|
|
4377
|
-
if (!m[4]) this.prerelease = [];
|
|
4378
|
-
else this.prerelease = m[4].split(".").map((id) => {
|
|
4379
|
-
if (/^[0-9]+$/.test(id)) {
|
|
4380
|
-
const num = +id;
|
|
4381
|
-
if (num >= 0 && num < MAX_SAFE_INTEGER) return num;
|
|
4382
|
-
}
|
|
4383
|
-
return id;
|
|
4384
|
-
});
|
|
4385
|
-
this.build = m[5] ? m[5].split(".") : [];
|
|
4386
|
-
this.format();
|
|
4387
|
-
}
|
|
4388
|
-
format() {
|
|
4389
|
-
this.version = `${this.major}.${this.minor}.${this.patch}`;
|
|
4390
|
-
if (this.prerelease.length) this.version += `-${this.prerelease.join(".")}`;
|
|
4391
|
-
return this.version;
|
|
4392
|
-
}
|
|
4393
|
-
toString() {
|
|
4394
|
-
return this.version;
|
|
4395
|
-
}
|
|
4396
|
-
compare(other) {
|
|
4397
|
-
debug("SemVer.compare", this.version, this.options, other);
|
|
4398
|
-
if (!(other instanceof SemVer)) {
|
|
4399
|
-
if (typeof other === "string" && other === this.version) return 0;
|
|
4400
|
-
other = new SemVer(other, this.options);
|
|
4401
|
-
}
|
|
4402
|
-
if (other.version === this.version) return 0;
|
|
4403
|
-
return this.compareMain(other) || this.comparePre(other);
|
|
4404
|
-
}
|
|
4405
|
-
compareMain(other) {
|
|
4406
|
-
if (!(other instanceof SemVer)) other = new SemVer(other, this.options);
|
|
4407
|
-
if (this.major < other.major) return -1;
|
|
4408
|
-
if (this.major > other.major) return 1;
|
|
4409
|
-
if (this.minor < other.minor) return -1;
|
|
4410
|
-
if (this.minor > other.minor) return 1;
|
|
4411
|
-
if (this.patch < other.patch) return -1;
|
|
4412
|
-
if (this.patch > other.patch) return 1;
|
|
4413
|
-
return 0;
|
|
4414
|
-
}
|
|
4415
|
-
comparePre(other) {
|
|
4416
|
-
if (!(other instanceof SemVer)) other = new SemVer(other, this.options);
|
|
4417
|
-
if (this.prerelease.length && !other.prerelease.length) return -1;
|
|
4418
|
-
else if (!this.prerelease.length && other.prerelease.length) return 1;
|
|
4419
|
-
else if (!this.prerelease.length && !other.prerelease.length) return 0;
|
|
4420
|
-
let i = 0;
|
|
4421
|
-
do {
|
|
4422
|
-
const a = this.prerelease[i];
|
|
4423
|
-
const b = other.prerelease[i];
|
|
4424
|
-
debug("prerelease compare", i, a, b);
|
|
4425
|
-
if (a === void 0 && b === void 0) return 0;
|
|
4426
|
-
else if (b === void 0) return 1;
|
|
4427
|
-
else if (a === void 0) return -1;
|
|
4428
|
-
else if (a === b) continue;
|
|
4429
|
-
else return compareIdentifiers(a, b);
|
|
4430
|
-
} while (++i);
|
|
4431
|
-
}
|
|
4432
|
-
compareBuild(other) {
|
|
4433
|
-
if (!(other instanceof SemVer)) other = new SemVer(other, this.options);
|
|
4434
|
-
let i = 0;
|
|
4435
|
-
do {
|
|
4436
|
-
const a = this.build[i];
|
|
4437
|
-
const b = other.build[i];
|
|
4438
|
-
debug("build compare", i, a, b);
|
|
4439
|
-
if (a === void 0 && b === void 0) return 0;
|
|
4440
|
-
else if (b === void 0) return 1;
|
|
4441
|
-
else if (a === void 0) return -1;
|
|
4442
|
-
else if (a === b) continue;
|
|
4443
|
-
else return compareIdentifiers(a, b);
|
|
4444
|
-
} while (++i);
|
|
4445
|
-
}
|
|
4446
|
-
inc(release, identifier, identifierBase) {
|
|
4447
|
-
if (release.startsWith("pre")) {
|
|
4448
|
-
if (!identifier && identifierBase === false) throw new Error("invalid increment argument: identifier is empty");
|
|
4449
|
-
if (identifier) {
|
|
4450
|
-
const match = `-${identifier}`.match(this.options.loose ? re[t.PRERELEASELOOSE] : re[t.PRERELEASE]);
|
|
4451
|
-
if (!match || match[1] !== identifier) throw new Error(`invalid identifier: ${identifier}`);
|
|
4452
|
-
}
|
|
4453
|
-
}
|
|
4454
|
-
switch (release) {
|
|
4455
|
-
case "premajor":
|
|
4456
|
-
this.prerelease.length = 0;
|
|
4457
|
-
this.patch = 0;
|
|
4458
|
-
this.minor = 0;
|
|
4459
|
-
this.major++;
|
|
4460
|
-
this.inc("pre", identifier, identifierBase);
|
|
4461
|
-
break;
|
|
4462
|
-
case "preminor":
|
|
4463
|
-
this.prerelease.length = 0;
|
|
4464
|
-
this.patch = 0;
|
|
4465
|
-
this.minor++;
|
|
4466
|
-
this.inc("pre", identifier, identifierBase);
|
|
4467
|
-
break;
|
|
4468
|
-
case "prepatch":
|
|
4469
|
-
this.prerelease.length = 0;
|
|
4470
|
-
this.inc("patch", identifier, identifierBase);
|
|
4471
|
-
this.inc("pre", identifier, identifierBase);
|
|
4472
|
-
break;
|
|
4473
|
-
case "prerelease":
|
|
4474
|
-
if (this.prerelease.length === 0) this.inc("patch", identifier, identifierBase);
|
|
4475
|
-
this.inc("pre", identifier, identifierBase);
|
|
4476
|
-
break;
|
|
4477
|
-
case "release":
|
|
4478
|
-
if (this.prerelease.length === 0) throw new Error(`version ${this.raw} is not a prerelease`);
|
|
4479
|
-
this.prerelease.length = 0;
|
|
4480
|
-
break;
|
|
4481
|
-
case "major":
|
|
4482
|
-
if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) this.major++;
|
|
4483
|
-
this.minor = 0;
|
|
4484
|
-
this.patch = 0;
|
|
4485
|
-
this.prerelease = [];
|
|
4486
|
-
break;
|
|
4487
|
-
case "minor":
|
|
4488
|
-
if (this.patch !== 0 || this.prerelease.length === 0) this.minor++;
|
|
4489
|
-
this.patch = 0;
|
|
4490
|
-
this.prerelease = [];
|
|
4491
|
-
break;
|
|
4492
|
-
case "patch":
|
|
4493
|
-
if (this.prerelease.length === 0) this.patch++;
|
|
4494
|
-
this.prerelease = [];
|
|
4495
|
-
break;
|
|
4496
|
-
case "pre": {
|
|
4497
|
-
const base = Number(identifierBase) ? 1 : 0;
|
|
4498
|
-
if (this.prerelease.length === 0) this.prerelease = [base];
|
|
4499
|
-
else {
|
|
4500
|
-
let i = this.prerelease.length;
|
|
4501
|
-
while (--i >= 0) if (typeof this.prerelease[i] === "number") {
|
|
4502
|
-
this.prerelease[i]++;
|
|
4503
|
-
i = -2;
|
|
4504
|
-
}
|
|
4505
|
-
if (i === -1) {
|
|
4506
|
-
if (identifier === this.prerelease.join(".") && identifierBase === false) throw new Error("invalid increment argument: identifier already exists");
|
|
4507
|
-
this.prerelease.push(base);
|
|
4508
|
-
}
|
|
4509
|
-
}
|
|
4510
|
-
if (identifier) {
|
|
4511
|
-
let prerelease = [identifier, base];
|
|
4512
|
-
if (identifierBase === false) prerelease = [identifier];
|
|
4513
|
-
if (isPrereleaseIdentifier(this.prerelease, identifier)) {
|
|
4514
|
-
const prereleaseBase = this.prerelease[identifier.split(".").length];
|
|
4515
|
-
if (isNaN(prereleaseBase)) this.prerelease = prerelease;
|
|
4516
|
-
} else this.prerelease = prerelease;
|
|
4517
|
-
}
|
|
4518
|
-
break;
|
|
4519
|
-
}
|
|
4520
|
-
default: throw new Error(`invalid increment argument: ${release}`);
|
|
4521
|
-
}
|
|
4522
|
-
this.raw = this.format();
|
|
4523
|
-
if (this.build.length) this.raw += `+${this.build.join(".")}`;
|
|
4524
|
-
return this;
|
|
4525
|
-
}
|
|
4526
|
-
};
|
|
4527
|
-
}));
|
|
4528
|
-
var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
4529
|
-
const SemVer = require_semver$1();
|
|
4530
|
-
const parse = (version, options, throwErrors = false) => {
|
|
4531
|
-
if (version instanceof SemVer) return version;
|
|
4532
|
-
try {
|
|
4533
|
-
return new SemVer(version, options);
|
|
4534
|
-
} catch (er) {
|
|
4535
|
-
if (!throwErrors) return null;
|
|
4536
|
-
throw er;
|
|
4537
|
-
}
|
|
4538
|
-
};
|
|
4539
|
-
module.exports = parse;
|
|
4540
|
-
}));
|
|
4541
|
-
var require_valid$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
4542
|
-
const parse = require_parse();
|
|
4543
|
-
const valid = (version, options) => {
|
|
4544
|
-
const v = parse(version, options);
|
|
4545
|
-
return v ? v.version : null;
|
|
4546
|
-
};
|
|
4547
|
-
module.exports = valid;
|
|
4548
|
-
}));
|
|
4549
|
-
var require_clean = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
4550
|
-
const parse = require_parse();
|
|
4551
|
-
const clean = (version, options) => {
|
|
4552
|
-
const s = parse(version.trim().replace(/^[=v]+/, ""), options);
|
|
4553
|
-
return s ? s.version : null;
|
|
4554
|
-
};
|
|
4555
|
-
module.exports = clean;
|
|
4556
|
-
}));
|
|
4557
|
-
var require_inc = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
4558
|
-
const SemVer = require_semver$1();
|
|
4559
|
-
const inc = (version, release, options, identifier, identifierBase) => {
|
|
4560
|
-
if (typeof options === "string") {
|
|
4561
|
-
identifierBase = identifier;
|
|
4562
|
-
identifier = options;
|
|
4563
|
-
options = void 0;
|
|
4564
|
-
}
|
|
4565
|
-
try {
|
|
4566
|
-
return new SemVer(version instanceof SemVer ? version.version : version, options).inc(release, identifier, identifierBase).version;
|
|
4567
|
-
} catch (er) {
|
|
4568
|
-
return null;
|
|
4569
|
-
}
|
|
4570
|
-
};
|
|
4571
|
-
module.exports = inc;
|
|
4572
|
-
}));
|
|
4573
|
-
var require_diff = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
4574
|
-
const parse = require_parse();
|
|
4575
|
-
const diff = (version1, version2) => {
|
|
4576
|
-
const v1 = parse(version1, null, true);
|
|
4577
|
-
const v2 = parse(version2, null, true);
|
|
4578
|
-
const comparison = v1.compare(v2);
|
|
4579
|
-
if (comparison === 0) return null;
|
|
4580
|
-
const v1Higher = comparison > 0;
|
|
4581
|
-
const highVersion = v1Higher ? v1 : v2;
|
|
4582
|
-
const lowVersion = v1Higher ? v2 : v1;
|
|
4583
|
-
const highHasPre = !!highVersion.prerelease.length;
|
|
4584
|
-
if (!!lowVersion.prerelease.length && !highHasPre) {
|
|
4585
|
-
if (!lowVersion.patch && !lowVersion.minor) return "major";
|
|
4586
|
-
if (lowVersion.compareMain(highVersion) === 0) {
|
|
4587
|
-
if (lowVersion.minor && !lowVersion.patch) return "minor";
|
|
4588
|
-
return "patch";
|
|
4589
|
-
}
|
|
4590
|
-
}
|
|
4591
|
-
const prefix = highHasPre ? "pre" : "";
|
|
4592
|
-
if (v1.major !== v2.major) return prefix + "major";
|
|
4593
|
-
if (v1.minor !== v2.minor) return prefix + "minor";
|
|
4594
|
-
if (v1.patch !== v2.patch) return prefix + "patch";
|
|
4595
|
-
return "prerelease";
|
|
4596
|
-
};
|
|
4597
|
-
module.exports = diff;
|
|
4598
|
-
}));
|
|
4599
|
-
var require_major = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
4600
|
-
const SemVer = require_semver$1();
|
|
4601
|
-
const major = (a, loose) => new SemVer(a, loose).major;
|
|
4602
|
-
module.exports = major;
|
|
4603
|
-
}));
|
|
4604
|
-
var require_minor = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
4605
|
-
const SemVer = require_semver$1();
|
|
4606
|
-
const minor = (a, loose) => new SemVer(a, loose).minor;
|
|
4607
|
-
module.exports = minor;
|
|
4608
|
-
}));
|
|
4609
|
-
var require_patch = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
4610
|
-
const SemVer = require_semver$1();
|
|
4611
|
-
const patch = (a, loose) => new SemVer(a, loose).patch;
|
|
4612
|
-
module.exports = patch;
|
|
4613
|
-
}));
|
|
4614
|
-
var require_prerelease = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
4615
|
-
const parse = require_parse();
|
|
4616
|
-
const prerelease = (version, options) => {
|
|
4617
|
-
const parsed = parse(version, options);
|
|
4618
|
-
return parsed && parsed.prerelease.length ? parsed.prerelease : null;
|
|
4619
|
-
};
|
|
4620
|
-
module.exports = prerelease;
|
|
4621
|
-
}));
|
|
4622
|
-
var require_compare = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
4623
|
-
const SemVer = require_semver$1();
|
|
4624
|
-
const compare = (a, b, loose) => new SemVer(a, loose).compare(new SemVer(b, loose));
|
|
4625
|
-
module.exports = compare;
|
|
4626
|
-
}));
|
|
4627
|
-
var require_rcompare = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
4628
|
-
const compare = require_compare();
|
|
4629
|
-
const rcompare = (a, b, loose) => compare(b, a, loose);
|
|
4630
|
-
module.exports = rcompare;
|
|
4631
|
-
}));
|
|
4632
|
-
var require_compare_loose = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
4633
|
-
const compare = require_compare();
|
|
4634
|
-
const compareLoose = (a, b) => compare(a, b, true);
|
|
4635
|
-
module.exports = compareLoose;
|
|
4636
|
-
}));
|
|
4637
|
-
var require_compare_build = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
4638
|
-
const SemVer = require_semver$1();
|
|
4639
|
-
const compareBuild = (a, b, loose) => {
|
|
4640
|
-
const versionA = new SemVer(a, loose);
|
|
4641
|
-
const versionB = new SemVer(b, loose);
|
|
4642
|
-
return versionA.compare(versionB) || versionA.compareBuild(versionB);
|
|
4643
|
-
};
|
|
4644
|
-
module.exports = compareBuild;
|
|
4645
|
-
}));
|
|
4646
|
-
var require_sort = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
4647
|
-
const compareBuild = require_compare_build();
|
|
4648
|
-
const sort = (list, loose) => list.sort((a, b) => compareBuild(a, b, loose));
|
|
4649
|
-
module.exports = sort;
|
|
4650
|
-
}));
|
|
4651
|
-
var require_rsort = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
4652
|
-
const compareBuild = require_compare_build();
|
|
4653
|
-
const rsort = (list, loose) => list.sort((a, b) => compareBuild(b, a, loose));
|
|
4654
|
-
module.exports = rsort;
|
|
4655
|
-
}));
|
|
4656
|
-
var require_gt = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
4657
|
-
const compare = require_compare();
|
|
4658
|
-
const gt = (a, b, loose) => compare(a, b, loose) > 0;
|
|
4659
|
-
module.exports = gt;
|
|
4660
|
-
}));
|
|
4661
|
-
var require_lt = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
4662
|
-
const compare = require_compare();
|
|
4663
|
-
const lt = (a, b, loose) => compare(a, b, loose) < 0;
|
|
4664
|
-
module.exports = lt;
|
|
4665
|
-
}));
|
|
4666
|
-
var require_eq = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
4667
|
-
const compare = require_compare();
|
|
4668
|
-
const eq = (a, b, loose) => compare(a, b, loose) === 0;
|
|
4669
|
-
module.exports = eq;
|
|
4670
|
-
}));
|
|
4671
|
-
var require_neq = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
4672
|
-
const compare = require_compare();
|
|
4673
|
-
const neq = (a, b, loose) => compare(a, b, loose) !== 0;
|
|
4674
|
-
module.exports = neq;
|
|
4675
|
-
}));
|
|
4676
|
-
var require_gte = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
4677
|
-
const compare = require_compare();
|
|
4678
|
-
const gte = (a, b, loose) => compare(a, b, loose) >= 0;
|
|
4679
|
-
module.exports = gte;
|
|
4680
|
-
}));
|
|
4681
|
-
var require_lte = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
4682
|
-
const compare = require_compare();
|
|
4683
|
-
const lte = (a, b, loose) => compare(a, b, loose) <= 0;
|
|
4684
|
-
module.exports = lte;
|
|
4685
|
-
}));
|
|
4686
|
-
var require_cmp = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
4687
|
-
const eq = require_eq();
|
|
4688
|
-
const neq = require_neq();
|
|
4689
|
-
const gt = require_gt();
|
|
4690
|
-
const gte = require_gte();
|
|
4691
|
-
const lt = require_lt();
|
|
4692
|
-
const lte = require_lte();
|
|
4693
|
-
const cmp = (a, op, b, loose) => {
|
|
4694
|
-
switch (op) {
|
|
4695
|
-
case "===":
|
|
4696
|
-
if (typeof a === "object") a = a.version;
|
|
4697
|
-
if (typeof b === "object") b = b.version;
|
|
4698
|
-
return a === b;
|
|
4699
|
-
case "!==":
|
|
4700
|
-
if (typeof a === "object") a = a.version;
|
|
4701
|
-
if (typeof b === "object") b = b.version;
|
|
4702
|
-
return a !== b;
|
|
4703
|
-
case "":
|
|
4704
|
-
case "=":
|
|
4705
|
-
case "==": return eq(a, b, loose);
|
|
4706
|
-
case "!=": return neq(a, b, loose);
|
|
4707
|
-
case ">": return gt(a, b, loose);
|
|
4708
|
-
case ">=": return gte(a, b, loose);
|
|
4709
|
-
case "<": return lt(a, b, loose);
|
|
4710
|
-
case "<=": return lte(a, b, loose);
|
|
4711
|
-
default: throw new TypeError(`Invalid operator: ${op}`);
|
|
4712
|
-
}
|
|
4713
|
-
};
|
|
4714
|
-
module.exports = cmp;
|
|
4715
|
-
}));
|
|
4716
|
-
var require_coerce = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
4717
|
-
const SemVer = require_semver$1();
|
|
4718
|
-
const parse = require_parse();
|
|
4719
|
-
const { safeRe: re, t } = require_re();
|
|
4720
|
-
const coerce = (version, options) => {
|
|
4721
|
-
if (version instanceof SemVer) return version;
|
|
4722
|
-
if (typeof version === "number") version = String(version);
|
|
4723
|
-
if (typeof version !== "string") return null;
|
|
4724
|
-
options = options || {};
|
|
4725
|
-
let match = null;
|
|
4726
|
-
if (!options.rtl) match = version.match(options.includePrerelease ? re[t.COERCEFULL] : re[t.COERCE]);
|
|
4727
|
-
else {
|
|
4728
|
-
const coerceRtlRegex = options.includePrerelease ? re[t.COERCERTLFULL] : re[t.COERCERTL];
|
|
4729
|
-
let next;
|
|
4730
|
-
while ((next = coerceRtlRegex.exec(version)) && (!match || match.index + match[0].length !== version.length)) {
|
|
4731
|
-
if (!match || next.index + next[0].length !== match.index + match[0].length) match = next;
|
|
4732
|
-
coerceRtlRegex.lastIndex = next.index + next[1].length + next[2].length;
|
|
4733
|
-
}
|
|
4734
|
-
coerceRtlRegex.lastIndex = -1;
|
|
4735
|
-
}
|
|
4736
|
-
if (match === null) return null;
|
|
4737
|
-
const major = match[2];
|
|
4738
|
-
return parse(`${major}.${match[3] || "0"}.${match[4] || "0"}${options.includePrerelease && match[5] ? `-${match[5]}` : ""}${options.includePrerelease && match[6] ? `+${match[6]}` : ""}`, options);
|
|
4739
|
-
};
|
|
4740
|
-
module.exports = coerce;
|
|
4741
|
-
}));
|
|
4742
|
-
var require_truncate = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
4743
|
-
const parse = require_parse();
|
|
4744
|
-
const constants = require_constants();
|
|
4745
|
-
const SemVer = require_semver$1();
|
|
4746
|
-
const truncate = (version, truncation, options) => {
|
|
4747
|
-
if (!constants.RELEASE_TYPES.includes(truncation)) return null;
|
|
4748
|
-
const clonedVersion = cloneInputVersion(version, options);
|
|
4749
|
-
return clonedVersion && doTruncation(clonedVersion, truncation);
|
|
4750
|
-
};
|
|
4751
|
-
const cloneInputVersion = (version, options) => {
|
|
4752
|
-
return parse(version instanceof SemVer ? version.version : version, options);
|
|
4753
|
-
};
|
|
4754
|
-
const doTruncation = (version, truncation) => {
|
|
4755
|
-
if (isPrerelease(truncation)) return version.version;
|
|
4756
|
-
version.prerelease = [];
|
|
4757
|
-
switch (truncation) {
|
|
4758
|
-
case "major":
|
|
4759
|
-
version.minor = 0;
|
|
4760
|
-
version.patch = 0;
|
|
4761
|
-
break;
|
|
4762
|
-
case "minor":
|
|
4763
|
-
version.patch = 0;
|
|
4764
|
-
break;
|
|
4765
|
-
}
|
|
4766
|
-
return version.format();
|
|
4767
|
-
};
|
|
4768
|
-
const isPrerelease = (type) => {
|
|
4769
|
-
return type.startsWith("pre");
|
|
3183
|
+
for (const [token, maximum] of replacements) source = source.split(`${token}*`).join(`${token}{0,${maximum}}`).split(`${token}+`).join(`${token}{1,${maximum}}`);
|
|
3184
|
+
return source;
|
|
3185
|
+
}
|
|
3186
|
+
function safeRegex(source, flags) {
|
|
3187
|
+
return new RegExp(makeSafeRegexSource(source), flags);
|
|
3188
|
+
}
|
|
3189
|
+
const NUMERIC$1 = /^\d+$/;
|
|
3190
|
+
function compareIdentifiers(left, right) {
|
|
3191
|
+
if (typeof left === "number" && typeof right === "number") return left === right ? 0 : left < right ? -1 : 1;
|
|
3192
|
+
const leftNumeric = NUMERIC$1.test(String(left));
|
|
3193
|
+
const rightNumeric = NUMERIC$1.test(String(right));
|
|
3194
|
+
const normalizedLeft = leftNumeric ? Number(left) : left;
|
|
3195
|
+
const normalizedRight = rightNumeric ? Number(right) : right;
|
|
3196
|
+
return normalizedLeft === normalizedRight ? 0 : leftNumeric && !rightNumeric ? -1 : rightNumeric && !leftNumeric ? 1 : normalizedLeft < normalizedRight ? -1 : 1;
|
|
3197
|
+
}
|
|
3198
|
+
const FULL = safeRegex(`^${FULL_PLAIN}$`);
|
|
3199
|
+
const LOOSE = safeRegex(`^${LOOSE_PLAIN}$`);
|
|
3200
|
+
safeRegex(`^${PRERELEASE}$`);
|
|
3201
|
+
safeRegex(`^${PRERELEASE_LOOSE}$`);
|
|
3202
|
+
const COERCE_EXACT = safeRegex(COERCE);
|
|
3203
|
+
const COERCE_FULL_EXACT = safeRegex(COERCE_FULL);
|
|
3204
|
+
const NUMERIC = /^\d+$/;
|
|
3205
|
+
function formatComparableVersion(version) {
|
|
3206
|
+
const base = `${version.major}.${version.minor}.${version.patch}`;
|
|
3207
|
+
return version.prerelease?.length ? `${base}-${version.prerelease.join(".")}` : base;
|
|
3208
|
+
}
|
|
3209
|
+
function formatFullVersion(version) {
|
|
3210
|
+
const comparable = formatComparableVersion(version);
|
|
3211
|
+
return version.build?.length ? `${comparable}+${version.build.join(".")}` : comparable;
|
|
3212
|
+
}
|
|
3213
|
+
function parse(version, options = {}) {
|
|
3214
|
+
if (typeof version !== "string") return version;
|
|
3215
|
+
if (version.length > 256) throw new TypeError(`Version exceeds the maximum length of 256 characters`);
|
|
3216
|
+
const match = version.trim().match(options.loose ? LOOSE : FULL);
|
|
3217
|
+
if (!match) throw new TypeError(`Invalid version syntax: ${version}`);
|
|
3218
|
+
const major = Number(match[1]);
|
|
3219
|
+
const minor = Number(match[2]);
|
|
3220
|
+
const patch = Number(match[3]);
|
|
3221
|
+
if (major > Number.MAX_SAFE_INTEGER || major < 0) throw new TypeError(`Invalid major version: ${match[1]}`);
|
|
3222
|
+
if (minor > Number.MAX_SAFE_INTEGER || minor < 0) throw new TypeError(`Invalid minor version: ${match[2]}`);
|
|
3223
|
+
if (patch > Number.MAX_SAFE_INTEGER || patch < 0) throw new TypeError(`Invalid patch version: ${match[3]}`);
|
|
3224
|
+
const prerelease = match[4] ? match[4].split(".").map((identifier) => {
|
|
3225
|
+
if (NUMERIC.test(identifier)) {
|
|
3226
|
+
const numeric = Number(identifier);
|
|
3227
|
+
if (numeric >= 0 && numeric < Number.MAX_SAFE_INTEGER) return numeric;
|
|
3228
|
+
}
|
|
3229
|
+
return identifier;
|
|
3230
|
+
}) : void 0;
|
|
3231
|
+
return {
|
|
3232
|
+
build: match[5]?.split("."),
|
|
3233
|
+
major,
|
|
3234
|
+
minor,
|
|
3235
|
+
patch,
|
|
3236
|
+
prerelease
|
|
4770
3237
|
};
|
|
4771
|
-
|
|
4772
|
-
})
|
|
4773
|
-
|
|
4774
|
-
|
|
4775
|
-
|
|
4776
|
-
|
|
4777
|
-
|
|
4778
|
-
|
|
4779
|
-
|
|
4780
|
-
|
|
4781
|
-
|
|
4782
|
-
|
|
4783
|
-
|
|
4784
|
-
|
|
4785
|
-
|
|
4786
|
-
|
|
4787
|
-
|
|
4788
|
-
|
|
4789
|
-
|
|
4790
|
-
|
|
4791
|
-
|
|
4792
|
-
|
|
4793
|
-
|
|
4794
|
-
|
|
4795
|
-
|
|
4796
|
-
|
|
4797
|
-
|
|
4798
|
-
|
|
4799
|
-
|
|
4800
|
-
|
|
3238
|
+
}
|
|
3239
|
+
function tryParse(version, options = {}) {
|
|
3240
|
+
try {
|
|
3241
|
+
return parse(version, options);
|
|
3242
|
+
} catch {
|
|
3243
|
+
return null;
|
|
3244
|
+
}
|
|
3245
|
+
}
|
|
3246
|
+
function compareMainParsed(left, right) {
|
|
3247
|
+
return left.major === right.major ? left.minor === right.minor ? left.patch === right.patch ? 0 : left.patch < right.patch ? -1 : 1 : left.minor < right.minor ? -1 : 1 : left.major < right.major ? -1 : 1;
|
|
3248
|
+
}
|
|
3249
|
+
function comparePrereleaseParsed(left, right) {
|
|
3250
|
+
const leftPrerelease = left.prerelease;
|
|
3251
|
+
const rightPrerelease = right.prerelease;
|
|
3252
|
+
if (leftPrerelease?.length && !rightPrerelease?.length) return -1;
|
|
3253
|
+
if (!leftPrerelease?.length && rightPrerelease?.length) return 1;
|
|
3254
|
+
if (!leftPrerelease?.length && !rightPrerelease?.length) return 0;
|
|
3255
|
+
for (let index = 0;; index++) {
|
|
3256
|
+
const leftIdentifier = leftPrerelease?.[index];
|
|
3257
|
+
const rightIdentifier = rightPrerelease?.[index];
|
|
3258
|
+
if (leftIdentifier === void 0 && rightIdentifier === void 0) return 0;
|
|
3259
|
+
if (rightIdentifier === void 0) return 1;
|
|
3260
|
+
if (leftIdentifier === void 0) return -1;
|
|
3261
|
+
if (leftIdentifier !== rightIdentifier) return compareIdentifiers(leftIdentifier, rightIdentifier);
|
|
3262
|
+
}
|
|
3263
|
+
}
|
|
3264
|
+
function compareParsed(left, right) {
|
|
3265
|
+
return compareMainParsed(left, right) || comparePrereleaseParsed(left, right);
|
|
3266
|
+
}
|
|
3267
|
+
function coerceParsedVersion(value, options = {}) {
|
|
3268
|
+
if (typeof value === "object") return value;
|
|
3269
|
+
const input = typeof value === "number" ? String(value) : value;
|
|
3270
|
+
if (typeof input !== "string") return null;
|
|
3271
|
+
let match = null;
|
|
3272
|
+
if (options.rtl) {
|
|
3273
|
+
const expression = safeRegex(options.includePrerelease ? COERCE_FULL : COERCE, "g");
|
|
3274
|
+
let next;
|
|
3275
|
+
while ((next = expression.exec(input)) && (!match || match.index + match[0].length !== input.length)) {
|
|
3276
|
+
if (!match || next.index + next[0].length !== match.index + match[0].length) match = next;
|
|
3277
|
+
expression.lastIndex = next.index + next[1].length + next[2].length;
|
|
3278
|
+
}
|
|
3279
|
+
} else match = (options.includePrerelease ? COERCE_FULL_EXACT : COERCE_EXACT).exec(input);
|
|
3280
|
+
if (!match) return null;
|
|
3281
|
+
const major = match[2];
|
|
3282
|
+
return tryParse(`${major}.${match[3] || "0"}.${match[4] || "0"}${options.includePrerelease && match[5] ? `-${match[5]}` : ""}${options.includePrerelease && match[6] ? `+${match[6]}` : ""}`, options);
|
|
3283
|
+
}
|
|
3284
|
+
const STRICT_COMPARATOR = safeRegex(String.raw`^${GREATER_LESS_THAN}\s*(${FULL_PLAIN})$|^$`);
|
|
3285
|
+
const LOOSE_COMPARATOR$1 = safeRegex(String.raw`^${GREATER_LESS_THAN}\s*(${LOOSE_PLAIN})$|^$`);
|
|
3286
|
+
function parseComparator(comparator, options = {}) {
|
|
3287
|
+
const normalized = comparator.trim().replaceAll(/\s+/g, " ");
|
|
3288
|
+
const match = normalized.match(options.loose ? LOOSE_COMPARATOR$1 : STRICT_COMPARATOR);
|
|
3289
|
+
if (!match) throw new TypeError(`Invalid comparator: ${normalized}`);
|
|
3290
|
+
const operator = match[1] === "=" ? "" : match[1] || "";
|
|
3291
|
+
const version = match[2] ? parse(match[2], options) : null;
|
|
3292
|
+
return {
|
|
3293
|
+
operator,
|
|
3294
|
+
options,
|
|
3295
|
+
value: version ? `${operator}${formatComparableVersion(version)}` : "",
|
|
3296
|
+
version
|
|
4801
3297
|
};
|
|
4802
|
-
|
|
4803
|
-
|
|
4804
|
-
|
|
4805
|
-
const
|
|
4806
|
-
|
|
4807
|
-
|
|
4808
|
-
|
|
4809
|
-
|
|
4810
|
-
|
|
4811
|
-
|
|
4812
|
-
|
|
4813
|
-
|
|
4814
|
-
|
|
4815
|
-
|
|
4816
|
-
|
|
4817
|
-
|
|
4818
|
-
|
|
4819
|
-
|
|
4820
|
-
|
|
4821
|
-
|
|
4822
|
-
|
|
4823
|
-
|
|
4824
|
-
|
|
4825
|
-
|
|
4826
|
-
|
|
4827
|
-
|
|
4828
|
-
|
|
4829
|
-
|
|
4830
|
-
|
|
4831
|
-
|
|
4832
|
-
|
|
4833
|
-
|
|
4834
|
-
|
|
4835
|
-
|
|
4836
|
-
|
|
4837
|
-
|
|
4838
|
-
|
|
4839
|
-
|
|
4840
|
-
|
|
4841
|
-
|
|
4842
|
-
|
|
4843
|
-
|
|
4844
|
-
|
|
4845
|
-
|
|
4846
|
-
|
|
4847
|
-
|
|
4848
|
-
|
|
4849
|
-
|
|
4850
|
-
|
|
4851
|
-
|
|
4852
|
-
}
|
|
4853
|
-
|
|
4854
|
-
|
|
4855
|
-
|
|
4856
|
-
|
|
4857
|
-
|
|
4858
|
-
|
|
4859
|
-
|
|
4860
|
-
|
|
4861
|
-
|
|
4862
|
-
|
|
4863
|
-
|
|
4864
|
-
|
|
4865
|
-
|
|
4866
|
-
|
|
4867
|
-
|
|
4868
|
-
|
|
4869
|
-
|
|
4870
|
-
|
|
4871
|
-
|
|
4872
|
-
|
|
4873
|
-
|
|
4874
|
-
|
|
4875
|
-
|
|
4876
|
-
|
|
4877
|
-
|
|
4878
|
-
|
|
4879
|
-
|
|
4880
|
-
|
|
4881
|
-
|
|
4882
|
-
|
|
4883
|
-
|
|
4884
|
-
|
|
4885
|
-
|
|
4886
|
-
|
|
4887
|
-
|
|
4888
|
-
|
|
4889
|
-
if (
|
|
4890
|
-
|
|
4891
|
-
|
|
4892
|
-
|
|
4893
|
-
|
|
4894
|
-
|
|
4895
|
-
|
|
4896
|
-
|
|
4897
|
-
|
|
4898
|
-
|
|
4899
|
-
}
|
|
4900
|
-
test(version) {
|
|
4901
|
-
if (!version) return false;
|
|
4902
|
-
if (typeof version === "string") try {
|
|
4903
|
-
version = new SemVer(version, this.options);
|
|
4904
|
-
} catch (er) {
|
|
4905
|
-
return false;
|
|
3298
|
+
}
|
|
3299
|
+
function testParsedComparator(comparator, version) {
|
|
3300
|
+
if (!comparator.version) return true;
|
|
3301
|
+
const comparison = compareParsed(version, comparator.version);
|
|
3302
|
+
switch (comparator.operator) {
|
|
3303
|
+
case "": return comparison === 0;
|
|
3304
|
+
case ">": return comparison > 0;
|
|
3305
|
+
case ">=": return comparison >= 0;
|
|
3306
|
+
case "<": return comparison < 0;
|
|
3307
|
+
case "<=": return comparison <= 0;
|
|
3308
|
+
}
|
|
3309
|
+
}
|
|
3310
|
+
function comparatorAllowsPrerelease(comparator, version) {
|
|
3311
|
+
const allowed = comparator.version;
|
|
3312
|
+
return allowed !== null && !!allowed.prerelease?.length && allowed.major === version.major && allowed.minor === version.minor && allowed.patch === version.patch;
|
|
3313
|
+
}
|
|
3314
|
+
function testComparatorSet(set, version, options) {
|
|
3315
|
+
if (set.some((comparator) => !testParsedComparator(comparator, version))) return false;
|
|
3316
|
+
return !version.prerelease?.length || !!options.includePrerelease || set.some((comparator) => comparatorAllowsPrerelease(comparator, version));
|
|
3317
|
+
}
|
|
3318
|
+
const BUILD_STRIP = new RegExp(BUILD, "g");
|
|
3319
|
+
const BUILD_SAFE = safeRegex(BUILD);
|
|
3320
|
+
const STRICT_HYPHEN = safeRegex(String.raw`^\s*(${XRANGE_PLAIN})\s+-\s+(${XRANGE_PLAIN})\s*$`);
|
|
3321
|
+
const LOOSE_HYPHEN = safeRegex(String.raw`^\s*(${XRANGE_PLAIN_LOOSE})\s+-\s+(${XRANGE_PLAIN_LOOSE})\s*$`);
|
|
3322
|
+
const COMPARATOR_TRIM = safeRegex(String.raw`(\s*)${GREATER_LESS_THAN}\s*(${LOOSE_PLAIN}|${XRANGE_PLAIN})`, "g");
|
|
3323
|
+
const TILDE_TRIM = safeRegex(String.raw`(\s*)${LONE_TILDE}\s+`, "g");
|
|
3324
|
+
const CARET_TRIM = safeRegex(String.raw`(\s*)${LONE_CARET}\s+`, "g");
|
|
3325
|
+
const STRICT_TILDE = safeRegex(`^${LONE_TILDE}${XRANGE_PLAIN}$`);
|
|
3326
|
+
const LOOSE_TILDE = safeRegex(`^${LONE_TILDE}${XRANGE_PLAIN_LOOSE}$`);
|
|
3327
|
+
const STRICT_CARET = safeRegex(`^${LONE_CARET}${XRANGE_PLAIN}$`);
|
|
3328
|
+
const LOOSE_CARET = safeRegex(`^${LONE_CARET}${XRANGE_PLAIN_LOOSE}$`);
|
|
3329
|
+
const STRICT_XRANGE = safeRegex(String.raw`^${GREATER_LESS_THAN}\s*${XRANGE_PLAIN}$`);
|
|
3330
|
+
const LOOSE_XRANGE = safeRegex(String.raw`^${GREATER_LESS_THAN}\s*${XRANGE_PLAIN_LOOSE}$`);
|
|
3331
|
+
const STAR = safeRegex(String.raw`(<|>)?=?\s*\*`);
|
|
3332
|
+
const GTE_ZERO = /^\s*>=\s*0\.0\.0\s*$/;
|
|
3333
|
+
const GTE_ZERO_PRERELEASE = /^\s*>=\s*0\.0\.0-0\s*$/;
|
|
3334
|
+
const LOOSE_COMPARATOR = safeRegex(String.raw`^${GREATER_LESS_THAN}\s*(${LOOSE_PLAIN})$|^$`);
|
|
3335
|
+
function isWildcard(value) {
|
|
3336
|
+
return !value || String(value).toLowerCase() === "x" || String(value) === "*";
|
|
3337
|
+
}
|
|
3338
|
+
function hasInvalidWildcardOrder(major, minor, patch) {
|
|
3339
|
+
return isWildcard(major) && !isWildcard(minor) || isWildcard(minor) && Boolean(patch) && !isWildcard(patch);
|
|
3340
|
+
}
|
|
3341
|
+
function replaceTilde(comparator, options) {
|
|
3342
|
+
const expression = options.loose ? LOOSE_TILDE : STRICT_TILDE;
|
|
3343
|
+
const lowerPrerelease = options.includePrerelease ? "-0" : "";
|
|
3344
|
+
return comparator.replace(expression, (_match, major, minor, patch, prerelease) => {
|
|
3345
|
+
if (isWildcard(major)) return "";
|
|
3346
|
+
if (isWildcard(minor)) return `>=${major}.0.0${lowerPrerelease} <${Number(major) + 1}.0.0-0`;
|
|
3347
|
+
if (isWildcard(patch)) return `>=${major}.${minor}.0${lowerPrerelease} <${major}.${Number(minor) + 1}.0-0`;
|
|
3348
|
+
return prerelease ? `>=${major}.${minor}.${patch}-${prerelease} <${major}.${Number(minor) + 1}.0-0` : `>=${major}.${minor}.${patch} <${major}.${Number(minor) + 1}.0-0`;
|
|
3349
|
+
});
|
|
3350
|
+
}
|
|
3351
|
+
function replaceTildes(comparator, options) {
|
|
3352
|
+
return comparator.trim().split(/\s+/).map((part) => replaceTilde(part, options)).join(" ");
|
|
3353
|
+
}
|
|
3354
|
+
function replaceCaret(comparator, options) {
|
|
3355
|
+
const expression = options.loose ? LOOSE_CARET : STRICT_CARET;
|
|
3356
|
+
const lowerPrerelease = options.includePrerelease ? "-0" : "";
|
|
3357
|
+
return comparator.replace(expression, (_match, major, minor, patch, prerelease) => {
|
|
3358
|
+
if (isWildcard(major)) return "";
|
|
3359
|
+
if (isWildcard(minor)) return `>=${major}.0.0${lowerPrerelease} <${Number(major) + 1}.0.0-0`;
|
|
3360
|
+
if (isWildcard(patch)) return major === "0" ? `>=${major}.${minor}.0${lowerPrerelease} <${major}.${Number(minor) + 1}.0-0` : `>=${major}.${minor}.0${lowerPrerelease} <${Number(major) + 1}.0.0-0`;
|
|
3361
|
+
if (prerelease) return major === "0" ? minor === "0" ? `>=${major}.${minor}.${patch}-${prerelease} <${major}.${minor}.${Number(patch) + 1}-0` : `>=${major}.${minor}.${patch}-${prerelease} <${major}.${Number(minor) + 1}.0-0` : `>=${major}.${minor}.${patch}-${prerelease} <${Number(major) + 1}.0.0-0`;
|
|
3362
|
+
return major === "0" ? minor === "0" ? `>=${major}.${minor}.${patch} <${major}.${minor}.${Number(patch) + 1}-0` : `>=${major}.${minor}.${patch} <${major}.${Number(minor) + 1}.0-0` : `>=${major}.${minor}.${patch} <${Number(major) + 1}.0.0-0`;
|
|
3363
|
+
});
|
|
3364
|
+
}
|
|
3365
|
+
function replaceCarets(comparator, options) {
|
|
3366
|
+
return comparator.trim().split(/\s+/).map((part) => replaceCaret(part, options)).join(" ");
|
|
3367
|
+
}
|
|
3368
|
+
function replaceXRange(comparator, options) {
|
|
3369
|
+
const expression = options.loose ? LOOSE_XRANGE : STRICT_XRANGE;
|
|
3370
|
+
return comparator.trim().replace(expression, (match, rawOperator, rawMajor, rawMinor, rawPatch) => {
|
|
3371
|
+
let operator = rawOperator;
|
|
3372
|
+
let major = rawMajor;
|
|
3373
|
+
let minor = rawMinor;
|
|
3374
|
+
let patch = rawPatch;
|
|
3375
|
+
if (hasInvalidWildcardOrder(String(major), minor === void 0 ? void 0 : String(minor), patch === void 0 ? void 0 : String(patch))) return comparator;
|
|
3376
|
+
const wildcardMajor = isWildcard(major);
|
|
3377
|
+
const wildcardMinor = wildcardMajor || isWildcard(minor);
|
|
3378
|
+
const wildcardPatch = wildcardMinor || isWildcard(patch);
|
|
3379
|
+
if (operator === "=" && wildcardPatch) operator = "";
|
|
3380
|
+
if (wildcardMajor) return operator === ">" || operator === "<" ? "<0.0.0-0" : "*";
|
|
3381
|
+
let prerelease = options.includePrerelease ? "-0" : "";
|
|
3382
|
+
if (operator && wildcardPatch) {
|
|
3383
|
+
if (wildcardMinor) minor = 0;
|
|
3384
|
+
patch = 0;
|
|
3385
|
+
if (operator === ">") {
|
|
3386
|
+
operator = ">=";
|
|
3387
|
+
if (wildcardMinor) {
|
|
3388
|
+
major = Number(major) + 1;
|
|
3389
|
+
minor = 0;
|
|
3390
|
+
} else minor = Number(minor) + 1;
|
|
3391
|
+
} else if (operator === "<=") {
|
|
3392
|
+
operator = "<";
|
|
3393
|
+
if (wildcardMinor) major = Number(major) + 1;
|
|
3394
|
+
else minor = Number(minor) + 1;
|
|
4906
3395
|
}
|
|
4907
|
-
|
|
4908
|
-
return
|
|
3396
|
+
if (operator === "<") prerelease = "-0";
|
|
3397
|
+
return `${operator}${major}.${minor}.${patch}${prerelease}`;
|
|
4909
3398
|
}
|
|
4910
|
-
|
|
4911
|
-
|
|
4912
|
-
|
|
4913
|
-
|
|
4914
|
-
|
|
4915
|
-
|
|
4916
|
-
|
|
4917
|
-
|
|
4918
|
-
|
|
4919
|
-
const
|
|
4920
|
-
|
|
4921
|
-
|
|
4922
|
-
let
|
|
4923
|
-
|
|
4924
|
-
|
|
4925
|
-
|
|
4926
|
-
|
|
4927
|
-
|
|
4928
|
-
|
|
4929
|
-
|
|
4930
|
-
}
|
|
4931
|
-
|
|
4932
|
-
|
|
4933
|
-
const parseComparator = (comp, options) => {
|
|
4934
|
-
comp = comp.replace(re[t.BUILD], "");
|
|
4935
|
-
debug("comp", comp, options);
|
|
4936
|
-
comp = replaceCarets(comp, options);
|
|
4937
|
-
debug("caret", comp);
|
|
4938
|
-
comp = replaceTildes(comp, options);
|
|
4939
|
-
debug("tildes", comp);
|
|
4940
|
-
comp = replaceXRanges(comp, options);
|
|
4941
|
-
debug("xrange", comp);
|
|
4942
|
-
comp = replaceStars(comp, options);
|
|
4943
|
-
debug("stars", comp);
|
|
4944
|
-
return comp;
|
|
4945
|
-
};
|
|
4946
|
-
const isX = (id) => !id || id.toLowerCase() === "x" || id === "*";
|
|
4947
|
-
const invalidXRangeOrder = (M, m, p) => isX(M) && !isX(m) || isX(m) && p && !isX(p);
|
|
4948
|
-
const replaceTildes = (comp, options) => {
|
|
4949
|
-
return comp.trim().split(/\s+/).map((c) => replaceTilde(c, options)).join(" ");
|
|
4950
|
-
};
|
|
4951
|
-
const replaceTilde = (comp, options) => {
|
|
4952
|
-
const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE];
|
|
4953
|
-
return comp.replace(r, (_, M, m, p, pr) => {
|
|
4954
|
-
debug("tilde", comp, _, M, m, p, pr);
|
|
4955
|
-
let ret;
|
|
4956
|
-
if (isX(M)) ret = "";
|
|
4957
|
-
else if (isX(m)) ret = `>=${M}.0.0 <${+M + 1}.0.0-0`;
|
|
4958
|
-
else if (isX(p)) ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0`;
|
|
4959
|
-
else if (pr) {
|
|
4960
|
-
debug("replaceTilde pr", pr);
|
|
4961
|
-
ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`;
|
|
4962
|
-
} else ret = `>=${M}.${m}.${p} <${M}.${+m + 1}.0-0`;
|
|
4963
|
-
debug("tilde return", ret);
|
|
4964
|
-
return ret;
|
|
4965
|
-
});
|
|
4966
|
-
};
|
|
4967
|
-
const replaceCarets = (comp, options) => {
|
|
4968
|
-
return comp.trim().split(/\s+/).map((c) => replaceCaret(c, options)).join(" ");
|
|
4969
|
-
};
|
|
4970
|
-
const replaceCaret = (comp, options) => {
|
|
4971
|
-
debug("caret", comp, options);
|
|
4972
|
-
const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET];
|
|
4973
|
-
const z = options.includePrerelease ? "-0" : "";
|
|
4974
|
-
return comp.replace(r, (_, M, m, p, pr) => {
|
|
4975
|
-
debug("caret", comp, _, M, m, p, pr);
|
|
4976
|
-
let ret;
|
|
4977
|
-
if (isX(M)) ret = "";
|
|
4978
|
-
else if (isX(m)) ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0`;
|
|
4979
|
-
else if (isX(p)) if (M === "0") ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0`;
|
|
4980
|
-
else ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0`;
|
|
4981
|
-
else if (pr) {
|
|
4982
|
-
debug("replaceCaret pr", pr);
|
|
4983
|
-
if (M === "0") if (m === "0") ret = `>=${M}.${m}.${p}-${pr} <${M}.${m}.${+p + 1}-0`;
|
|
4984
|
-
else ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`;
|
|
4985
|
-
else ret = `>=${M}.${m}.${p}-${pr} <${+M + 1}.0.0-0`;
|
|
4986
|
-
} else {
|
|
4987
|
-
debug("no pr");
|
|
4988
|
-
if (M === "0") if (m === "0") ret = `>=${M}.${m}.${p} <${M}.${m}.${+p + 1}-0`;
|
|
4989
|
-
else ret = `>=${M}.${m}.${p} <${M}.${+m + 1}.0-0`;
|
|
4990
|
-
else ret = `>=${M}.${m}.${p} <${+M + 1}.0.0-0`;
|
|
4991
|
-
}
|
|
4992
|
-
debug("caret return", ret);
|
|
4993
|
-
return ret;
|
|
4994
|
-
});
|
|
4995
|
-
};
|
|
4996
|
-
const replaceXRanges = (comp, options) => {
|
|
4997
|
-
debug("replaceXRanges", comp, options);
|
|
4998
|
-
return comp.split(/\s+/).map((c) => replaceXRange(c, options)).join(" ");
|
|
4999
|
-
};
|
|
5000
|
-
const replaceXRange = (comp, options) => {
|
|
5001
|
-
comp = comp.trim();
|
|
5002
|
-
const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE];
|
|
5003
|
-
return comp.replace(r, (ret, gtlt, M, m, p, pr) => {
|
|
5004
|
-
debug("xRange", comp, ret, gtlt, M, m, p, pr);
|
|
5005
|
-
if (invalidXRangeOrder(M, m, p)) return comp;
|
|
5006
|
-
const xM = isX(M);
|
|
5007
|
-
const xm = xM || isX(m);
|
|
5008
|
-
const xp = xm || isX(p);
|
|
5009
|
-
const anyX = xp;
|
|
5010
|
-
if (gtlt === "=" && anyX) gtlt = "";
|
|
5011
|
-
pr = options.includePrerelease ? "-0" : "";
|
|
5012
|
-
if (xM) if (gtlt === ">" || gtlt === "<") ret = "<0.0.0-0";
|
|
5013
|
-
else ret = "*";
|
|
5014
|
-
else if (gtlt && anyX) {
|
|
5015
|
-
if (xm) m = 0;
|
|
5016
|
-
p = 0;
|
|
5017
|
-
if (gtlt === ">") {
|
|
5018
|
-
gtlt = ">=";
|
|
5019
|
-
if (xm) {
|
|
5020
|
-
M = +M + 1;
|
|
5021
|
-
m = 0;
|
|
5022
|
-
p = 0;
|
|
5023
|
-
} else {
|
|
5024
|
-
m = +m + 1;
|
|
5025
|
-
p = 0;
|
|
5026
|
-
}
|
|
5027
|
-
} else if (gtlt === "<=") {
|
|
5028
|
-
gtlt = "<";
|
|
5029
|
-
if (xm) M = +M + 1;
|
|
5030
|
-
else m = +m + 1;
|
|
5031
|
-
}
|
|
5032
|
-
if (gtlt === "<") pr = "-0";
|
|
5033
|
-
ret = `${gtlt + M}.${m}.${p}${pr}`;
|
|
5034
|
-
} else if (xm) ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0`;
|
|
5035
|
-
else if (xp) ret = `>=${M}.${m}.0${pr} <${M}.${+m + 1}.0-0`;
|
|
5036
|
-
debug("xRange return", ret);
|
|
5037
|
-
return ret;
|
|
5038
|
-
});
|
|
5039
|
-
};
|
|
5040
|
-
const replaceStars = (comp, options) => {
|
|
5041
|
-
debug("replaceStars", comp, options);
|
|
5042
|
-
return comp.trim().replace(re[t.STAR], "");
|
|
5043
|
-
};
|
|
5044
|
-
const replaceGTE0 = (comp, options) => {
|
|
5045
|
-
debug("replaceGTE0", comp, options);
|
|
5046
|
-
return comp.trim().replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], "");
|
|
5047
|
-
};
|
|
5048
|
-
const hyphenReplace = (incPr) => ($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr) => {
|
|
5049
|
-
if (isX(fM)) from = "";
|
|
5050
|
-
else if (isX(fm)) from = `>=${fM}.0.0${incPr ? "-0" : ""}`;
|
|
5051
|
-
else if (isX(fp)) from = `>=${fM}.${fm}.0${incPr ? "-0" : ""}`;
|
|
5052
|
-
else if (fpr) from = `>=${from}`;
|
|
5053
|
-
else from = `>=${from}${incPr ? "-0" : ""}`;
|
|
5054
|
-
if (isX(tM)) to = "";
|
|
5055
|
-
else if (isX(tm)) to = `<${+tM + 1}.0.0-0`;
|
|
5056
|
-
else if (isX(tp)) to = `<${tM}.${+tm + 1}.0-0`;
|
|
5057
|
-
else if (tpr) to = `<=${tM}.${tm}.${tp}-${tpr}`;
|
|
5058
|
-
else if (incPr) to = `<${tM}.${tm}.${+tp + 1}-0`;
|
|
3399
|
+
if (wildcardMinor) return `>=${major}.0.0${prerelease} <${Number(major) + 1}.0.0-0`;
|
|
3400
|
+
if (wildcardPatch) return `>=${major}.${minor}.0${prerelease} <${major}.${Number(minor) + 1}.0-0`;
|
|
3401
|
+
return match;
|
|
3402
|
+
});
|
|
3403
|
+
}
|
|
3404
|
+
function replaceXRanges(comparator, options) {
|
|
3405
|
+
return comparator.split(/\s+/).map((part) => replaceXRange(part, options)).join(" ");
|
|
3406
|
+
}
|
|
3407
|
+
function replaceHyphenRange(range, options) {
|
|
3408
|
+
const expression = options.loose ? LOOSE_HYPHEN : STRICT_HYPHEN;
|
|
3409
|
+
return range.replace(expression, (_match, rawFrom, fromMajor, fromMinor, fromPatch, fromPrerelease, _fromBuild, rawTo, toMajor, toMinor, toPatch, toPrerelease) => {
|
|
3410
|
+
let from = rawFrom;
|
|
3411
|
+
let to = rawTo;
|
|
3412
|
+
if (isWildcard(fromMajor)) from = "";
|
|
3413
|
+
else if (isWildcard(fromMinor)) from = `>=${fromMajor}.0.0${options.includePrerelease ? "-0" : ""}`;
|
|
3414
|
+
else if (isWildcard(fromPatch)) from = `>=${fromMajor}.${fromMinor}.0${options.includePrerelease ? "-0" : ""}`;
|
|
3415
|
+
else if (fromPrerelease) from = `>=${from}`;
|
|
3416
|
+
else from = `>=${from}${options.includePrerelease ? "-0" : ""}`;
|
|
3417
|
+
if (isWildcard(toMajor)) to = "";
|
|
3418
|
+
else if (isWildcard(toMinor)) to = `<${Number(toMajor) + 1}.0.0-0`;
|
|
3419
|
+
else if (isWildcard(toPatch)) to = `<${toMajor}.${Number(toMinor) + 1}.0-0`;
|
|
3420
|
+
else if (toPrerelease) to = `<=${toMajor}.${toMinor}.${toPatch}-${toPrerelease}`;
|
|
3421
|
+
else if (options.includePrerelease) to = `<${toMajor}.${toMinor}.${Number(toPatch) + 1}-0`;
|
|
5059
3422
|
else to = `<=${to}`;
|
|
5060
3423
|
return `${from} ${to}`.trim();
|
|
5061
|
-
};
|
|
5062
|
-
|
|
5063
|
-
|
|
5064
|
-
|
|
5065
|
-
|
|
5066
|
-
|
|
5067
|
-
|
|
5068
|
-
|
|
5069
|
-
|
|
5070
|
-
|
|
5071
|
-
|
|
5072
|
-
|
|
5073
|
-
|
|
5074
|
-
|
|
5075
|
-
|
|
5076
|
-
|
|
5077
|
-
})
|
|
5078
|
-
|
|
5079
|
-
const
|
|
5080
|
-
|
|
5081
|
-
|
|
5082
|
-
|
|
5083
|
-
|
|
5084
|
-
|
|
5085
|
-
|
|
5086
|
-
|
|
5087
|
-
|
|
5088
|
-
|
|
5089
|
-
|
|
5090
|
-
this.options = options;
|
|
5091
|
-
this.loose = !!options.loose;
|
|
5092
|
-
this.parse(comp);
|
|
5093
|
-
if (this.semver === ANY) this.value = "";
|
|
5094
|
-
else this.value = this.operator + this.semver.version;
|
|
5095
|
-
debug("comp", this);
|
|
5096
|
-
}
|
|
5097
|
-
parse(comp) {
|
|
5098
|
-
const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR];
|
|
5099
|
-
const m = comp.match(r);
|
|
5100
|
-
if (!m) throw new TypeError(`Invalid comparator: ${comp}`);
|
|
5101
|
-
this.operator = m[1] !== void 0 ? m[1] : "";
|
|
5102
|
-
if (this.operator === "=") this.operator = "";
|
|
5103
|
-
if (!m[2]) this.semver = ANY;
|
|
5104
|
-
else this.semver = new SemVer(m[2], this.options.loose);
|
|
5105
|
-
}
|
|
5106
|
-
toString() {
|
|
5107
|
-
return this.value;
|
|
5108
|
-
}
|
|
5109
|
-
test(version) {
|
|
5110
|
-
debug("Comparator.test", version, this.options.loose);
|
|
5111
|
-
if (this.semver === ANY || version === ANY) return true;
|
|
5112
|
-
if (typeof version === "string") try {
|
|
5113
|
-
version = new SemVer(version, this.options);
|
|
5114
|
-
} catch (er) {
|
|
5115
|
-
return false;
|
|
5116
|
-
}
|
|
5117
|
-
return cmp(version, this.operator, this.semver, this.options);
|
|
5118
|
-
}
|
|
5119
|
-
intersects(comp, options) {
|
|
5120
|
-
if (!(comp instanceof Comparator)) throw new TypeError("a Comparator is required");
|
|
5121
|
-
if (this.operator === "") {
|
|
5122
|
-
if (this.value === "") return true;
|
|
5123
|
-
return new Range(comp.value, options).test(this.value);
|
|
5124
|
-
} else if (comp.operator === "") {
|
|
5125
|
-
if (comp.value === "") return true;
|
|
5126
|
-
return new Range(this.value, options).test(comp.semver);
|
|
5127
|
-
}
|
|
5128
|
-
options = parseOptions(options);
|
|
5129
|
-
if (options.includePrerelease && (this.value === "<0.0.0-0" || comp.value === "<0.0.0-0")) return false;
|
|
5130
|
-
if (!options.includePrerelease && (this.value.startsWith("<0.0.0") || comp.value.startsWith("<0.0.0"))) return false;
|
|
5131
|
-
if (this.operator.startsWith(">") && comp.operator.startsWith(">")) return true;
|
|
5132
|
-
if (this.operator.startsWith("<") && comp.operator.startsWith("<")) return true;
|
|
5133
|
-
if (this.semver.version === comp.semver.version && this.operator.includes("=") && comp.operator.includes("=")) return true;
|
|
5134
|
-
if (cmp(this.semver, "<", comp.semver, options) && this.operator.startsWith(">") && comp.operator.startsWith("<")) return true;
|
|
5135
|
-
if (cmp(this.semver, ">", comp.semver, options) && this.operator.startsWith("<") && comp.operator.startsWith(">")) return true;
|
|
5136
|
-
return false;
|
|
5137
|
-
}
|
|
5138
|
-
};
|
|
5139
|
-
const parseOptions = require_parse_options();
|
|
5140
|
-
const { safeRe: re, t } = require_re();
|
|
5141
|
-
const cmp = require_cmp();
|
|
5142
|
-
const debug = require_debug();
|
|
5143
|
-
const SemVer = require_semver$1();
|
|
5144
|
-
const Range = require_range();
|
|
5145
|
-
}));
|
|
5146
|
-
var require_satisfies = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
5147
|
-
const Range = require_range();
|
|
5148
|
-
const satisfies = (version, range, options) => {
|
|
5149
|
-
try {
|
|
5150
|
-
range = new Range(range, options);
|
|
5151
|
-
} catch (er) {
|
|
5152
|
-
return false;
|
|
5153
|
-
}
|
|
5154
|
-
return range.test(version);
|
|
5155
|
-
};
|
|
5156
|
-
module.exports = satisfies;
|
|
5157
|
-
}));
|
|
5158
|
-
var require_to_comparators = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
5159
|
-
const Range = require_range();
|
|
5160
|
-
const toComparators = (range, options) => new Range(range, options).set.map((comp) => comp.map((c) => c.value).join(" ").trim().split(" "));
|
|
5161
|
-
module.exports = toComparators;
|
|
5162
|
-
}));
|
|
5163
|
-
var require_max_satisfying = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
5164
|
-
const SemVer = require_semver$1();
|
|
5165
|
-
const Range = require_range();
|
|
5166
|
-
const maxSatisfying = (versions, range, options) => {
|
|
5167
|
-
let max = null;
|
|
5168
|
-
let maxSV = null;
|
|
5169
|
-
let rangeObj = null;
|
|
5170
|
-
try {
|
|
5171
|
-
rangeObj = new Range(range, options);
|
|
5172
|
-
} catch (er) {
|
|
5173
|
-
return null;
|
|
5174
|
-
}
|
|
5175
|
-
versions.forEach((v) => {
|
|
5176
|
-
if (rangeObj.test(v)) {
|
|
5177
|
-
if (!max || maxSV.compare(v) === -1) {
|
|
5178
|
-
max = v;
|
|
5179
|
-
maxSV = new SemVer(max, options);
|
|
5180
|
-
}
|
|
5181
|
-
}
|
|
5182
|
-
});
|
|
5183
|
-
return max;
|
|
5184
|
-
};
|
|
5185
|
-
module.exports = maxSatisfying;
|
|
5186
|
-
}));
|
|
5187
|
-
var require_min_satisfying = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
5188
|
-
const SemVer = require_semver$1();
|
|
5189
|
-
const Range = require_range();
|
|
5190
|
-
const minSatisfying = (versions, range, options) => {
|
|
5191
|
-
let min = null;
|
|
5192
|
-
let minSV = null;
|
|
5193
|
-
let rangeObj = null;
|
|
5194
|
-
try {
|
|
5195
|
-
rangeObj = new Range(range, options);
|
|
5196
|
-
} catch (er) {
|
|
5197
|
-
return null;
|
|
3424
|
+
});
|
|
3425
|
+
}
|
|
3426
|
+
function expandComparator(comparator, options) {
|
|
3427
|
+
return replaceXRanges(replaceTildes(replaceCarets(comparator.replace(BUILD_SAFE, ""), options), options), options).trim().replace(STAR, "");
|
|
3428
|
+
}
|
|
3429
|
+
function parseSimpleRange(input, options) {
|
|
3430
|
+
let parts = replaceHyphenRange(input.replace(BUILD_STRIP, ""), options).replace(COMPARATOR_TRIM, "$1$2$3").replace(TILDE_TRIM, "$1~").replace(CARET_TRIM, "$1^").split(" ").map((part) => expandComparator(part, options)).join(" ").split(/\s+/).map((part) => part.trim().replace(options.includePrerelease ? GTE_ZERO_PRERELEASE : GTE_ZERO, ""));
|
|
3431
|
+
if (options.loose) parts = parts.filter((part) => LOOSE_COMPARATOR.test(part));
|
|
3432
|
+
const unique = /* @__PURE__ */ new Map();
|
|
3433
|
+
for (const comparator of parts.map((part) => parseComparator(part, options))) {
|
|
3434
|
+
if (comparator.value === "<0.0.0-0") return [comparator];
|
|
3435
|
+
unique.set(comparator.value, comparator);
|
|
3436
|
+
}
|
|
3437
|
+
if (unique.size > 1) unique.delete("");
|
|
3438
|
+
return [...unique.values()];
|
|
3439
|
+
}
|
|
3440
|
+
function parseRange(range, options = {}) {
|
|
3441
|
+
if (typeof range !== "string") return range;
|
|
3442
|
+
const parsedOptions = { ...options };
|
|
3443
|
+
const raw = range.trim().replaceAll(/\s+/g, " ");
|
|
3444
|
+
let sets = raw.split("||").map((part) => parseSimpleRange(part.trim(), parsedOptions)).filter((set) => set.length);
|
|
3445
|
+
if (!sets.length) throw new TypeError(`Range contains no valid comparator sets: ${raw}`);
|
|
3446
|
+
if (sets.length > 1) {
|
|
3447
|
+
const first = sets[0];
|
|
3448
|
+
sets = sets.filter((set) => set[0]?.value !== "<0.0.0-0");
|
|
3449
|
+
if (!sets.length) sets = [first];
|
|
3450
|
+
else if (sets.length > 1) {
|
|
3451
|
+
const any = sets.find((set) => set.length === 1 && set[0]?.value === "");
|
|
3452
|
+
if (any) sets = [any];
|
|
5198
3453
|
}
|
|
5199
|
-
|
|
5200
|
-
|
|
5201
|
-
|
|
5202
|
-
|
|
5203
|
-
|
|
5204
|
-
|
|
5205
|
-
}
|
|
5206
|
-
});
|
|
5207
|
-
return min;
|
|
3454
|
+
}
|
|
3455
|
+
return {
|
|
3456
|
+
normalized: sets.map((set) => set.map((comparator) => comparator.value).join(" ")).join("||"),
|
|
3457
|
+
options: parsedOptions,
|
|
3458
|
+
raw,
|
|
3459
|
+
sets
|
|
5208
3460
|
};
|
|
5209
|
-
|
|
5210
|
-
})
|
|
5211
|
-
|
|
5212
|
-
|
|
5213
|
-
|
|
5214
|
-
const gt = require_gt();
|
|
5215
|
-
const minVersion = (range, loose) => {
|
|
5216
|
-
range = new Range(range, loose);
|
|
5217
|
-
let minver = new SemVer("0.0.0");
|
|
5218
|
-
if (range.test(minver)) return minver;
|
|
5219
|
-
minver = new SemVer("0.0.0-0");
|
|
5220
|
-
if (range.test(minver)) return minver;
|
|
5221
|
-
minver = null;
|
|
5222
|
-
for (let i = 0; i < range.set.length; ++i) {
|
|
5223
|
-
const comparators = range.set[i];
|
|
5224
|
-
let setMin = null;
|
|
5225
|
-
comparators.forEach((comparator) => {
|
|
5226
|
-
const compver = new SemVer(comparator.semver.version);
|
|
5227
|
-
switch (comparator.operator) {
|
|
5228
|
-
case ">":
|
|
5229
|
-
if (compver.prerelease.length === 0) compver.patch++;
|
|
5230
|
-
else compver.prerelease.push(0);
|
|
5231
|
-
compver.raw = compver.format();
|
|
5232
|
-
case "":
|
|
5233
|
-
case ">=":
|
|
5234
|
-
if (!setMin || gt(compver, setMin)) setMin = compver;
|
|
5235
|
-
break;
|
|
5236
|
-
case "<":
|
|
5237
|
-
case "<=": break;
|
|
5238
|
-
default: throw new Error(`Unexpected operation: ${comparator.operator}`);
|
|
5239
|
-
}
|
|
5240
|
-
});
|
|
5241
|
-
if (setMin && (!minver || gt(minver, setMin))) minver = setMin;
|
|
5242
|
-
}
|
|
5243
|
-
if (minver && range.test(minver)) return minver;
|
|
3461
|
+
}
|
|
3462
|
+
function tryParseRange(range, options = {}) {
|
|
3463
|
+
try {
|
|
3464
|
+
return parseRange(range, options);
|
|
3465
|
+
} catch {
|
|
5244
3466
|
return null;
|
|
5245
|
-
}
|
|
5246
|
-
|
|
5247
|
-
|
|
5248
|
-
|
|
5249
|
-
|
|
5250
|
-
|
|
5251
|
-
|
|
5252
|
-
|
|
5253
|
-
|
|
5254
|
-
|
|
5255
|
-
|
|
5256
|
-
|
|
5257
|
-
|
|
5258
|
-
})
|
|
5259
|
-
|
|
5260
|
-
|
|
5261
|
-
|
|
5262
|
-
const { ANY } = Comparator;
|
|
5263
|
-
const Range = require_range();
|
|
5264
|
-
const satisfies = require_satisfies();
|
|
5265
|
-
const gt = require_gt();
|
|
5266
|
-
const lt = require_lt();
|
|
5267
|
-
const lte = require_lte();
|
|
5268
|
-
const gte = require_gte();
|
|
5269
|
-
const outside = (version, range, hilo, options) => {
|
|
5270
|
-
version = new SemVer(version, options);
|
|
5271
|
-
range = new Range(range, options);
|
|
5272
|
-
let gtfn, ltefn, ltfn, comp, ecomp;
|
|
5273
|
-
switch (hilo) {
|
|
5274
|
-
case ">":
|
|
5275
|
-
gtfn = gt;
|
|
5276
|
-
ltefn = lte;
|
|
5277
|
-
ltfn = lt;
|
|
5278
|
-
comp = ">";
|
|
5279
|
-
ecomp = ">=";
|
|
5280
|
-
break;
|
|
5281
|
-
case "<":
|
|
5282
|
-
gtfn = lt;
|
|
5283
|
-
ltefn = gte;
|
|
5284
|
-
ltfn = gt;
|
|
5285
|
-
comp = "<";
|
|
5286
|
-
ecomp = "<=";
|
|
5287
|
-
break;
|
|
5288
|
-
default: throw new TypeError("Must provide a hilo val of \"<\" or \">\"");
|
|
5289
|
-
}
|
|
5290
|
-
if (satisfies(version, range, options)) return false;
|
|
5291
|
-
for (let i = 0; i < range.set.length; ++i) {
|
|
5292
|
-
const comparators = range.set[i];
|
|
5293
|
-
let high = null;
|
|
5294
|
-
let low = null;
|
|
5295
|
-
comparators.forEach((comparator) => {
|
|
5296
|
-
if (comparator.semver === ANY) comparator = new Comparator(">=0.0.0");
|
|
5297
|
-
high = high || comparator;
|
|
5298
|
-
low = low || comparator;
|
|
5299
|
-
if (gtfn(comparator.semver, high.semver, options)) high = comparator;
|
|
5300
|
-
else if (ltfn(comparator.semver, low.semver, options)) low = comparator;
|
|
5301
|
-
});
|
|
5302
|
-
if (high.operator === comp || high.operator === ecomp) return false;
|
|
5303
|
-
if ((!low.operator || low.operator === comp) && ltefn(version, low.semver)) return false;
|
|
5304
|
-
else if (low.operator === ecomp && ltfn(version, low.semver)) return false;
|
|
5305
|
-
}
|
|
5306
|
-
return true;
|
|
5307
|
-
};
|
|
5308
|
-
module.exports = outside;
|
|
5309
|
-
}));
|
|
5310
|
-
var require_gtr = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
5311
|
-
const outside = require_outside();
|
|
5312
|
-
const gtr = (version, range, options) => outside(version, range, ">", options);
|
|
5313
|
-
module.exports = gtr;
|
|
5314
|
-
}));
|
|
5315
|
-
var require_ltr = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
5316
|
-
const outside = require_outside();
|
|
5317
|
-
const ltr = (version, range, options) => outside(version, range, "<", options);
|
|
5318
|
-
module.exports = ltr;
|
|
5319
|
-
}));
|
|
5320
|
-
var require_intersects = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
5321
|
-
const Range = require_range();
|
|
5322
|
-
const intersects = (r1, r2, options) => {
|
|
5323
|
-
r1 = new Range(r1, options);
|
|
5324
|
-
r2 = new Range(r2, options);
|
|
5325
|
-
return r1.intersects(r2, options);
|
|
5326
|
-
};
|
|
5327
|
-
module.exports = intersects;
|
|
5328
|
-
}));
|
|
5329
|
-
var require_simplify = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
5330
|
-
const satisfies = require_satisfies();
|
|
5331
|
-
const compare = require_compare();
|
|
5332
|
-
module.exports = (versions, range, options) => {
|
|
5333
|
-
const set = [];
|
|
5334
|
-
let first = null;
|
|
5335
|
-
let prev = null;
|
|
5336
|
-
const v = versions.sort((a, b) => compare(a, b, options));
|
|
5337
|
-
for (const version of v) if (satisfies(version, range, options)) {
|
|
5338
|
-
prev = version;
|
|
5339
|
-
if (!first) first = version;
|
|
5340
|
-
} else {
|
|
5341
|
-
if (prev) set.push([first, prev]);
|
|
5342
|
-
prev = null;
|
|
5343
|
-
first = null;
|
|
5344
|
-
}
|
|
5345
|
-
if (first) set.push([first, null]);
|
|
5346
|
-
const ranges = [];
|
|
5347
|
-
for (const [min, max] of set) if (min === max) ranges.push(min);
|
|
5348
|
-
else if (!max && min === v[0]) ranges.push("*");
|
|
5349
|
-
else if (!max) ranges.push(`>=${min}`);
|
|
5350
|
-
else if (min === v[0]) ranges.push(`<=${max}`);
|
|
5351
|
-
else ranges.push(`${min} - ${max}`);
|
|
5352
|
-
const simplified = ranges.join(" || ");
|
|
5353
|
-
const original = typeof range.raw === "string" ? range.raw : String(range);
|
|
5354
|
-
return simplified.length < original.length ? simplified : range;
|
|
5355
|
-
};
|
|
5356
|
-
}));
|
|
5357
|
-
var require_subset = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
5358
|
-
const Range = require_range();
|
|
5359
|
-
const Comparator = require_comparator();
|
|
5360
|
-
const { ANY } = Comparator;
|
|
5361
|
-
const satisfies = require_satisfies();
|
|
5362
|
-
const compare = require_compare();
|
|
5363
|
-
const subset = (sub, dom, options = {}) => {
|
|
5364
|
-
if (sub === dom) return true;
|
|
5365
|
-
sub = new Range(sub, options);
|
|
5366
|
-
dom = new Range(dom, options);
|
|
5367
|
-
let sawNonNull = false;
|
|
5368
|
-
OUTER: for (const simpleSub of sub.set) {
|
|
5369
|
-
for (const simpleDom of dom.set) {
|
|
5370
|
-
const isSub = simpleSubset(simpleSub, simpleDom, options);
|
|
5371
|
-
sawNonNull = sawNonNull || isSub !== null;
|
|
5372
|
-
if (isSub) continue OUTER;
|
|
5373
|
-
}
|
|
5374
|
-
if (sawNonNull) return false;
|
|
5375
|
-
}
|
|
5376
|
-
return true;
|
|
5377
|
-
};
|
|
5378
|
-
const minimumVersionWithPreRelease = [new Comparator(">=0.0.0-0")];
|
|
5379
|
-
const minimumVersion = [new Comparator(">=0.0.0")];
|
|
5380
|
-
const simpleSubset = (sub, dom, options) => {
|
|
5381
|
-
if (sub === dom) return true;
|
|
5382
|
-
if (sub.length === 1 && sub[0].semver === ANY) if (dom.length === 1 && dom[0].semver === ANY) return true;
|
|
5383
|
-
else if (options.includePrerelease) sub = minimumVersionWithPreRelease;
|
|
5384
|
-
else sub = minimumVersion;
|
|
5385
|
-
if (dom.length === 1 && dom[0].semver === ANY) if (options.includePrerelease) return true;
|
|
5386
|
-
else dom = minimumVersion;
|
|
5387
|
-
const eqSet = /* @__PURE__ */ new Set();
|
|
5388
|
-
let gt, lt;
|
|
5389
|
-
for (const c of sub) if (c.operator === ">" || c.operator === ">=") gt = higherGT(gt, c, options);
|
|
5390
|
-
else if (c.operator === "<" || c.operator === "<=") lt = lowerLT(lt, c, options);
|
|
5391
|
-
else eqSet.add(c.semver);
|
|
5392
|
-
if (eqSet.size > 1) return null;
|
|
5393
|
-
let gtltComp;
|
|
5394
|
-
if (gt && lt) {
|
|
5395
|
-
gtltComp = compare(gt.semver, lt.semver, options);
|
|
5396
|
-
if (gtltComp > 0) return null;
|
|
5397
|
-
else if (gtltComp === 0 && (gt.operator !== ">=" || lt.operator !== "<=")) return null;
|
|
5398
|
-
}
|
|
5399
|
-
for (const eq of eqSet) {
|
|
5400
|
-
if (gt && !satisfies(eq, String(gt), options)) return null;
|
|
5401
|
-
if (lt && !satisfies(eq, String(lt), options)) return null;
|
|
5402
|
-
for (const c of dom) if (!satisfies(eq, String(c), options)) return false;
|
|
5403
|
-
return true;
|
|
5404
|
-
}
|
|
5405
|
-
let higher, lower;
|
|
5406
|
-
let hasDomLT, hasDomGT;
|
|
5407
|
-
let needDomLTPre = lt && !options.includePrerelease && lt.semver.prerelease.length ? lt.semver : false;
|
|
5408
|
-
let needDomGTPre = gt && !options.includePrerelease && gt.semver.prerelease.length ? gt.semver : false;
|
|
5409
|
-
if (needDomLTPre && needDomLTPre.prerelease.length === 1 && lt.operator === "<" && needDomLTPre.prerelease[0] === 0) needDomLTPre = false;
|
|
5410
|
-
for (const c of dom) {
|
|
5411
|
-
hasDomGT = hasDomGT || c.operator === ">" || c.operator === ">=";
|
|
5412
|
-
hasDomLT = hasDomLT || c.operator === "<" || c.operator === "<=";
|
|
5413
|
-
if (gt) {
|
|
5414
|
-
if (needDomGTPre) {
|
|
5415
|
-
if (c.semver.prerelease && c.semver.prerelease.length && c.semver.major === needDomGTPre.major && c.semver.minor === needDomGTPre.minor && c.semver.patch === needDomGTPre.patch) needDomGTPre = false;
|
|
5416
|
-
}
|
|
5417
|
-
if (c.operator === ">" || c.operator === ">=") {
|
|
5418
|
-
higher = higherGT(gt, c, options);
|
|
5419
|
-
if (higher === c && higher !== gt) return false;
|
|
5420
|
-
} else if (gt.operator === ">=" && !c.test(gt.semver)) return false;
|
|
5421
|
-
}
|
|
5422
|
-
if (lt) {
|
|
5423
|
-
if (needDomLTPre) {
|
|
5424
|
-
if (c.semver.prerelease && c.semver.prerelease.length && c.semver.major === needDomLTPre.major && c.semver.minor === needDomLTPre.minor && c.semver.patch === needDomLTPre.patch) needDomLTPre = false;
|
|
5425
|
-
}
|
|
5426
|
-
if (c.operator === "<" || c.operator === "<=") {
|
|
5427
|
-
lower = lowerLT(lt, c, options);
|
|
5428
|
-
if (lower === c && lower !== lt) return false;
|
|
5429
|
-
} else if (lt.operator === "<=" && !c.test(lt.semver)) return false;
|
|
5430
|
-
}
|
|
5431
|
-
if (!c.operator && (lt || gt) && gtltComp !== 0) return false;
|
|
5432
|
-
}
|
|
5433
|
-
if (gt && hasDomLT && !lt && gtltComp !== 0) return false;
|
|
5434
|
-
if (lt && hasDomGT && !gt && gtltComp !== 0) return false;
|
|
5435
|
-
if (needDomGTPre || needDomLTPre) return false;
|
|
5436
|
-
return true;
|
|
5437
|
-
};
|
|
5438
|
-
const higherGT = (a, b, options) => {
|
|
5439
|
-
if (!a) return b;
|
|
5440
|
-
const comp = compare(a.semver, b.semver, options);
|
|
5441
|
-
return comp > 0 ? a : comp < 0 ? b : b.operator === ">" && a.operator === ">=" ? b : a;
|
|
5442
|
-
};
|
|
5443
|
-
const lowerLT = (a, b, options) => {
|
|
5444
|
-
if (!a) return b;
|
|
5445
|
-
const comp = compare(a.semver, b.semver, options);
|
|
5446
|
-
return comp < 0 ? a : comp > 0 ? b : b.operator === "<" && a.operator === "<=" ? b : a;
|
|
5447
|
-
};
|
|
5448
|
-
module.exports = subset;
|
|
5449
|
-
}));
|
|
5450
|
-
var import_semver = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
5451
|
-
const internalRe = require_re();
|
|
5452
|
-
const constants = require_constants();
|
|
5453
|
-
const SemVer = require_semver$1();
|
|
5454
|
-
const identifiers = require_identifiers();
|
|
5455
|
-
module.exports = {
|
|
5456
|
-
parse: require_parse(),
|
|
5457
|
-
valid: require_valid$1(),
|
|
5458
|
-
clean: require_clean(),
|
|
5459
|
-
inc: require_inc(),
|
|
5460
|
-
diff: require_diff(),
|
|
5461
|
-
major: require_major(),
|
|
5462
|
-
minor: require_minor(),
|
|
5463
|
-
patch: require_patch(),
|
|
5464
|
-
prerelease: require_prerelease(),
|
|
5465
|
-
compare: require_compare(),
|
|
5466
|
-
rcompare: require_rcompare(),
|
|
5467
|
-
compareLoose: require_compare_loose(),
|
|
5468
|
-
compareBuild: require_compare_build(),
|
|
5469
|
-
sort: require_sort(),
|
|
5470
|
-
rsort: require_rsort(),
|
|
5471
|
-
gt: require_gt(),
|
|
5472
|
-
lt: require_lt(),
|
|
5473
|
-
eq: require_eq(),
|
|
5474
|
-
neq: require_neq(),
|
|
5475
|
-
gte: require_gte(),
|
|
5476
|
-
lte: require_lte(),
|
|
5477
|
-
cmp: require_cmp(),
|
|
5478
|
-
coerce: require_coerce(),
|
|
5479
|
-
truncate: require_truncate(),
|
|
5480
|
-
Comparator: require_comparator(),
|
|
5481
|
-
Range: require_range(),
|
|
5482
|
-
satisfies: require_satisfies(),
|
|
5483
|
-
toComparators: require_to_comparators(),
|
|
5484
|
-
maxSatisfying: require_max_satisfying(),
|
|
5485
|
-
minSatisfying: require_min_satisfying(),
|
|
5486
|
-
minVersion: require_min_version(),
|
|
5487
|
-
validRange: require_valid(),
|
|
5488
|
-
outside: require_outside(),
|
|
5489
|
-
gtr: require_gtr(),
|
|
5490
|
-
ltr: require_ltr(),
|
|
5491
|
-
intersects: require_intersects(),
|
|
5492
|
-
simplifyRange: require_simplify(),
|
|
5493
|
-
subset: require_subset(),
|
|
5494
|
-
SemVer,
|
|
5495
|
-
re: internalRe.re,
|
|
5496
|
-
src: internalRe.src,
|
|
5497
|
-
tokens: internalRe.t,
|
|
5498
|
-
SEMVER_SPEC_VERSION: constants.SEMVER_SPEC_VERSION,
|
|
5499
|
-
RELEASE_TYPES: constants.RELEASE_TYPES,
|
|
5500
|
-
compareIdentifiers: identifiers.compareIdentifiers,
|
|
5501
|
-
rcompareIdentifiers: identifiers.rcompareIdentifiers
|
|
5502
|
-
};
|
|
5503
|
-
})))(), 1);
|
|
3467
|
+
}
|
|
3468
|
+
}
|
|
3469
|
+
function testParsedRange(range, version) {
|
|
3470
|
+
return range.sets.some((set) => testComparatorSet(set, version, range.options));
|
|
3471
|
+
}
|
|
3472
|
+
function testRangeVersion(range, version) {
|
|
3473
|
+
const parsed = tryParse(version, range.options);
|
|
3474
|
+
return parsed ? testParsedRange(range, parsed) : false;
|
|
3475
|
+
}
|
|
3476
|
+
function satisfies(version, range, options = {}) {
|
|
3477
|
+
const parsed = tryParseRange(range, options);
|
|
3478
|
+
return parsed ? testRangeVersion(parsed, version) : false;
|
|
3479
|
+
}
|
|
3480
|
+
function coerce(value, options = {}) {
|
|
3481
|
+
const parsed = coerceParsedVersion(value, options);
|
|
3482
|
+
return parsed ? formatFullVersion(parsed) : null;
|
|
3483
|
+
}
|
|
5504
3484
|
const semverSatisfies = (targetAppVersion, currentVersion) => {
|
|
5505
|
-
const currentCoerce =
|
|
3485
|
+
const currentCoerce = coerce(currentVersion);
|
|
5506
3486
|
if (!currentCoerce) return false;
|
|
5507
|
-
return
|
|
3487
|
+
return satisfies(currentCoerce, targetAppVersion);
|
|
5508
3488
|
};
|
|
5509
3489
|
const INIT_BUNDLE_ROLLBACK_UPDATE_INFO$1 = {
|
|
5510
3490
|
message: null,
|
|
@@ -5647,7 +3627,7 @@ function isExactVersion(version) {
|
|
|
5647
3627
|
if (!version) return false;
|
|
5648
3628
|
const normalized = normalizeTargetAppVersion(version);
|
|
5649
3629
|
if (!normalized) return false;
|
|
5650
|
-
return
|
|
3630
|
+
return normalize(normalized) !== null;
|
|
5651
3631
|
}
|
|
5652
3632
|
/**
|
|
5653
3633
|
* Get all normalized semver versions for a version string.
|
|
@@ -5660,12 +3640,13 @@ function isExactVersion(version) {
|
|
|
5660
3640
|
*/
|
|
5661
3641
|
function getSemverNormalizedVersions(version) {
|
|
5662
3642
|
const normalized = normalizeTargetAppVersion(version) || version;
|
|
5663
|
-
const coerced =
|
|
3643
|
+
const coerced = coerce$1(normalized);
|
|
5664
3644
|
if (!coerced) return [normalized];
|
|
3645
|
+
const { major, minor, patch } = parse$1(coerced);
|
|
5665
3646
|
const versions = /* @__PURE__ */ new Set();
|
|
5666
|
-
versions.add(coerced
|
|
5667
|
-
if (
|
|
5668
|
-
if (
|
|
3647
|
+
versions.add(coerced);
|
|
3648
|
+
if (patch === 0) versions.add(`${major}.${minor}`);
|
|
3649
|
+
if (minor === 0 && patch === 0) versions.add(`${major}`);
|
|
5669
3650
|
return Array.from(versions);
|
|
5670
3651
|
}
|
|
5671
3652
|
function resolveStorageTarget({ targetAppVersion, fingerprintHash }) {
|