react-doctor 0.9.12 → 0.9.13-dev.1239043
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +34 -1
- package/bin/react-doctor.js +1 -9
- package/dist/active-run-trace-dlIZeEvb.js +18 -0
- package/dist/active-scan-abort-registry-DwG6tSPy.js +28 -0
- package/dist/{build-section-divider-BsQvH-7I.js → build-section-divider-C09RcJrc.js} +10 -25
- package/dist/{ci-B4x4RjKD.js → ci-CUgNjCr-.js} +13 -12
- package/dist/cli.js +121 -41
- package/dist/{design-A48PNCf_.js → design-CX2j8ubS.js} +4 -4
- package/dist/{devtools-DPRVRu3S.js → devtools-CC2PAZ85.js} +4 -4
- package/dist/{exit-gracefully-Bk531kS-.js → exit-gracefully-cGJM2g3O.js} +15 -9
- package/dist/get-east-asian-width-Bv2TD3Xj.js +444 -0
- package/dist/{report-error-Pb2uO8EG.js → handle-error-BCI-Nv3P.js} +18 -68
- package/dist/index.d.ts +53 -42
- package/dist/index.js +55146 -54688
- package/dist/{inspect-CwH84aSA.js → inspect-Dq5krKWG.js} +47 -34
- package/dist/{install-sFN_w425.js → install-C0aiZKgf.js} +9 -8
- package/dist/{install-doctor-script-DLayXS7q.js → install-doctor-script-CaTIms0r.js} +7 -449
- package/dist/{install-github-workflow-Goz-KFqb.js → install-github-workflow-DjPgXVqg.js} +10 -6
- package/dist/{install-react-doctor-Bq7dfEBI.js → install-react-doctor-C-PVDWXv.js} +47 -45
- package/dist/{run-scan-app-DXBMW54J.js → jsx-runtime-D_A4d39v.js} +281 -2759
- package/dist/path-format-DnHpmJwG.js +9 -0
- package/dist/{print-branded-header-D_J8Qdsj.js → print-branded-header-Dz0SwyHQ.js} +4 -4
- package/dist/project-analysis-worker.d.ts +1 -0
- package/dist/project-analysis-worker.js +51905 -0
- package/dist/prompt-runtime-scan-url-BXdY2Opw.js +240 -0
- package/dist/{read-object-file-Hk79zI91.js → read-object-file-CmMGK1uu.js} +4 -4
- package/dist/{record-metric-CsQXJewH.js → record-metric-B6T_Ej33.js} +3285 -6018
- package/dist/report-error-DwL3b99q.js +64 -0
- package/dist/{report-workflow-result-6n_wSqzA.js → report-workflow-result-5PueDIAr.js} +5 -5
- package/dist/{resolve-scope-DP6rYlNO.js → resolve-scope-CTlLl7e6.js} +8 -10
- package/dist/{rules-BnIZ4Fq_.js → rules-DEbHKRag.js} +6 -6
- package/dist/run-scan-app-D3huvmXJ.js +2517 -0
- package/dist/runtime-scan/browser-probe.iife.js +855 -0
- package/dist/runtime-scan-CHFAEYg3.js +770 -0
- package/dist/sanitize-runtime-url-Bbq40iIp.js +76 -0
- package/dist/scan-C7sCm7wi.js +47 -0
- package/dist/semver-DFtnEmN-.js +3219 -0
- package/dist/{should-fail-scan-gate-DzZuTxim.js → should-fail-scan-gate-CfG_ppAV.js} +188 -187
- package/dist/{should-skip-prompts-D1GWG2qN.js → should-skip-prompts-BuNtAVEs.js} +4 -4
- package/dist/should-use-tui-B-lCjXVG.js +25 -0
- package/dist/skills/improve-threejs/SKILL.md +102 -0
- package/dist/skills/performance/SKILL.md +113 -0
- package/dist/skills/react-doctor/SKILL.md +6 -0
- package/dist/{unref-stdin-0a_0uwC6.js → telemetry-runtime-BF83aBFL.js} +57 -33
- package/dist/unref-stdin-SK3WfwxS.js +12 -0
- package/dist/{version-Bo5QDp7F.js → version-C27gr4Qj.js} +4 -4
- package/dist/{why-BFYbtnm8.js → why-CYRkZ2VY.js} +4 -4
- package/dist/with-run-span-CdsXSJgE.js +110 -0
- package/package.json +9 -10
- package/dist/chunk-q7NCDQ7-.js +0 -28
- package/dist/lsp.js +0 -81145
- package/dist/scan-CnnXz78m.js +0 -53
|
@@ -0,0 +1,3219 @@
|
|
|
1
|
+
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="901ba4e5-e2df-5352-b388-d03a653e9bde")}catch(e){}}();
|
|
3
|
+
import { t as __commonJSMin } from "./chunk-ChKA3wi6.js";
|
|
4
|
+
//#region ../../node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/lib/constants.js
|
|
5
|
+
var require_constants$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
6
|
+
const WIN_SLASH = "\\\\/";
|
|
7
|
+
const WIN_NO_SLASH = `[^${WIN_SLASH}]`;
|
|
8
|
+
const DEFAULT_MAX_EXTGLOB_RECURSION = 0;
|
|
9
|
+
/**
|
|
10
|
+
* Posix glob regex
|
|
11
|
+
*/
|
|
12
|
+
const DOT_LITERAL = "\\.";
|
|
13
|
+
const PLUS_LITERAL = "\\+";
|
|
14
|
+
const QMARK_LITERAL = "\\?";
|
|
15
|
+
const SLASH_LITERAL = "\\/";
|
|
16
|
+
const ONE_CHAR = "(?=.)";
|
|
17
|
+
const QMARK = "[^/]";
|
|
18
|
+
const END_ANCHOR = `(?:${SLASH_LITERAL}|$)`;
|
|
19
|
+
const START_ANCHOR = `(?:^|${SLASH_LITERAL})`;
|
|
20
|
+
const DOTS_SLASH = `${DOT_LITERAL}{1,2}${END_ANCHOR}`;
|
|
21
|
+
const POSIX_CHARS = {
|
|
22
|
+
DOT_LITERAL,
|
|
23
|
+
PLUS_LITERAL,
|
|
24
|
+
QMARK_LITERAL,
|
|
25
|
+
SLASH_LITERAL,
|
|
26
|
+
ONE_CHAR,
|
|
27
|
+
QMARK,
|
|
28
|
+
END_ANCHOR,
|
|
29
|
+
DOTS_SLASH,
|
|
30
|
+
NO_DOT: `(?!${DOT_LITERAL})`,
|
|
31
|
+
NO_DOTS: `(?!${START_ANCHOR}${DOTS_SLASH})`,
|
|
32
|
+
NO_DOT_SLASH: `(?!${DOT_LITERAL}{0,1}${END_ANCHOR})`,
|
|
33
|
+
NO_DOTS_SLASH: `(?!${DOTS_SLASH})`,
|
|
34
|
+
QMARK_NO_DOT: `[^.${SLASH_LITERAL}]`,
|
|
35
|
+
STAR: `${QMARK}*?`,
|
|
36
|
+
START_ANCHOR,
|
|
37
|
+
SEP: "/"
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* Windows glob regex
|
|
41
|
+
*/
|
|
42
|
+
const WINDOWS_CHARS = {
|
|
43
|
+
...POSIX_CHARS,
|
|
44
|
+
SLASH_LITERAL: `[${WIN_SLASH}]`,
|
|
45
|
+
QMARK: WIN_NO_SLASH,
|
|
46
|
+
STAR: `${WIN_NO_SLASH}*?`,
|
|
47
|
+
DOTS_SLASH: `${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$)`,
|
|
48
|
+
NO_DOT: `(?!${DOT_LITERAL})`,
|
|
49
|
+
NO_DOTS: `(?!(?:^|[${WIN_SLASH}])${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,
|
|
50
|
+
NO_DOT_SLASH: `(?!${DOT_LITERAL}{0,1}(?:[${WIN_SLASH}]|$))`,
|
|
51
|
+
NO_DOTS_SLASH: `(?!${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,
|
|
52
|
+
QMARK_NO_DOT: `[^.${WIN_SLASH}]`,
|
|
53
|
+
START_ANCHOR: `(?:^|[${WIN_SLASH}])`,
|
|
54
|
+
END_ANCHOR: `(?:[${WIN_SLASH}]|$)`,
|
|
55
|
+
SEP: "\\"
|
|
56
|
+
};
|
|
57
|
+
module.exports = {
|
|
58
|
+
DEFAULT_MAX_EXTGLOB_RECURSION,
|
|
59
|
+
MAX_LENGTH: 1024 * 64,
|
|
60
|
+
POSIX_REGEX_SOURCE: {
|
|
61
|
+
__proto__: null,
|
|
62
|
+
alnum: "a-zA-Z0-9",
|
|
63
|
+
alpha: "a-zA-Z",
|
|
64
|
+
ascii: "\\x00-\\x7F",
|
|
65
|
+
blank: " \\t",
|
|
66
|
+
cntrl: "\\x00-\\x1F\\x7F",
|
|
67
|
+
digit: "0-9",
|
|
68
|
+
graph: "\\x21-\\x7E",
|
|
69
|
+
lower: "a-z",
|
|
70
|
+
print: "\\x20-\\x7E ",
|
|
71
|
+
punct: "\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",
|
|
72
|
+
space: " \\t\\r\\n\\v\\f",
|
|
73
|
+
upper: "A-Z",
|
|
74
|
+
word: "A-Za-z0-9_",
|
|
75
|
+
xdigit: "A-Fa-f0-9"
|
|
76
|
+
},
|
|
77
|
+
REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g,
|
|
78
|
+
REGEX_NON_SPECIAL_CHARS: /^[^@![\].,$*+?^{}()|\\/]+/,
|
|
79
|
+
REGEX_SPECIAL_CHARS: /[-*+?.^${}(|)[\]]/,
|
|
80
|
+
REGEX_SPECIAL_CHARS_BACKREF: /(\\?)((\W)(\3*))/g,
|
|
81
|
+
REGEX_SPECIAL_CHARS_GLOBAL: /([-*+?.^${}(|)[\]])/g,
|
|
82
|
+
REGEX_REMOVE_BACKSLASH: /(?:\[.*?[^\\]\]|\\(?=.))/g,
|
|
83
|
+
REPLACEMENTS: {
|
|
84
|
+
__proto__: null,
|
|
85
|
+
"***": "*",
|
|
86
|
+
"**/**": "**",
|
|
87
|
+
"**/**/**": "**"
|
|
88
|
+
},
|
|
89
|
+
CHAR_0: 48,
|
|
90
|
+
CHAR_9: 57,
|
|
91
|
+
CHAR_UPPERCASE_A: 65,
|
|
92
|
+
CHAR_LOWERCASE_A: 97,
|
|
93
|
+
CHAR_UPPERCASE_Z: 90,
|
|
94
|
+
CHAR_LOWERCASE_Z: 122,
|
|
95
|
+
CHAR_LEFT_PARENTHESES: 40,
|
|
96
|
+
CHAR_RIGHT_PARENTHESES: 41,
|
|
97
|
+
CHAR_ASTERISK: 42,
|
|
98
|
+
CHAR_AMPERSAND: 38,
|
|
99
|
+
CHAR_AT: 64,
|
|
100
|
+
CHAR_BACKWARD_SLASH: 92,
|
|
101
|
+
CHAR_CARRIAGE_RETURN: 13,
|
|
102
|
+
CHAR_CIRCUMFLEX_ACCENT: 94,
|
|
103
|
+
CHAR_COLON: 58,
|
|
104
|
+
CHAR_COMMA: 44,
|
|
105
|
+
CHAR_DOT: 46,
|
|
106
|
+
CHAR_DOUBLE_QUOTE: 34,
|
|
107
|
+
CHAR_EQUAL: 61,
|
|
108
|
+
CHAR_EXCLAMATION_MARK: 33,
|
|
109
|
+
CHAR_FORM_FEED: 12,
|
|
110
|
+
CHAR_FORWARD_SLASH: 47,
|
|
111
|
+
CHAR_GRAVE_ACCENT: 96,
|
|
112
|
+
CHAR_HASH: 35,
|
|
113
|
+
CHAR_HYPHEN_MINUS: 45,
|
|
114
|
+
CHAR_LEFT_ANGLE_BRACKET: 60,
|
|
115
|
+
CHAR_LEFT_CURLY_BRACE: 123,
|
|
116
|
+
CHAR_LEFT_SQUARE_BRACKET: 91,
|
|
117
|
+
CHAR_LINE_FEED: 10,
|
|
118
|
+
CHAR_NO_BREAK_SPACE: 160,
|
|
119
|
+
CHAR_PERCENT: 37,
|
|
120
|
+
CHAR_PLUS: 43,
|
|
121
|
+
CHAR_QUESTION_MARK: 63,
|
|
122
|
+
CHAR_RIGHT_ANGLE_BRACKET: 62,
|
|
123
|
+
CHAR_RIGHT_CURLY_BRACE: 125,
|
|
124
|
+
CHAR_RIGHT_SQUARE_BRACKET: 93,
|
|
125
|
+
CHAR_SEMICOLON: 59,
|
|
126
|
+
CHAR_SINGLE_QUOTE: 39,
|
|
127
|
+
CHAR_SPACE: 32,
|
|
128
|
+
CHAR_TAB: 9,
|
|
129
|
+
CHAR_UNDERSCORE: 95,
|
|
130
|
+
CHAR_VERTICAL_LINE: 124,
|
|
131
|
+
CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279,
|
|
132
|
+
/**
|
|
133
|
+
* Create EXTGLOB_CHARS
|
|
134
|
+
*/
|
|
135
|
+
extglobChars(chars) {
|
|
136
|
+
return {
|
|
137
|
+
"!": {
|
|
138
|
+
type: "negate",
|
|
139
|
+
open: "(?:(?!(?:",
|
|
140
|
+
close: `))${chars.STAR})`
|
|
141
|
+
},
|
|
142
|
+
"?": {
|
|
143
|
+
type: "qmark",
|
|
144
|
+
open: "(?:",
|
|
145
|
+
close: ")?"
|
|
146
|
+
},
|
|
147
|
+
"+": {
|
|
148
|
+
type: "plus",
|
|
149
|
+
open: "(?:",
|
|
150
|
+
close: ")+"
|
|
151
|
+
},
|
|
152
|
+
"*": {
|
|
153
|
+
type: "star",
|
|
154
|
+
open: "(?:",
|
|
155
|
+
close: ")*"
|
|
156
|
+
},
|
|
157
|
+
"@": {
|
|
158
|
+
type: "at",
|
|
159
|
+
open: "(?:",
|
|
160
|
+
close: ")"
|
|
161
|
+
}
|
|
162
|
+
};
|
|
163
|
+
},
|
|
164
|
+
/**
|
|
165
|
+
* Create GLOB_CHARS
|
|
166
|
+
*/
|
|
167
|
+
globChars(win32) {
|
|
168
|
+
return win32 === true ? WINDOWS_CHARS : POSIX_CHARS;
|
|
169
|
+
}
|
|
170
|
+
};
|
|
171
|
+
}));
|
|
172
|
+
//#endregion
|
|
173
|
+
//#region ../../node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/lib/utils.js
|
|
174
|
+
var require_utils = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
175
|
+
const { REGEX_BACKSLASH, REGEX_REMOVE_BACKSLASH, REGEX_SPECIAL_CHARS, REGEX_SPECIAL_CHARS_GLOBAL } = require_constants$1();
|
|
176
|
+
exports.isObject = (val) => val !== null && typeof val === "object" && !Array.isArray(val);
|
|
177
|
+
exports.hasRegexChars = (str) => REGEX_SPECIAL_CHARS.test(str);
|
|
178
|
+
exports.isRegexChar = (str) => str.length === 1 && exports.hasRegexChars(str);
|
|
179
|
+
exports.escapeRegex = (str) => str.replace(REGEX_SPECIAL_CHARS_GLOBAL, "\\$1");
|
|
180
|
+
exports.toPosixSlashes = (str) => str.replace(REGEX_BACKSLASH, "/");
|
|
181
|
+
exports.isWindows = () => {
|
|
182
|
+
if (typeof navigator !== "undefined" && navigator.platform) {
|
|
183
|
+
const platform = navigator.platform.toLowerCase();
|
|
184
|
+
return platform === "win32" || platform === "windows";
|
|
185
|
+
}
|
|
186
|
+
if (typeof process !== "undefined" && process.platform) return process.platform === "win32";
|
|
187
|
+
return false;
|
|
188
|
+
};
|
|
189
|
+
exports.removeBackslashes = (str) => {
|
|
190
|
+
return str.replace(REGEX_REMOVE_BACKSLASH, (match) => {
|
|
191
|
+
return match === "\\" ? "" : match;
|
|
192
|
+
});
|
|
193
|
+
};
|
|
194
|
+
exports.escapeLast = (input, char, lastIdx) => {
|
|
195
|
+
const idx = input.lastIndexOf(char, lastIdx);
|
|
196
|
+
if (idx === -1) return input;
|
|
197
|
+
if (input[idx - 1] === "\\") return exports.escapeLast(input, char, idx - 1);
|
|
198
|
+
return `${input.slice(0, idx)}\\${input.slice(idx)}`;
|
|
199
|
+
};
|
|
200
|
+
exports.removePrefix = (input, state = {}) => {
|
|
201
|
+
let output = input;
|
|
202
|
+
if (output.startsWith("./")) {
|
|
203
|
+
output = output.slice(2);
|
|
204
|
+
state.prefix = "./";
|
|
205
|
+
}
|
|
206
|
+
return output;
|
|
207
|
+
};
|
|
208
|
+
exports.wrapOutput = (input, state = {}, options = {}) => {
|
|
209
|
+
let output = `${options.contains ? "" : "^"}(?:${input})${options.contains ? "" : "$"}`;
|
|
210
|
+
if (state.negated === true) output = `(?:^(?!${output}).*$)`;
|
|
211
|
+
return output;
|
|
212
|
+
};
|
|
213
|
+
exports.basename = (path, { windows } = {}) => {
|
|
214
|
+
const segs = path.split(windows ? /[\\/]/ : "/");
|
|
215
|
+
const last = segs[segs.length - 1];
|
|
216
|
+
if (last === "") return segs[segs.length - 2];
|
|
217
|
+
return last;
|
|
218
|
+
};
|
|
219
|
+
}));
|
|
220
|
+
//#endregion
|
|
221
|
+
//#region ../../node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/lib/scan.js
|
|
222
|
+
var require_scan = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
223
|
+
const utils = require_utils();
|
|
224
|
+
const { CHAR_ASTERISK, CHAR_AT, CHAR_BACKWARD_SLASH, CHAR_COMMA, CHAR_DOT, CHAR_EXCLAMATION_MARK, CHAR_FORWARD_SLASH, CHAR_LEFT_CURLY_BRACE, CHAR_LEFT_PARENTHESES, CHAR_LEFT_SQUARE_BRACKET, CHAR_PLUS, CHAR_QUESTION_MARK, CHAR_RIGHT_CURLY_BRACE, CHAR_RIGHT_PARENTHESES, CHAR_RIGHT_SQUARE_BRACKET } = require_constants$1();
|
|
225
|
+
const isPathSeparator = (code) => {
|
|
226
|
+
return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH;
|
|
227
|
+
};
|
|
228
|
+
const depth = (token) => {
|
|
229
|
+
if (token.isPrefix !== true) token.depth = token.isGlobstar ? Infinity : 1;
|
|
230
|
+
};
|
|
231
|
+
/**
|
|
232
|
+
* Quickly scans a glob pattern and returns an object with a handful of
|
|
233
|
+
* useful properties, like `isGlob`, `path` (the leading non-glob, if it exists),
|
|
234
|
+
* `glob` (the actual pattern), `negated` (true if the path starts with `!` but not
|
|
235
|
+
* with `!(`) and `negatedExtglob` (true if the path starts with `!(`).
|
|
236
|
+
*
|
|
237
|
+
* ```js
|
|
238
|
+
* const pm = require('picomatch');
|
|
239
|
+
* console.log(pm.scan('foo/bar/*.js'));
|
|
240
|
+
* { isGlob: true, input: 'foo/bar/*.js', base: 'foo/bar', glob: '*.js' }
|
|
241
|
+
* ```
|
|
242
|
+
* @param {String} `str`
|
|
243
|
+
* @param {Object} `options`
|
|
244
|
+
* @return {Object} Returns an object with tokens and regex source string.
|
|
245
|
+
* @api public
|
|
246
|
+
*/
|
|
247
|
+
const scan = (input, options) => {
|
|
248
|
+
const opts = options || {};
|
|
249
|
+
const length = input.length - 1;
|
|
250
|
+
const scanToEnd = opts.parts === true || opts.scanToEnd === true;
|
|
251
|
+
const slashes = [];
|
|
252
|
+
const tokens = [];
|
|
253
|
+
const parts = [];
|
|
254
|
+
let str = input;
|
|
255
|
+
let index = -1;
|
|
256
|
+
let start = 0;
|
|
257
|
+
let lastIndex = 0;
|
|
258
|
+
let isBrace = false;
|
|
259
|
+
let isBracket = false;
|
|
260
|
+
let isGlob = false;
|
|
261
|
+
let isExtglob = false;
|
|
262
|
+
let isGlobstar = false;
|
|
263
|
+
let braceEscaped = false;
|
|
264
|
+
let backslashes = false;
|
|
265
|
+
let negated = false;
|
|
266
|
+
let negatedExtglob = false;
|
|
267
|
+
let finished = false;
|
|
268
|
+
let braces = 0;
|
|
269
|
+
let prev;
|
|
270
|
+
let code;
|
|
271
|
+
let token = {
|
|
272
|
+
value: "",
|
|
273
|
+
depth: 0,
|
|
274
|
+
isGlob: false
|
|
275
|
+
};
|
|
276
|
+
const eos = () => index >= length;
|
|
277
|
+
const peek = () => str.charCodeAt(index + 1);
|
|
278
|
+
const advance = () => {
|
|
279
|
+
prev = code;
|
|
280
|
+
return str.charCodeAt(++index);
|
|
281
|
+
};
|
|
282
|
+
while (index < length) {
|
|
283
|
+
code = advance();
|
|
284
|
+
let next;
|
|
285
|
+
if (code === CHAR_BACKWARD_SLASH) {
|
|
286
|
+
backslashes = token.backslashes = true;
|
|
287
|
+
code = advance();
|
|
288
|
+
if (code === CHAR_LEFT_CURLY_BRACE) braceEscaped = true;
|
|
289
|
+
continue;
|
|
290
|
+
}
|
|
291
|
+
if (braceEscaped === true || code === CHAR_LEFT_CURLY_BRACE) {
|
|
292
|
+
braces++;
|
|
293
|
+
while (eos() !== true && (code = advance())) {
|
|
294
|
+
if (code === CHAR_BACKWARD_SLASH) {
|
|
295
|
+
backslashes = token.backslashes = true;
|
|
296
|
+
advance();
|
|
297
|
+
continue;
|
|
298
|
+
}
|
|
299
|
+
if (code === CHAR_LEFT_CURLY_BRACE) {
|
|
300
|
+
braces++;
|
|
301
|
+
continue;
|
|
302
|
+
}
|
|
303
|
+
if (braceEscaped !== true && code === CHAR_DOT && (code = advance()) === CHAR_DOT) {
|
|
304
|
+
isBrace = token.isBrace = true;
|
|
305
|
+
isGlob = token.isGlob = true;
|
|
306
|
+
finished = true;
|
|
307
|
+
if (scanToEnd === true) continue;
|
|
308
|
+
break;
|
|
309
|
+
}
|
|
310
|
+
if (braceEscaped !== true && code === CHAR_COMMA) {
|
|
311
|
+
isBrace = token.isBrace = true;
|
|
312
|
+
isGlob = token.isGlob = true;
|
|
313
|
+
finished = true;
|
|
314
|
+
if (scanToEnd === true) continue;
|
|
315
|
+
break;
|
|
316
|
+
}
|
|
317
|
+
if (code === CHAR_RIGHT_CURLY_BRACE) {
|
|
318
|
+
braces--;
|
|
319
|
+
if (braces === 0) {
|
|
320
|
+
braceEscaped = false;
|
|
321
|
+
isBrace = token.isBrace = true;
|
|
322
|
+
finished = true;
|
|
323
|
+
break;
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
if (scanToEnd === true) continue;
|
|
328
|
+
break;
|
|
329
|
+
}
|
|
330
|
+
if (code === CHAR_FORWARD_SLASH) {
|
|
331
|
+
slashes.push(index);
|
|
332
|
+
tokens.push(token);
|
|
333
|
+
token = {
|
|
334
|
+
value: "",
|
|
335
|
+
depth: 0,
|
|
336
|
+
isGlob: false
|
|
337
|
+
};
|
|
338
|
+
if (finished === true) continue;
|
|
339
|
+
if (prev === CHAR_DOT && index === start + 1) {
|
|
340
|
+
start += 2;
|
|
341
|
+
continue;
|
|
342
|
+
}
|
|
343
|
+
lastIndex = index + 1;
|
|
344
|
+
continue;
|
|
345
|
+
}
|
|
346
|
+
if (opts.noext !== true) {
|
|
347
|
+
if ((code === CHAR_PLUS || code === CHAR_AT || code === CHAR_ASTERISK || code === CHAR_QUESTION_MARK || code === CHAR_EXCLAMATION_MARK) === true && peek() === CHAR_LEFT_PARENTHESES) {
|
|
348
|
+
isGlob = token.isGlob = true;
|
|
349
|
+
isExtglob = token.isExtglob = true;
|
|
350
|
+
finished = true;
|
|
351
|
+
if (code === CHAR_EXCLAMATION_MARK && index === start) negatedExtglob = true;
|
|
352
|
+
if (scanToEnd === true) {
|
|
353
|
+
while (eos() !== true && (code = advance())) {
|
|
354
|
+
if (code === CHAR_BACKWARD_SLASH) {
|
|
355
|
+
backslashes = token.backslashes = true;
|
|
356
|
+
code = advance();
|
|
357
|
+
continue;
|
|
358
|
+
}
|
|
359
|
+
if (code === CHAR_RIGHT_PARENTHESES) {
|
|
360
|
+
isGlob = token.isGlob = true;
|
|
361
|
+
finished = true;
|
|
362
|
+
break;
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
continue;
|
|
366
|
+
}
|
|
367
|
+
break;
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
if (code === CHAR_ASTERISK) {
|
|
371
|
+
if (prev === CHAR_ASTERISK) isGlobstar = token.isGlobstar = true;
|
|
372
|
+
isGlob = token.isGlob = true;
|
|
373
|
+
finished = true;
|
|
374
|
+
if (scanToEnd === true) continue;
|
|
375
|
+
break;
|
|
376
|
+
}
|
|
377
|
+
if (code === CHAR_QUESTION_MARK) {
|
|
378
|
+
isGlob = token.isGlob = true;
|
|
379
|
+
finished = true;
|
|
380
|
+
if (scanToEnd === true) continue;
|
|
381
|
+
break;
|
|
382
|
+
}
|
|
383
|
+
if (code === CHAR_LEFT_SQUARE_BRACKET) {
|
|
384
|
+
while (eos() !== true && (next = advance())) {
|
|
385
|
+
if (next === CHAR_BACKWARD_SLASH) {
|
|
386
|
+
backslashes = token.backslashes = true;
|
|
387
|
+
advance();
|
|
388
|
+
continue;
|
|
389
|
+
}
|
|
390
|
+
if (next === CHAR_RIGHT_SQUARE_BRACKET) {
|
|
391
|
+
isBracket = token.isBracket = true;
|
|
392
|
+
isGlob = token.isGlob = true;
|
|
393
|
+
finished = true;
|
|
394
|
+
break;
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
if (scanToEnd === true) continue;
|
|
398
|
+
break;
|
|
399
|
+
}
|
|
400
|
+
if (opts.nonegate !== true && code === CHAR_EXCLAMATION_MARK && index === start) {
|
|
401
|
+
negated = token.negated = true;
|
|
402
|
+
start++;
|
|
403
|
+
continue;
|
|
404
|
+
}
|
|
405
|
+
if (opts.noparen !== true && code === CHAR_LEFT_PARENTHESES) {
|
|
406
|
+
isGlob = token.isGlob = true;
|
|
407
|
+
if (scanToEnd === true) {
|
|
408
|
+
while (eos() !== true && (code = advance())) {
|
|
409
|
+
if (code === CHAR_LEFT_PARENTHESES) {
|
|
410
|
+
backslashes = token.backslashes = true;
|
|
411
|
+
code = advance();
|
|
412
|
+
continue;
|
|
413
|
+
}
|
|
414
|
+
if (code === CHAR_RIGHT_PARENTHESES) {
|
|
415
|
+
finished = true;
|
|
416
|
+
break;
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
continue;
|
|
420
|
+
}
|
|
421
|
+
break;
|
|
422
|
+
}
|
|
423
|
+
if (isGlob === true) {
|
|
424
|
+
finished = true;
|
|
425
|
+
if (scanToEnd === true) continue;
|
|
426
|
+
break;
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
if (opts.noext === true) {
|
|
430
|
+
isExtglob = false;
|
|
431
|
+
isGlob = false;
|
|
432
|
+
}
|
|
433
|
+
let base = str;
|
|
434
|
+
let prefix = "";
|
|
435
|
+
let glob = "";
|
|
436
|
+
if (start > 0) {
|
|
437
|
+
prefix = str.slice(0, start);
|
|
438
|
+
str = str.slice(start);
|
|
439
|
+
lastIndex -= start;
|
|
440
|
+
}
|
|
441
|
+
if (base && isGlob === true && lastIndex > 0) {
|
|
442
|
+
base = str.slice(0, lastIndex);
|
|
443
|
+
glob = str.slice(lastIndex);
|
|
444
|
+
} else if (isGlob === true) {
|
|
445
|
+
base = "";
|
|
446
|
+
glob = str;
|
|
447
|
+
} else base = str;
|
|
448
|
+
if (base && base !== "" && base !== "/" && base !== str) {
|
|
449
|
+
if (isPathSeparator(base.charCodeAt(base.length - 1))) base = base.slice(0, -1);
|
|
450
|
+
}
|
|
451
|
+
if (opts.unescape === true) {
|
|
452
|
+
if (glob) glob = utils.removeBackslashes(glob);
|
|
453
|
+
if (base && backslashes === true) base = utils.removeBackslashes(base);
|
|
454
|
+
}
|
|
455
|
+
const state = {
|
|
456
|
+
prefix,
|
|
457
|
+
input,
|
|
458
|
+
start,
|
|
459
|
+
base,
|
|
460
|
+
glob,
|
|
461
|
+
isBrace,
|
|
462
|
+
isBracket,
|
|
463
|
+
isGlob,
|
|
464
|
+
isExtglob,
|
|
465
|
+
isGlobstar,
|
|
466
|
+
negated,
|
|
467
|
+
negatedExtglob
|
|
468
|
+
};
|
|
469
|
+
if (opts.tokens === true) {
|
|
470
|
+
state.maxDepth = 0;
|
|
471
|
+
if (!isPathSeparator(code)) tokens.push(token);
|
|
472
|
+
state.tokens = tokens;
|
|
473
|
+
}
|
|
474
|
+
if (opts.parts === true || opts.tokens === true) {
|
|
475
|
+
let prevIndex;
|
|
476
|
+
for (let idx = 0; idx < slashes.length; idx++) {
|
|
477
|
+
const n = prevIndex ? prevIndex + 1 : start;
|
|
478
|
+
const i = slashes[idx];
|
|
479
|
+
const value = input.slice(n, i);
|
|
480
|
+
if (opts.tokens) {
|
|
481
|
+
if (idx === 0 && start !== 0) {
|
|
482
|
+
tokens[idx].isPrefix = true;
|
|
483
|
+
tokens[idx].value = prefix;
|
|
484
|
+
} else tokens[idx].value = value;
|
|
485
|
+
depth(tokens[idx]);
|
|
486
|
+
state.maxDepth += tokens[idx].depth;
|
|
487
|
+
}
|
|
488
|
+
if (idx !== 0 || value !== "") parts.push(value);
|
|
489
|
+
prevIndex = i;
|
|
490
|
+
}
|
|
491
|
+
if (prevIndex && prevIndex + 1 < input.length) {
|
|
492
|
+
const value = input.slice(prevIndex + 1);
|
|
493
|
+
parts.push(value);
|
|
494
|
+
if (opts.tokens) {
|
|
495
|
+
tokens[tokens.length - 1].value = value;
|
|
496
|
+
depth(tokens[tokens.length - 1]);
|
|
497
|
+
state.maxDepth += tokens[tokens.length - 1].depth;
|
|
498
|
+
}
|
|
499
|
+
}
|
|
500
|
+
state.slashes = slashes;
|
|
501
|
+
state.parts = parts;
|
|
502
|
+
}
|
|
503
|
+
return state;
|
|
504
|
+
};
|
|
505
|
+
module.exports = scan;
|
|
506
|
+
}));
|
|
507
|
+
//#endregion
|
|
508
|
+
//#region ../../node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/lib/parse.js
|
|
509
|
+
var require_parse$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
510
|
+
const constants = require_constants$1();
|
|
511
|
+
const utils = require_utils();
|
|
512
|
+
/**
|
|
513
|
+
* Constants
|
|
514
|
+
*/
|
|
515
|
+
const { MAX_LENGTH, POSIX_REGEX_SOURCE, REGEX_NON_SPECIAL_CHARS, REGEX_SPECIAL_CHARS_BACKREF, REPLACEMENTS } = constants;
|
|
516
|
+
/**
|
|
517
|
+
* Helpers
|
|
518
|
+
*/
|
|
519
|
+
const expandRange = (args, options) => {
|
|
520
|
+
if (typeof options.expandRange === "function") return options.expandRange(...args, options);
|
|
521
|
+
args.sort();
|
|
522
|
+
const value = `[${args.join("-")}]`;
|
|
523
|
+
try {
|
|
524
|
+
new RegExp(value);
|
|
525
|
+
} catch (ex) {
|
|
526
|
+
return args.map((v) => utils.escapeRegex(v)).join("..");
|
|
527
|
+
}
|
|
528
|
+
return value;
|
|
529
|
+
};
|
|
530
|
+
/**
|
|
531
|
+
* Create the message for a syntax error
|
|
532
|
+
*/
|
|
533
|
+
const syntaxError = (type, char) => {
|
|
534
|
+
return `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`;
|
|
535
|
+
};
|
|
536
|
+
const splitTopLevel = (input) => {
|
|
537
|
+
const parts = [];
|
|
538
|
+
let bracket = 0;
|
|
539
|
+
let paren = 0;
|
|
540
|
+
let quote = 0;
|
|
541
|
+
let value = "";
|
|
542
|
+
let escaped = false;
|
|
543
|
+
for (const ch of input) {
|
|
544
|
+
if (escaped === true) {
|
|
545
|
+
value += ch;
|
|
546
|
+
escaped = false;
|
|
547
|
+
continue;
|
|
548
|
+
}
|
|
549
|
+
if (ch === "\\") {
|
|
550
|
+
value += ch;
|
|
551
|
+
escaped = true;
|
|
552
|
+
continue;
|
|
553
|
+
}
|
|
554
|
+
if (ch === "\"") {
|
|
555
|
+
quote = quote === 1 ? 0 : 1;
|
|
556
|
+
value += ch;
|
|
557
|
+
continue;
|
|
558
|
+
}
|
|
559
|
+
if (quote === 0) {
|
|
560
|
+
if (ch === "[") bracket++;
|
|
561
|
+
else if (ch === "]" && bracket > 0) bracket--;
|
|
562
|
+
else if (bracket === 0) {
|
|
563
|
+
if (ch === "(") paren++;
|
|
564
|
+
else if (ch === ")" && paren > 0) paren--;
|
|
565
|
+
else if (ch === "|" && paren === 0) {
|
|
566
|
+
parts.push(value);
|
|
567
|
+
value = "";
|
|
568
|
+
continue;
|
|
569
|
+
}
|
|
570
|
+
}
|
|
571
|
+
}
|
|
572
|
+
value += ch;
|
|
573
|
+
}
|
|
574
|
+
parts.push(value);
|
|
575
|
+
return parts;
|
|
576
|
+
};
|
|
577
|
+
const isPlainBranch = (branch) => {
|
|
578
|
+
let escaped = false;
|
|
579
|
+
for (const ch of branch) {
|
|
580
|
+
if (escaped === true) {
|
|
581
|
+
escaped = false;
|
|
582
|
+
continue;
|
|
583
|
+
}
|
|
584
|
+
if (ch === "\\") {
|
|
585
|
+
escaped = true;
|
|
586
|
+
continue;
|
|
587
|
+
}
|
|
588
|
+
if (/[?*+@!()[\]{}]/.test(ch)) return false;
|
|
589
|
+
}
|
|
590
|
+
return true;
|
|
591
|
+
};
|
|
592
|
+
const normalizeSimpleBranch = (branch) => {
|
|
593
|
+
let value = branch.trim();
|
|
594
|
+
let changed = true;
|
|
595
|
+
while (changed === true) {
|
|
596
|
+
changed = false;
|
|
597
|
+
if (/^@\([^\\()[\]{}|]+\)$/.test(value)) {
|
|
598
|
+
value = value.slice(2, -1);
|
|
599
|
+
changed = true;
|
|
600
|
+
}
|
|
601
|
+
}
|
|
602
|
+
if (!isPlainBranch(value)) return;
|
|
603
|
+
return value.replace(/\\(.)/g, "$1");
|
|
604
|
+
};
|
|
605
|
+
const hasRepeatedCharPrefixOverlap = (branches) => {
|
|
606
|
+
const values = branches.map(normalizeSimpleBranch).filter(Boolean);
|
|
607
|
+
for (let i = 0; i < values.length; i++) for (let j = i + 1; j < values.length; j++) {
|
|
608
|
+
const a = values[i];
|
|
609
|
+
const b = values[j];
|
|
610
|
+
const char = a[0];
|
|
611
|
+
if (!char || a !== char.repeat(a.length) || b !== char.repeat(b.length)) continue;
|
|
612
|
+
if (a === b || a.startsWith(b) || b.startsWith(a)) return true;
|
|
613
|
+
}
|
|
614
|
+
return false;
|
|
615
|
+
};
|
|
616
|
+
const parseRepeatedExtglob = (pattern, requireEnd = true) => {
|
|
617
|
+
if (pattern[0] !== "+" && pattern[0] !== "*" || pattern[1] !== "(") return;
|
|
618
|
+
let bracket = 0;
|
|
619
|
+
let paren = 0;
|
|
620
|
+
let quote = 0;
|
|
621
|
+
let escaped = false;
|
|
622
|
+
for (let i = 1; i < pattern.length; i++) {
|
|
623
|
+
const ch = pattern[i];
|
|
624
|
+
if (escaped === true) {
|
|
625
|
+
escaped = false;
|
|
626
|
+
continue;
|
|
627
|
+
}
|
|
628
|
+
if (ch === "\\") {
|
|
629
|
+
escaped = true;
|
|
630
|
+
continue;
|
|
631
|
+
}
|
|
632
|
+
if (ch === "\"") {
|
|
633
|
+
quote = quote === 1 ? 0 : 1;
|
|
634
|
+
continue;
|
|
635
|
+
}
|
|
636
|
+
if (quote === 1) continue;
|
|
637
|
+
if (ch === "[") {
|
|
638
|
+
bracket++;
|
|
639
|
+
continue;
|
|
640
|
+
}
|
|
641
|
+
if (ch === "]" && bracket > 0) {
|
|
642
|
+
bracket--;
|
|
643
|
+
continue;
|
|
644
|
+
}
|
|
645
|
+
if (bracket > 0) continue;
|
|
646
|
+
if (ch === "(") {
|
|
647
|
+
paren++;
|
|
648
|
+
continue;
|
|
649
|
+
}
|
|
650
|
+
if (ch === ")") {
|
|
651
|
+
paren--;
|
|
652
|
+
if (paren === 0) {
|
|
653
|
+
if (requireEnd === true && i !== pattern.length - 1) return;
|
|
654
|
+
return {
|
|
655
|
+
type: pattern[0],
|
|
656
|
+
body: pattern.slice(2, i),
|
|
657
|
+
end: i
|
|
658
|
+
};
|
|
659
|
+
}
|
|
660
|
+
}
|
|
661
|
+
}
|
|
662
|
+
};
|
|
663
|
+
const getStarExtglobSequenceOutput = (pattern) => {
|
|
664
|
+
let index = 0;
|
|
665
|
+
const chars = [];
|
|
666
|
+
while (index < pattern.length) {
|
|
667
|
+
const match = parseRepeatedExtglob(pattern.slice(index), false);
|
|
668
|
+
if (!match || match.type !== "*") return;
|
|
669
|
+
const branches = splitTopLevel(match.body).map((branch) => branch.trim());
|
|
670
|
+
if (branches.length !== 1) return;
|
|
671
|
+
const branch = normalizeSimpleBranch(branches[0]);
|
|
672
|
+
if (!branch || branch.length !== 1) return;
|
|
673
|
+
chars.push(branch);
|
|
674
|
+
index += match.end + 1;
|
|
675
|
+
}
|
|
676
|
+
if (chars.length < 1) return;
|
|
677
|
+
return `${chars.length === 1 ? utils.escapeRegex(chars[0]) : `[${chars.map((ch) => utils.escapeRegex(ch)).join("")}]`}*`;
|
|
678
|
+
};
|
|
679
|
+
const repeatedExtglobRecursion = (pattern) => {
|
|
680
|
+
let depth = 0;
|
|
681
|
+
let value = pattern.trim();
|
|
682
|
+
let match = parseRepeatedExtglob(value);
|
|
683
|
+
while (match) {
|
|
684
|
+
depth++;
|
|
685
|
+
value = match.body.trim();
|
|
686
|
+
match = parseRepeatedExtglob(value);
|
|
687
|
+
}
|
|
688
|
+
return depth;
|
|
689
|
+
};
|
|
690
|
+
const analyzeRepeatedExtglob = (body, options) => {
|
|
691
|
+
if (options.maxExtglobRecursion === false) return { risky: false };
|
|
692
|
+
const max = typeof options.maxExtglobRecursion === "number" ? options.maxExtglobRecursion : constants.DEFAULT_MAX_EXTGLOB_RECURSION;
|
|
693
|
+
const branches = splitTopLevel(body).map((branch) => branch.trim());
|
|
694
|
+
if (branches.length > 1) {
|
|
695
|
+
if (branches.some((branch) => branch === "") || branches.some((branch) => /^[*?]+$/.test(branch)) || hasRepeatedCharPrefixOverlap(branches)) return { risky: true };
|
|
696
|
+
}
|
|
697
|
+
for (const branch of branches) {
|
|
698
|
+
const safeOutput = getStarExtglobSequenceOutput(branch);
|
|
699
|
+
if (safeOutput) return {
|
|
700
|
+
risky: true,
|
|
701
|
+
safeOutput
|
|
702
|
+
};
|
|
703
|
+
if (repeatedExtglobRecursion(branch) > max) return { risky: true };
|
|
704
|
+
}
|
|
705
|
+
return { risky: false };
|
|
706
|
+
};
|
|
707
|
+
/**
|
|
708
|
+
* Parse the given input string.
|
|
709
|
+
* @param {String} input
|
|
710
|
+
* @param {Object} options
|
|
711
|
+
* @return {Object}
|
|
712
|
+
*/
|
|
713
|
+
const parse = (input, options) => {
|
|
714
|
+
if (typeof input !== "string") throw new TypeError("Expected a string");
|
|
715
|
+
input = REPLACEMENTS[input] || input;
|
|
716
|
+
const opts = { ...options };
|
|
717
|
+
const max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
|
|
718
|
+
let len = input.length;
|
|
719
|
+
if (len > max) throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
|
|
720
|
+
const bos = {
|
|
721
|
+
type: "bos",
|
|
722
|
+
value: "",
|
|
723
|
+
output: opts.prepend || ""
|
|
724
|
+
};
|
|
725
|
+
const tokens = [bos];
|
|
726
|
+
const capture = opts.capture ? "" : "?:";
|
|
727
|
+
const PLATFORM_CHARS = constants.globChars(opts.windows);
|
|
728
|
+
const EXTGLOB_CHARS = constants.extglobChars(PLATFORM_CHARS);
|
|
729
|
+
const { DOT_LITERAL, PLUS_LITERAL, SLASH_LITERAL, ONE_CHAR, DOTS_SLASH, NO_DOT, NO_DOT_SLASH, NO_DOTS_SLASH, QMARK, QMARK_NO_DOT, STAR, START_ANCHOR } = PLATFORM_CHARS;
|
|
730
|
+
const globstar = (opts) => {
|
|
731
|
+
return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
|
|
732
|
+
};
|
|
733
|
+
const nodot = opts.dot ? "" : NO_DOT;
|
|
734
|
+
const qmarkNoDot = opts.dot ? QMARK : QMARK_NO_DOT;
|
|
735
|
+
let star = opts.bash === true ? globstar(opts) : STAR;
|
|
736
|
+
if (opts.capture) star = `(${star})`;
|
|
737
|
+
if (typeof opts.noext === "boolean") opts.noextglob = opts.noext;
|
|
738
|
+
const state = {
|
|
739
|
+
input,
|
|
740
|
+
index: -1,
|
|
741
|
+
start: 0,
|
|
742
|
+
dot: opts.dot === true,
|
|
743
|
+
consumed: "",
|
|
744
|
+
output: "",
|
|
745
|
+
prefix: "",
|
|
746
|
+
backtrack: false,
|
|
747
|
+
negated: false,
|
|
748
|
+
brackets: 0,
|
|
749
|
+
braces: 0,
|
|
750
|
+
parens: 0,
|
|
751
|
+
quotes: 0,
|
|
752
|
+
globstar: false,
|
|
753
|
+
tokens
|
|
754
|
+
};
|
|
755
|
+
input = utils.removePrefix(input, state);
|
|
756
|
+
len = input.length;
|
|
757
|
+
const extglobs = [];
|
|
758
|
+
const braces = [];
|
|
759
|
+
const stack = [];
|
|
760
|
+
let prev = bos;
|
|
761
|
+
let value;
|
|
762
|
+
/**
|
|
763
|
+
* Tokenizing helpers
|
|
764
|
+
*/
|
|
765
|
+
const eos = () => state.index === len - 1;
|
|
766
|
+
const peek = state.peek = (n = 1) => input[state.index + n];
|
|
767
|
+
const advance = state.advance = () => input[++state.index] || "";
|
|
768
|
+
const remaining = () => input.slice(state.index + 1);
|
|
769
|
+
const consume = (value = "", num = 0) => {
|
|
770
|
+
state.consumed += value;
|
|
771
|
+
state.index += num;
|
|
772
|
+
};
|
|
773
|
+
const append = (token) => {
|
|
774
|
+
state.output += token.output != null ? token.output : token.value;
|
|
775
|
+
consume(token.value);
|
|
776
|
+
};
|
|
777
|
+
const negate = () => {
|
|
778
|
+
let count = 1;
|
|
779
|
+
while (peek() === "!" && (peek(2) !== "(" || peek(3) === "?")) {
|
|
780
|
+
advance();
|
|
781
|
+
state.start++;
|
|
782
|
+
count++;
|
|
783
|
+
}
|
|
784
|
+
if (count % 2 === 0) return false;
|
|
785
|
+
state.negated = true;
|
|
786
|
+
state.start++;
|
|
787
|
+
return true;
|
|
788
|
+
};
|
|
789
|
+
const increment = (type) => {
|
|
790
|
+
state[type]++;
|
|
791
|
+
stack.push(type);
|
|
792
|
+
};
|
|
793
|
+
const decrement = (type) => {
|
|
794
|
+
state[type]--;
|
|
795
|
+
stack.pop();
|
|
796
|
+
};
|
|
797
|
+
/**
|
|
798
|
+
* Push tokens onto the tokens array. This helper speeds up
|
|
799
|
+
* tokenizing by 1) helping us avoid backtracking as much as possible,
|
|
800
|
+
* and 2) helping us avoid creating extra tokens when consecutive
|
|
801
|
+
* characters are plain text. This improves performance and simplifies
|
|
802
|
+
* lookbehinds.
|
|
803
|
+
*/
|
|
804
|
+
const push = (tok) => {
|
|
805
|
+
if (prev.type === "globstar") {
|
|
806
|
+
const isBrace = state.braces > 0 && (tok.type === "comma" || tok.type === "brace");
|
|
807
|
+
const isExtglob = tok.extglob === true || extglobs.length && (tok.type === "pipe" || tok.type === "paren");
|
|
808
|
+
if (tok.type !== "slash" && tok.type !== "paren" && !isBrace && !isExtglob) {
|
|
809
|
+
state.output = state.output.slice(0, -prev.output.length);
|
|
810
|
+
prev.type = "star";
|
|
811
|
+
prev.value = "*";
|
|
812
|
+
prev.output = star;
|
|
813
|
+
state.output += prev.output;
|
|
814
|
+
}
|
|
815
|
+
}
|
|
816
|
+
if (extglobs.length && tok.type !== "paren") extglobs[extglobs.length - 1].inner += tok.value;
|
|
817
|
+
if (tok.value || tok.output) append(tok);
|
|
818
|
+
if (prev && prev.type === "text" && tok.type === "text") {
|
|
819
|
+
prev.output = (prev.output || prev.value) + tok.value;
|
|
820
|
+
prev.value += tok.value;
|
|
821
|
+
return;
|
|
822
|
+
}
|
|
823
|
+
tok.prev = prev;
|
|
824
|
+
tokens.push(tok);
|
|
825
|
+
prev = tok;
|
|
826
|
+
};
|
|
827
|
+
const extglobOpen = (type, value) => {
|
|
828
|
+
const token = {
|
|
829
|
+
...EXTGLOB_CHARS[value],
|
|
830
|
+
conditions: 1,
|
|
831
|
+
inner: ""
|
|
832
|
+
};
|
|
833
|
+
token.prev = prev;
|
|
834
|
+
token.parens = state.parens;
|
|
835
|
+
token.output = state.output;
|
|
836
|
+
token.startIndex = state.index;
|
|
837
|
+
token.tokensIndex = tokens.length;
|
|
838
|
+
const output = (opts.capture ? "(" : "") + token.open;
|
|
839
|
+
increment("parens");
|
|
840
|
+
push({
|
|
841
|
+
type,
|
|
842
|
+
value,
|
|
843
|
+
output: state.output ? "" : ONE_CHAR
|
|
844
|
+
});
|
|
845
|
+
push({
|
|
846
|
+
type: "paren",
|
|
847
|
+
extglob: true,
|
|
848
|
+
value: advance(),
|
|
849
|
+
output
|
|
850
|
+
});
|
|
851
|
+
extglobs.push(token);
|
|
852
|
+
};
|
|
853
|
+
const extglobClose = (token) => {
|
|
854
|
+
const literal = input.slice(token.startIndex, state.index + 1);
|
|
855
|
+
const analysis = analyzeRepeatedExtglob(input.slice(token.startIndex + 2, state.index), opts);
|
|
856
|
+
if ((token.type === "plus" || token.type === "star") && analysis.risky) {
|
|
857
|
+
const safeOutput = analysis.safeOutput ? (token.output ? "" : ONE_CHAR) + (opts.capture ? `(${analysis.safeOutput})` : analysis.safeOutput) : void 0;
|
|
858
|
+
const open = tokens[token.tokensIndex];
|
|
859
|
+
open.type = "text";
|
|
860
|
+
open.value = literal;
|
|
861
|
+
open.output = safeOutput || utils.escapeRegex(literal);
|
|
862
|
+
for (let i = token.tokensIndex + 1; i < tokens.length; i++) {
|
|
863
|
+
tokens[i].value = "";
|
|
864
|
+
tokens[i].output = "";
|
|
865
|
+
delete tokens[i].suffix;
|
|
866
|
+
}
|
|
867
|
+
state.output = token.output + open.output;
|
|
868
|
+
state.backtrack = true;
|
|
869
|
+
push({
|
|
870
|
+
type: "paren",
|
|
871
|
+
extglob: true,
|
|
872
|
+
value,
|
|
873
|
+
output: ""
|
|
874
|
+
});
|
|
875
|
+
decrement("parens");
|
|
876
|
+
return;
|
|
877
|
+
}
|
|
878
|
+
let output = token.close + (opts.capture ? ")" : "");
|
|
879
|
+
let rest;
|
|
880
|
+
if (token.type === "negate") {
|
|
881
|
+
let extglobStar = star;
|
|
882
|
+
if (token.inner && token.inner.length > 1 && token.inner.includes("/")) extglobStar = globstar(opts);
|
|
883
|
+
if (extglobStar !== star || eos() || /^\)+$/.test(remaining())) output = token.close = `)$))${extglobStar}`;
|
|
884
|
+
if (token.inner.includes("*") && (rest = remaining()) && /^\.[^\\/.]+$/.test(rest)) output = token.close = `)${parse(rest, {
|
|
885
|
+
...options,
|
|
886
|
+
fastpaths: false
|
|
887
|
+
}).output})${extglobStar})`;
|
|
888
|
+
if (token.prev.type === "bos") state.negatedExtglob = true;
|
|
889
|
+
}
|
|
890
|
+
push({
|
|
891
|
+
type: "paren",
|
|
892
|
+
extglob: true,
|
|
893
|
+
value,
|
|
894
|
+
output
|
|
895
|
+
});
|
|
896
|
+
decrement("parens");
|
|
897
|
+
};
|
|
898
|
+
/**
|
|
899
|
+
* Fast paths
|
|
900
|
+
*/
|
|
901
|
+
if (opts.fastpaths !== false && !/(^[*!]|[/()[\]{}"])/.test(input)) {
|
|
902
|
+
let backslashes = false;
|
|
903
|
+
let output = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (m, esc, chars, first, rest, index) => {
|
|
904
|
+
if (first === "\\") {
|
|
905
|
+
backslashes = true;
|
|
906
|
+
return m;
|
|
907
|
+
}
|
|
908
|
+
if (first === "?") {
|
|
909
|
+
if (esc) return esc + first + (rest ? QMARK.repeat(rest.length) : "");
|
|
910
|
+
if (index === 0) return qmarkNoDot + (rest ? QMARK.repeat(rest.length) : "");
|
|
911
|
+
return QMARK.repeat(chars.length);
|
|
912
|
+
}
|
|
913
|
+
if (first === ".") return DOT_LITERAL.repeat(chars.length);
|
|
914
|
+
if (first === "*") {
|
|
915
|
+
if (esc) return esc + first + (rest ? star : "");
|
|
916
|
+
return star;
|
|
917
|
+
}
|
|
918
|
+
return esc ? m : `\\${m}`;
|
|
919
|
+
});
|
|
920
|
+
if (backslashes === true) if (opts.unescape === true) output = output.replace(/\\/g, "");
|
|
921
|
+
else output = output.replace(/\\+/g, (m) => {
|
|
922
|
+
return m.length % 2 === 0 ? "\\\\" : m ? "\\" : "";
|
|
923
|
+
});
|
|
924
|
+
if (output === input && opts.contains === true) {
|
|
925
|
+
state.output = input;
|
|
926
|
+
return state;
|
|
927
|
+
}
|
|
928
|
+
state.output = utils.wrapOutput(output, state, options);
|
|
929
|
+
return state;
|
|
930
|
+
}
|
|
931
|
+
/**
|
|
932
|
+
* Tokenize input until we reach end-of-string
|
|
933
|
+
*/
|
|
934
|
+
while (!eos()) {
|
|
935
|
+
value = advance();
|
|
936
|
+
if (value === "\0") continue;
|
|
937
|
+
/**
|
|
938
|
+
* Escaped characters
|
|
939
|
+
*/
|
|
940
|
+
if (value === "\\") {
|
|
941
|
+
const next = peek();
|
|
942
|
+
if (next === "/" && opts.bash !== true) continue;
|
|
943
|
+
if (next === "." || next === ";") continue;
|
|
944
|
+
if (!next) {
|
|
945
|
+
value += "\\";
|
|
946
|
+
push({
|
|
947
|
+
type: "text",
|
|
948
|
+
value
|
|
949
|
+
});
|
|
950
|
+
continue;
|
|
951
|
+
}
|
|
952
|
+
const match = /^\\+/.exec(remaining());
|
|
953
|
+
let slashes = 0;
|
|
954
|
+
if (match && match[0].length > 2) {
|
|
955
|
+
slashes = match[0].length;
|
|
956
|
+
state.index += slashes;
|
|
957
|
+
if (slashes % 2 !== 0) value += "\\";
|
|
958
|
+
}
|
|
959
|
+
if (opts.unescape === true) value = advance();
|
|
960
|
+
else value += advance();
|
|
961
|
+
if (state.brackets === 0) {
|
|
962
|
+
push({
|
|
963
|
+
type: "text",
|
|
964
|
+
value
|
|
965
|
+
});
|
|
966
|
+
continue;
|
|
967
|
+
}
|
|
968
|
+
}
|
|
969
|
+
/**
|
|
970
|
+
* If we're inside a regex character class, continue
|
|
971
|
+
* until we reach the closing bracket.
|
|
972
|
+
*/
|
|
973
|
+
if (state.brackets > 0 && (value !== "]" || prev.value === "[" || prev.value === "[^")) {
|
|
974
|
+
if (opts.posix !== false && value === ":") {
|
|
975
|
+
const inner = prev.value.slice(1);
|
|
976
|
+
if (inner.includes("[")) {
|
|
977
|
+
prev.posix = true;
|
|
978
|
+
if (inner.includes(":")) {
|
|
979
|
+
const idx = prev.value.lastIndexOf("[");
|
|
980
|
+
const pre = prev.value.slice(0, idx);
|
|
981
|
+
const posix = POSIX_REGEX_SOURCE[prev.value.slice(idx + 2)];
|
|
982
|
+
if (posix) {
|
|
983
|
+
prev.value = pre + posix;
|
|
984
|
+
state.backtrack = true;
|
|
985
|
+
advance();
|
|
986
|
+
if (!bos.output && tokens.indexOf(prev) === 1) bos.output = ONE_CHAR;
|
|
987
|
+
continue;
|
|
988
|
+
}
|
|
989
|
+
}
|
|
990
|
+
}
|
|
991
|
+
}
|
|
992
|
+
if (value === "[" && peek() !== ":" || value === "-" && peek() === "]") value = `\\${value}`;
|
|
993
|
+
if (value === "]" && (prev.value === "[" || prev.value === "[^")) value = `\\${value}`;
|
|
994
|
+
if (opts.posix === true && value === "!" && prev.value === "[") value = "^";
|
|
995
|
+
prev.value += value;
|
|
996
|
+
append({ value });
|
|
997
|
+
continue;
|
|
998
|
+
}
|
|
999
|
+
/**
|
|
1000
|
+
* If we're inside a quoted string, continue
|
|
1001
|
+
* until we reach the closing double quote.
|
|
1002
|
+
*/
|
|
1003
|
+
if (state.quotes === 1 && value !== "\"") {
|
|
1004
|
+
value = utils.escapeRegex(value);
|
|
1005
|
+
prev.value += value;
|
|
1006
|
+
append({ value });
|
|
1007
|
+
continue;
|
|
1008
|
+
}
|
|
1009
|
+
/**
|
|
1010
|
+
* Double quotes
|
|
1011
|
+
*/
|
|
1012
|
+
if (value === "\"") {
|
|
1013
|
+
state.quotes = state.quotes === 1 ? 0 : 1;
|
|
1014
|
+
if (opts.keepQuotes === true) push({
|
|
1015
|
+
type: "text",
|
|
1016
|
+
value
|
|
1017
|
+
});
|
|
1018
|
+
continue;
|
|
1019
|
+
}
|
|
1020
|
+
/**
|
|
1021
|
+
* Parentheses
|
|
1022
|
+
*/
|
|
1023
|
+
if (value === "(") {
|
|
1024
|
+
increment("parens");
|
|
1025
|
+
push({
|
|
1026
|
+
type: "paren",
|
|
1027
|
+
value
|
|
1028
|
+
});
|
|
1029
|
+
continue;
|
|
1030
|
+
}
|
|
1031
|
+
if (value === ")") {
|
|
1032
|
+
if (state.parens === 0 && opts.strictBrackets === true) throw new SyntaxError(syntaxError("opening", "("));
|
|
1033
|
+
const extglob = extglobs[extglobs.length - 1];
|
|
1034
|
+
if (extglob && state.parens === extglob.parens + 1) {
|
|
1035
|
+
extglobClose(extglobs.pop());
|
|
1036
|
+
continue;
|
|
1037
|
+
}
|
|
1038
|
+
push({
|
|
1039
|
+
type: "paren",
|
|
1040
|
+
value,
|
|
1041
|
+
output: state.parens ? ")" : "\\)"
|
|
1042
|
+
});
|
|
1043
|
+
decrement("parens");
|
|
1044
|
+
continue;
|
|
1045
|
+
}
|
|
1046
|
+
/**
|
|
1047
|
+
* Square brackets
|
|
1048
|
+
*/
|
|
1049
|
+
if (value === "[") {
|
|
1050
|
+
if (opts.nobracket === true || !remaining().includes("]")) {
|
|
1051
|
+
if (opts.nobracket !== true && opts.strictBrackets === true) throw new SyntaxError(syntaxError("closing", "]"));
|
|
1052
|
+
value = `\\${value}`;
|
|
1053
|
+
} else increment("brackets");
|
|
1054
|
+
push({
|
|
1055
|
+
type: "bracket",
|
|
1056
|
+
value
|
|
1057
|
+
});
|
|
1058
|
+
continue;
|
|
1059
|
+
}
|
|
1060
|
+
if (value === "]") {
|
|
1061
|
+
if (opts.nobracket === true || prev && prev.type === "bracket" && prev.value.length === 1) {
|
|
1062
|
+
push({
|
|
1063
|
+
type: "text",
|
|
1064
|
+
value,
|
|
1065
|
+
output: `\\${value}`
|
|
1066
|
+
});
|
|
1067
|
+
continue;
|
|
1068
|
+
}
|
|
1069
|
+
if (state.brackets === 0) {
|
|
1070
|
+
if (opts.strictBrackets === true) throw new SyntaxError(syntaxError("opening", "["));
|
|
1071
|
+
push({
|
|
1072
|
+
type: "text",
|
|
1073
|
+
value,
|
|
1074
|
+
output: `\\${value}`
|
|
1075
|
+
});
|
|
1076
|
+
continue;
|
|
1077
|
+
}
|
|
1078
|
+
decrement("brackets");
|
|
1079
|
+
const prevValue = prev.value.slice(1);
|
|
1080
|
+
if (prev.posix !== true && prevValue[0] === "^" && !prevValue.includes("/")) value = `/${value}`;
|
|
1081
|
+
prev.value += value;
|
|
1082
|
+
append({ value });
|
|
1083
|
+
if (opts.literalBrackets === false || utils.hasRegexChars(prevValue)) continue;
|
|
1084
|
+
const escaped = utils.escapeRegex(prev.value);
|
|
1085
|
+
state.output = state.output.slice(0, -prev.value.length);
|
|
1086
|
+
if (opts.literalBrackets === true) {
|
|
1087
|
+
state.output += escaped;
|
|
1088
|
+
prev.value = escaped;
|
|
1089
|
+
continue;
|
|
1090
|
+
}
|
|
1091
|
+
prev.value = `(${capture}${escaped}|${prev.value})`;
|
|
1092
|
+
state.output += prev.value;
|
|
1093
|
+
continue;
|
|
1094
|
+
}
|
|
1095
|
+
/**
|
|
1096
|
+
* Braces
|
|
1097
|
+
*/
|
|
1098
|
+
if (value === "{" && opts.nobrace !== true) {
|
|
1099
|
+
increment("braces");
|
|
1100
|
+
const open = {
|
|
1101
|
+
type: "brace",
|
|
1102
|
+
value,
|
|
1103
|
+
output: "(",
|
|
1104
|
+
outputIndex: state.output.length,
|
|
1105
|
+
tokensIndex: state.tokens.length
|
|
1106
|
+
};
|
|
1107
|
+
braces.push(open);
|
|
1108
|
+
push(open);
|
|
1109
|
+
continue;
|
|
1110
|
+
}
|
|
1111
|
+
if (value === "}") {
|
|
1112
|
+
const brace = braces[braces.length - 1];
|
|
1113
|
+
if (opts.nobrace === true || !brace) {
|
|
1114
|
+
push({
|
|
1115
|
+
type: "text",
|
|
1116
|
+
value,
|
|
1117
|
+
output: value
|
|
1118
|
+
});
|
|
1119
|
+
continue;
|
|
1120
|
+
}
|
|
1121
|
+
let output = ")";
|
|
1122
|
+
if (brace.dots === true) {
|
|
1123
|
+
const arr = tokens.slice();
|
|
1124
|
+
const range = [];
|
|
1125
|
+
for (let i = arr.length - 1; i >= 0; i--) {
|
|
1126
|
+
tokens.pop();
|
|
1127
|
+
if (arr[i].type === "brace") break;
|
|
1128
|
+
if (arr[i].type !== "dots") range.unshift(arr[i].value);
|
|
1129
|
+
}
|
|
1130
|
+
output = expandRange(range, opts);
|
|
1131
|
+
state.backtrack = true;
|
|
1132
|
+
}
|
|
1133
|
+
if (brace.comma !== true && brace.dots !== true) {
|
|
1134
|
+
const out = state.output.slice(0, brace.outputIndex);
|
|
1135
|
+
const toks = state.tokens.slice(brace.tokensIndex);
|
|
1136
|
+
brace.value = brace.output = "\\{";
|
|
1137
|
+
value = output = "\\}";
|
|
1138
|
+
state.output = out;
|
|
1139
|
+
for (const t of toks) state.output += t.output || t.value;
|
|
1140
|
+
}
|
|
1141
|
+
push({
|
|
1142
|
+
type: "brace",
|
|
1143
|
+
value,
|
|
1144
|
+
output
|
|
1145
|
+
});
|
|
1146
|
+
decrement("braces");
|
|
1147
|
+
braces.pop();
|
|
1148
|
+
continue;
|
|
1149
|
+
}
|
|
1150
|
+
/**
|
|
1151
|
+
* Pipes
|
|
1152
|
+
*/
|
|
1153
|
+
if (value === "|") {
|
|
1154
|
+
if (extglobs.length > 0) extglobs[extglobs.length - 1].conditions++;
|
|
1155
|
+
push({
|
|
1156
|
+
type: "text",
|
|
1157
|
+
value
|
|
1158
|
+
});
|
|
1159
|
+
continue;
|
|
1160
|
+
}
|
|
1161
|
+
/**
|
|
1162
|
+
* Commas
|
|
1163
|
+
*/
|
|
1164
|
+
if (value === ",") {
|
|
1165
|
+
let output = value;
|
|
1166
|
+
const brace = braces[braces.length - 1];
|
|
1167
|
+
if (brace && stack[stack.length - 1] === "braces") {
|
|
1168
|
+
brace.comma = true;
|
|
1169
|
+
output = "|";
|
|
1170
|
+
}
|
|
1171
|
+
push({
|
|
1172
|
+
type: "comma",
|
|
1173
|
+
value,
|
|
1174
|
+
output
|
|
1175
|
+
});
|
|
1176
|
+
continue;
|
|
1177
|
+
}
|
|
1178
|
+
/**
|
|
1179
|
+
* Slashes
|
|
1180
|
+
*/
|
|
1181
|
+
if (value === "/") {
|
|
1182
|
+
if (prev.type === "dot" && state.index === state.start + 1) {
|
|
1183
|
+
state.start = state.index + 1;
|
|
1184
|
+
state.consumed = "";
|
|
1185
|
+
state.output = "";
|
|
1186
|
+
tokens.pop();
|
|
1187
|
+
prev = bos;
|
|
1188
|
+
continue;
|
|
1189
|
+
}
|
|
1190
|
+
push({
|
|
1191
|
+
type: "slash",
|
|
1192
|
+
value,
|
|
1193
|
+
output: SLASH_LITERAL
|
|
1194
|
+
});
|
|
1195
|
+
continue;
|
|
1196
|
+
}
|
|
1197
|
+
/**
|
|
1198
|
+
* Dots
|
|
1199
|
+
*/
|
|
1200
|
+
if (value === ".") {
|
|
1201
|
+
if (state.braces > 0 && prev.type === "dot") {
|
|
1202
|
+
if (prev.value === ".") prev.output = DOT_LITERAL;
|
|
1203
|
+
const brace = braces[braces.length - 1];
|
|
1204
|
+
prev.type = "dots";
|
|
1205
|
+
prev.output += value;
|
|
1206
|
+
prev.value += value;
|
|
1207
|
+
brace.dots = true;
|
|
1208
|
+
continue;
|
|
1209
|
+
}
|
|
1210
|
+
if (state.braces + state.parens === 0 && prev.type !== "bos" && prev.type !== "slash") {
|
|
1211
|
+
push({
|
|
1212
|
+
type: "text",
|
|
1213
|
+
value,
|
|
1214
|
+
output: DOT_LITERAL
|
|
1215
|
+
});
|
|
1216
|
+
continue;
|
|
1217
|
+
}
|
|
1218
|
+
push({
|
|
1219
|
+
type: "dot",
|
|
1220
|
+
value,
|
|
1221
|
+
output: DOT_LITERAL
|
|
1222
|
+
});
|
|
1223
|
+
continue;
|
|
1224
|
+
}
|
|
1225
|
+
/**
|
|
1226
|
+
* Question marks
|
|
1227
|
+
*/
|
|
1228
|
+
if (value === "?") {
|
|
1229
|
+
if (!(prev && prev.value === "(") && opts.noextglob !== true && peek() === "(" && peek(2) !== "?") {
|
|
1230
|
+
extglobOpen("qmark", value);
|
|
1231
|
+
continue;
|
|
1232
|
+
}
|
|
1233
|
+
if (prev && prev.type === "paren") {
|
|
1234
|
+
const next = peek();
|
|
1235
|
+
let output = value;
|
|
1236
|
+
if (prev.value === "(" && !/[!=<:]/.test(next) || next === "<" && !/<([!=]|\w+>)/.test(remaining())) output = `\\${value}`;
|
|
1237
|
+
push({
|
|
1238
|
+
type: "text",
|
|
1239
|
+
value,
|
|
1240
|
+
output
|
|
1241
|
+
});
|
|
1242
|
+
continue;
|
|
1243
|
+
}
|
|
1244
|
+
if (opts.dot !== true && (prev.type === "slash" || prev.type === "bos")) {
|
|
1245
|
+
push({
|
|
1246
|
+
type: "qmark",
|
|
1247
|
+
value,
|
|
1248
|
+
output: QMARK_NO_DOT
|
|
1249
|
+
});
|
|
1250
|
+
continue;
|
|
1251
|
+
}
|
|
1252
|
+
push({
|
|
1253
|
+
type: "qmark",
|
|
1254
|
+
value,
|
|
1255
|
+
output: QMARK
|
|
1256
|
+
});
|
|
1257
|
+
continue;
|
|
1258
|
+
}
|
|
1259
|
+
/**
|
|
1260
|
+
* Exclamation
|
|
1261
|
+
*/
|
|
1262
|
+
if (value === "!") {
|
|
1263
|
+
if (opts.noextglob !== true && peek() === "(") {
|
|
1264
|
+
if (peek(2) !== "?" || !/[!=<:]/.test(peek(3))) {
|
|
1265
|
+
extglobOpen("negate", value);
|
|
1266
|
+
continue;
|
|
1267
|
+
}
|
|
1268
|
+
}
|
|
1269
|
+
if (opts.nonegate !== true && state.index === 0) {
|
|
1270
|
+
negate();
|
|
1271
|
+
continue;
|
|
1272
|
+
}
|
|
1273
|
+
}
|
|
1274
|
+
/**
|
|
1275
|
+
* Plus
|
|
1276
|
+
*/
|
|
1277
|
+
if (value === "+") {
|
|
1278
|
+
if (opts.noextglob !== true && peek() === "(" && peek(2) !== "?") {
|
|
1279
|
+
extglobOpen("plus", value);
|
|
1280
|
+
continue;
|
|
1281
|
+
}
|
|
1282
|
+
if (prev && prev.value === "(" || opts.regex === false) {
|
|
1283
|
+
push({
|
|
1284
|
+
type: "plus",
|
|
1285
|
+
value,
|
|
1286
|
+
output: PLUS_LITERAL
|
|
1287
|
+
});
|
|
1288
|
+
continue;
|
|
1289
|
+
}
|
|
1290
|
+
if (prev && (prev.type === "bracket" || prev.type === "paren" || prev.type === "brace") || state.parens > 0) {
|
|
1291
|
+
push({
|
|
1292
|
+
type: "plus",
|
|
1293
|
+
value
|
|
1294
|
+
});
|
|
1295
|
+
continue;
|
|
1296
|
+
}
|
|
1297
|
+
push({
|
|
1298
|
+
type: "plus",
|
|
1299
|
+
value: PLUS_LITERAL
|
|
1300
|
+
});
|
|
1301
|
+
continue;
|
|
1302
|
+
}
|
|
1303
|
+
/**
|
|
1304
|
+
* Plain text
|
|
1305
|
+
*/
|
|
1306
|
+
if (value === "@") {
|
|
1307
|
+
if (opts.noextglob !== true && peek() === "(" && peek(2) !== "?") {
|
|
1308
|
+
push({
|
|
1309
|
+
type: "at",
|
|
1310
|
+
extglob: true,
|
|
1311
|
+
value,
|
|
1312
|
+
output: ""
|
|
1313
|
+
});
|
|
1314
|
+
continue;
|
|
1315
|
+
}
|
|
1316
|
+
push({
|
|
1317
|
+
type: "text",
|
|
1318
|
+
value
|
|
1319
|
+
});
|
|
1320
|
+
continue;
|
|
1321
|
+
}
|
|
1322
|
+
/**
|
|
1323
|
+
* Plain text
|
|
1324
|
+
*/
|
|
1325
|
+
if (value !== "*") {
|
|
1326
|
+
if (value === "$" || value === "^") value = `\\${value}`;
|
|
1327
|
+
const match = REGEX_NON_SPECIAL_CHARS.exec(remaining());
|
|
1328
|
+
if (match) {
|
|
1329
|
+
value += match[0];
|
|
1330
|
+
state.index += match[0].length;
|
|
1331
|
+
}
|
|
1332
|
+
push({
|
|
1333
|
+
type: "text",
|
|
1334
|
+
value
|
|
1335
|
+
});
|
|
1336
|
+
continue;
|
|
1337
|
+
}
|
|
1338
|
+
/**
|
|
1339
|
+
* Stars
|
|
1340
|
+
*/
|
|
1341
|
+
if (prev && (prev.type === "globstar" || prev.star === true)) {
|
|
1342
|
+
prev.type = "star";
|
|
1343
|
+
prev.star = true;
|
|
1344
|
+
prev.value += value;
|
|
1345
|
+
prev.output = star;
|
|
1346
|
+
state.backtrack = true;
|
|
1347
|
+
state.globstar = true;
|
|
1348
|
+
consume(value);
|
|
1349
|
+
continue;
|
|
1350
|
+
}
|
|
1351
|
+
let rest = remaining();
|
|
1352
|
+
if (opts.noextglob !== true && /^\([^?]/.test(rest)) {
|
|
1353
|
+
extglobOpen("star", value);
|
|
1354
|
+
continue;
|
|
1355
|
+
}
|
|
1356
|
+
if (prev.type === "star") {
|
|
1357
|
+
if (opts.noglobstar === true) {
|
|
1358
|
+
consume(value);
|
|
1359
|
+
continue;
|
|
1360
|
+
}
|
|
1361
|
+
const prior = prev.prev;
|
|
1362
|
+
const before = prior.prev;
|
|
1363
|
+
const isStart = prior.type === "slash" || prior.type === "bos";
|
|
1364
|
+
const afterStar = before && (before.type === "star" || before.type === "globstar");
|
|
1365
|
+
if (opts.bash === true && (!isStart || rest[0] && rest[0] !== "/")) {
|
|
1366
|
+
push({
|
|
1367
|
+
type: "star",
|
|
1368
|
+
value,
|
|
1369
|
+
output: ""
|
|
1370
|
+
});
|
|
1371
|
+
continue;
|
|
1372
|
+
}
|
|
1373
|
+
const isBrace = state.braces > 0 && (prior.type === "comma" || prior.type === "brace");
|
|
1374
|
+
const isExtglob = extglobs.length && (prior.type === "pipe" || prior.type === "paren");
|
|
1375
|
+
if (!isStart && prior.type !== "paren" && !isBrace && !isExtglob) {
|
|
1376
|
+
push({
|
|
1377
|
+
type: "star",
|
|
1378
|
+
value,
|
|
1379
|
+
output: ""
|
|
1380
|
+
});
|
|
1381
|
+
continue;
|
|
1382
|
+
}
|
|
1383
|
+
while (rest.slice(0, 3) === "/**") {
|
|
1384
|
+
const after = input[state.index + 4];
|
|
1385
|
+
if (after && after !== "/") break;
|
|
1386
|
+
rest = rest.slice(3);
|
|
1387
|
+
consume("/**", 3);
|
|
1388
|
+
}
|
|
1389
|
+
if (prior.type === "bos" && eos()) {
|
|
1390
|
+
prev.type = "globstar";
|
|
1391
|
+
prev.value += value;
|
|
1392
|
+
prev.output = globstar(opts);
|
|
1393
|
+
state.output = prev.output;
|
|
1394
|
+
state.globstar = true;
|
|
1395
|
+
consume(value);
|
|
1396
|
+
continue;
|
|
1397
|
+
}
|
|
1398
|
+
if (prior.type === "slash" && prior.prev.type !== "bos" && !afterStar && eos()) {
|
|
1399
|
+
state.output = state.output.slice(0, -(prior.output + prev.output).length);
|
|
1400
|
+
prior.output = `(?:${prior.output}`;
|
|
1401
|
+
prev.type = "globstar";
|
|
1402
|
+
prev.output = globstar(opts) + (opts.strictSlashes ? ")" : "|$)");
|
|
1403
|
+
prev.value += value;
|
|
1404
|
+
state.globstar = true;
|
|
1405
|
+
state.output += prior.output + prev.output;
|
|
1406
|
+
consume(value);
|
|
1407
|
+
continue;
|
|
1408
|
+
}
|
|
1409
|
+
if (prior.type === "slash" && prior.prev.type !== "bos" && rest[0] === "/") {
|
|
1410
|
+
const end = rest[1] !== void 0 ? "|$" : "";
|
|
1411
|
+
state.output = state.output.slice(0, -(prior.output + prev.output).length);
|
|
1412
|
+
prior.output = `(?:${prior.output}`;
|
|
1413
|
+
prev.type = "globstar";
|
|
1414
|
+
prev.output = `${globstar(opts)}${SLASH_LITERAL}|${SLASH_LITERAL}${end})`;
|
|
1415
|
+
prev.value += value;
|
|
1416
|
+
state.output += prior.output + prev.output;
|
|
1417
|
+
state.globstar = true;
|
|
1418
|
+
consume(value + advance());
|
|
1419
|
+
push({
|
|
1420
|
+
type: "slash",
|
|
1421
|
+
value: "/",
|
|
1422
|
+
output: ""
|
|
1423
|
+
});
|
|
1424
|
+
continue;
|
|
1425
|
+
}
|
|
1426
|
+
if (prior.type === "bos" && rest[0] === "/") {
|
|
1427
|
+
prev.type = "globstar";
|
|
1428
|
+
prev.value += value;
|
|
1429
|
+
prev.output = `(?:^|${SLASH_LITERAL}|${globstar(opts)}${SLASH_LITERAL})`;
|
|
1430
|
+
state.output = prev.output;
|
|
1431
|
+
state.globstar = true;
|
|
1432
|
+
consume(value + advance());
|
|
1433
|
+
push({
|
|
1434
|
+
type: "slash",
|
|
1435
|
+
value: "/",
|
|
1436
|
+
output: ""
|
|
1437
|
+
});
|
|
1438
|
+
continue;
|
|
1439
|
+
}
|
|
1440
|
+
state.output = state.output.slice(0, -prev.output.length);
|
|
1441
|
+
prev.type = "globstar";
|
|
1442
|
+
prev.output = globstar(opts);
|
|
1443
|
+
prev.value += value;
|
|
1444
|
+
state.output += prev.output;
|
|
1445
|
+
state.globstar = true;
|
|
1446
|
+
consume(value);
|
|
1447
|
+
continue;
|
|
1448
|
+
}
|
|
1449
|
+
const token = {
|
|
1450
|
+
type: "star",
|
|
1451
|
+
value,
|
|
1452
|
+
output: star
|
|
1453
|
+
};
|
|
1454
|
+
if (opts.bash === true) {
|
|
1455
|
+
token.output = ".*?";
|
|
1456
|
+
if (prev.type === "bos" || prev.type === "slash") token.output = nodot + token.output;
|
|
1457
|
+
push(token);
|
|
1458
|
+
continue;
|
|
1459
|
+
}
|
|
1460
|
+
if (prev && (prev.type === "bracket" || prev.type === "paren") && opts.regex === true) {
|
|
1461
|
+
token.output = value;
|
|
1462
|
+
push(token);
|
|
1463
|
+
continue;
|
|
1464
|
+
}
|
|
1465
|
+
if (state.index === state.start || prev.type === "slash" || prev.type === "dot") {
|
|
1466
|
+
if (prev.type === "dot") {
|
|
1467
|
+
state.output += NO_DOT_SLASH;
|
|
1468
|
+
prev.output += NO_DOT_SLASH;
|
|
1469
|
+
} else if (opts.dot === true) {
|
|
1470
|
+
state.output += NO_DOTS_SLASH;
|
|
1471
|
+
prev.output += NO_DOTS_SLASH;
|
|
1472
|
+
} else {
|
|
1473
|
+
state.output += nodot;
|
|
1474
|
+
prev.output += nodot;
|
|
1475
|
+
}
|
|
1476
|
+
if (peek() !== "*") {
|
|
1477
|
+
state.output += ONE_CHAR;
|
|
1478
|
+
prev.output += ONE_CHAR;
|
|
1479
|
+
}
|
|
1480
|
+
}
|
|
1481
|
+
push(token);
|
|
1482
|
+
}
|
|
1483
|
+
while (state.brackets > 0) {
|
|
1484
|
+
if (opts.strictBrackets === true) throw new SyntaxError(syntaxError("closing", "]"));
|
|
1485
|
+
state.output = utils.escapeLast(state.output, "[");
|
|
1486
|
+
decrement("brackets");
|
|
1487
|
+
}
|
|
1488
|
+
while (state.parens > 0) {
|
|
1489
|
+
if (opts.strictBrackets === true) throw new SyntaxError(syntaxError("closing", ")"));
|
|
1490
|
+
state.output = utils.escapeLast(state.output, "(");
|
|
1491
|
+
decrement("parens");
|
|
1492
|
+
}
|
|
1493
|
+
while (state.braces > 0) {
|
|
1494
|
+
if (opts.strictBrackets === true) throw new SyntaxError(syntaxError("closing", "}"));
|
|
1495
|
+
state.output = utils.escapeLast(state.output, "{");
|
|
1496
|
+
decrement("braces");
|
|
1497
|
+
}
|
|
1498
|
+
if (opts.strictSlashes !== true && (prev.type === "star" || prev.type === "bracket")) push({
|
|
1499
|
+
type: "maybe_slash",
|
|
1500
|
+
value: "",
|
|
1501
|
+
output: `${SLASH_LITERAL}?`
|
|
1502
|
+
});
|
|
1503
|
+
if (state.backtrack === true) {
|
|
1504
|
+
state.output = "";
|
|
1505
|
+
for (const token of state.tokens) {
|
|
1506
|
+
state.output += token.output != null ? token.output : token.value;
|
|
1507
|
+
if (token.suffix) state.output += token.suffix;
|
|
1508
|
+
}
|
|
1509
|
+
}
|
|
1510
|
+
return state;
|
|
1511
|
+
};
|
|
1512
|
+
/**
|
|
1513
|
+
* Fast paths for creating regular expressions for common glob patterns.
|
|
1514
|
+
* This can significantly speed up processing and has very little downside
|
|
1515
|
+
* impact when none of the fast paths match.
|
|
1516
|
+
*/
|
|
1517
|
+
parse.fastpaths = (input, options) => {
|
|
1518
|
+
const opts = { ...options };
|
|
1519
|
+
const max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
|
|
1520
|
+
const len = input.length;
|
|
1521
|
+
if (len > max) throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
|
|
1522
|
+
input = REPLACEMENTS[input] || input;
|
|
1523
|
+
const { DOT_LITERAL, SLASH_LITERAL, ONE_CHAR, DOTS_SLASH, NO_DOT, NO_DOTS, NO_DOTS_SLASH, STAR, START_ANCHOR } = constants.globChars(opts.windows);
|
|
1524
|
+
const nodot = opts.dot ? NO_DOTS : NO_DOT;
|
|
1525
|
+
const slashDot = opts.dot ? NO_DOTS_SLASH : NO_DOT;
|
|
1526
|
+
const capture = opts.capture ? "" : "?:";
|
|
1527
|
+
const state = {
|
|
1528
|
+
negated: false,
|
|
1529
|
+
prefix: ""
|
|
1530
|
+
};
|
|
1531
|
+
let star = opts.bash === true ? ".*?" : STAR;
|
|
1532
|
+
if (opts.capture) star = `(${star})`;
|
|
1533
|
+
const globstar = (opts) => {
|
|
1534
|
+
if (opts.noglobstar === true) return star;
|
|
1535
|
+
return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
|
|
1536
|
+
};
|
|
1537
|
+
const create = (str) => {
|
|
1538
|
+
switch (str) {
|
|
1539
|
+
case "*": return `${nodot}${ONE_CHAR}${star}`;
|
|
1540
|
+
case ".*": return `${DOT_LITERAL}${ONE_CHAR}${star}`;
|
|
1541
|
+
case "*.*": return `${nodot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;
|
|
1542
|
+
case "*/*": return `${nodot}${star}${SLASH_LITERAL}${ONE_CHAR}${slashDot}${star}`;
|
|
1543
|
+
case "**": return nodot + globstar(opts);
|
|
1544
|
+
case "**/*": return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${ONE_CHAR}${star}`;
|
|
1545
|
+
case "**/*.*": return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;
|
|
1546
|
+
case "**/.*": return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${DOT_LITERAL}${ONE_CHAR}${star}`;
|
|
1547
|
+
default: {
|
|
1548
|
+
const match = /^(.*?)\.(\w+)$/.exec(str);
|
|
1549
|
+
if (!match) return;
|
|
1550
|
+
const source = create(match[1]);
|
|
1551
|
+
if (!source) return;
|
|
1552
|
+
return source + DOT_LITERAL + match[2];
|
|
1553
|
+
}
|
|
1554
|
+
}
|
|
1555
|
+
};
|
|
1556
|
+
let source = create(utils.removePrefix(input, state));
|
|
1557
|
+
if (source && opts.strictSlashes !== true) source += `${SLASH_LITERAL}?`;
|
|
1558
|
+
return source;
|
|
1559
|
+
};
|
|
1560
|
+
module.exports = parse;
|
|
1561
|
+
}));
|
|
1562
|
+
//#endregion
|
|
1563
|
+
//#region ../../node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/lib/picomatch.js
|
|
1564
|
+
var require_picomatch$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1565
|
+
const scan = require_scan();
|
|
1566
|
+
const parse = require_parse$1();
|
|
1567
|
+
const utils = require_utils();
|
|
1568
|
+
const constants = require_constants$1();
|
|
1569
|
+
const isObject = (val) => val && typeof val === "object" && !Array.isArray(val);
|
|
1570
|
+
/**
|
|
1571
|
+
* Creates a matcher function from one or more glob patterns. The
|
|
1572
|
+
* returned function takes a string to match as its first argument,
|
|
1573
|
+
* and returns true if the string is a match. The returned matcher
|
|
1574
|
+
* function also takes a boolean as the second argument that, when true,
|
|
1575
|
+
* returns an object with additional information.
|
|
1576
|
+
*
|
|
1577
|
+
* ```js
|
|
1578
|
+
* const picomatch = require('picomatch');
|
|
1579
|
+
* // picomatch(glob[, options]);
|
|
1580
|
+
*
|
|
1581
|
+
* const isMatch = picomatch('*.!(*a)');
|
|
1582
|
+
* console.log(isMatch('a.a')); //=> false
|
|
1583
|
+
* console.log(isMatch('a.b')); //=> true
|
|
1584
|
+
* ```
|
|
1585
|
+
* @name picomatch
|
|
1586
|
+
* @param {String|Array} `globs` One or more glob patterns.
|
|
1587
|
+
* @param {Object=} `options`
|
|
1588
|
+
* @return {Function=} Returns a matcher function.
|
|
1589
|
+
* @api public
|
|
1590
|
+
*/
|
|
1591
|
+
const picomatch = (glob, options, returnState = false) => {
|
|
1592
|
+
if (Array.isArray(glob)) {
|
|
1593
|
+
const fns = glob.map((input) => picomatch(input, options, returnState));
|
|
1594
|
+
const arrayMatcher = (str) => {
|
|
1595
|
+
for (const isMatch of fns) {
|
|
1596
|
+
const state = isMatch(str);
|
|
1597
|
+
if (state) return state;
|
|
1598
|
+
}
|
|
1599
|
+
return false;
|
|
1600
|
+
};
|
|
1601
|
+
return arrayMatcher;
|
|
1602
|
+
}
|
|
1603
|
+
const isState = isObject(glob) && glob.tokens && glob.input;
|
|
1604
|
+
if (glob === "" || typeof glob !== "string" && !isState) throw new TypeError("Expected pattern to be a non-empty string");
|
|
1605
|
+
const opts = options || {};
|
|
1606
|
+
const posix = opts.windows;
|
|
1607
|
+
const regex = isState ? picomatch.compileRe(glob, options) : picomatch.makeRe(glob, options, false, true);
|
|
1608
|
+
const state = regex.state;
|
|
1609
|
+
delete regex.state;
|
|
1610
|
+
let isIgnored = () => false;
|
|
1611
|
+
if (opts.ignore) {
|
|
1612
|
+
const ignoreOpts = {
|
|
1613
|
+
...options,
|
|
1614
|
+
ignore: null,
|
|
1615
|
+
onMatch: null,
|
|
1616
|
+
onResult: null
|
|
1617
|
+
};
|
|
1618
|
+
isIgnored = picomatch(opts.ignore, ignoreOpts, returnState);
|
|
1619
|
+
}
|
|
1620
|
+
const matcher = (input, returnObject = false) => {
|
|
1621
|
+
const { isMatch, match, output } = picomatch.test(input, regex, options, {
|
|
1622
|
+
glob,
|
|
1623
|
+
posix
|
|
1624
|
+
});
|
|
1625
|
+
const result = {
|
|
1626
|
+
glob,
|
|
1627
|
+
state,
|
|
1628
|
+
regex,
|
|
1629
|
+
posix,
|
|
1630
|
+
input,
|
|
1631
|
+
output,
|
|
1632
|
+
match,
|
|
1633
|
+
isMatch
|
|
1634
|
+
};
|
|
1635
|
+
if (typeof opts.onResult === "function") opts.onResult(result);
|
|
1636
|
+
if (isMatch === false) {
|
|
1637
|
+
result.isMatch = false;
|
|
1638
|
+
return returnObject ? result : false;
|
|
1639
|
+
}
|
|
1640
|
+
if (isIgnored(input)) {
|
|
1641
|
+
if (typeof opts.onIgnore === "function") opts.onIgnore(result);
|
|
1642
|
+
result.isMatch = false;
|
|
1643
|
+
return returnObject ? result : false;
|
|
1644
|
+
}
|
|
1645
|
+
if (typeof opts.onMatch === "function") opts.onMatch(result);
|
|
1646
|
+
return returnObject ? result : true;
|
|
1647
|
+
};
|
|
1648
|
+
if (returnState) matcher.state = state;
|
|
1649
|
+
return matcher;
|
|
1650
|
+
};
|
|
1651
|
+
/**
|
|
1652
|
+
* Test `input` with the given `regex`. This is used by the main
|
|
1653
|
+
* `picomatch()` function to test the input string.
|
|
1654
|
+
*
|
|
1655
|
+
* ```js
|
|
1656
|
+
* const picomatch = require('picomatch');
|
|
1657
|
+
* // picomatch.test(input, regex[, options]);
|
|
1658
|
+
*
|
|
1659
|
+
* console.log(picomatch.test('foo/bar', /^(?:([^/]*?)\/([^/]*?))$/));
|
|
1660
|
+
* // { isMatch: true, match: [ 'foo/', 'foo', 'bar' ], output: 'foo/bar' }
|
|
1661
|
+
* ```
|
|
1662
|
+
* @param {String} `input` String to test.
|
|
1663
|
+
* @param {RegExp} `regex`
|
|
1664
|
+
* @return {Object} Returns an object with matching info.
|
|
1665
|
+
* @api public
|
|
1666
|
+
*/
|
|
1667
|
+
picomatch.test = (input, regex, options, { glob, posix } = {}) => {
|
|
1668
|
+
if (typeof input !== "string") throw new TypeError("Expected input to be a string");
|
|
1669
|
+
if (input === "") return {
|
|
1670
|
+
isMatch: false,
|
|
1671
|
+
output: ""
|
|
1672
|
+
};
|
|
1673
|
+
const opts = options || {};
|
|
1674
|
+
const format = opts.format || (posix ? utils.toPosixSlashes : null);
|
|
1675
|
+
let match = input === glob;
|
|
1676
|
+
let output = match && format ? format(input) : input;
|
|
1677
|
+
if (match === false) {
|
|
1678
|
+
output = format ? format(input) : input;
|
|
1679
|
+
match = output === glob;
|
|
1680
|
+
}
|
|
1681
|
+
if (match === false || opts.capture === true) if (opts.matchBase === true || opts.basename === true) match = picomatch.matchBase(input, regex, options, posix);
|
|
1682
|
+
else match = regex.exec(output);
|
|
1683
|
+
return {
|
|
1684
|
+
isMatch: Boolean(match),
|
|
1685
|
+
match,
|
|
1686
|
+
output
|
|
1687
|
+
};
|
|
1688
|
+
};
|
|
1689
|
+
/**
|
|
1690
|
+
* Match the basename of a filepath.
|
|
1691
|
+
*
|
|
1692
|
+
* ```js
|
|
1693
|
+
* const picomatch = require('picomatch');
|
|
1694
|
+
* // picomatch.matchBase(input, glob[, options]);
|
|
1695
|
+
* console.log(picomatch.matchBase('foo/bar.js', '*.js'); // true
|
|
1696
|
+
* ```
|
|
1697
|
+
* @param {String} `input` String to test.
|
|
1698
|
+
* @param {RegExp|String} `glob` Glob pattern or regex created by [.makeRe](#makeRe).
|
|
1699
|
+
* @return {Boolean}
|
|
1700
|
+
* @api public
|
|
1701
|
+
*/
|
|
1702
|
+
picomatch.matchBase = (input, glob, options) => {
|
|
1703
|
+
return (glob instanceof RegExp ? glob : picomatch.makeRe(glob, options)).test(utils.basename(input));
|
|
1704
|
+
};
|
|
1705
|
+
/**
|
|
1706
|
+
* Returns true if **any** of the given glob `patterns` match the specified `string`.
|
|
1707
|
+
*
|
|
1708
|
+
* ```js
|
|
1709
|
+
* const picomatch = require('picomatch');
|
|
1710
|
+
* // picomatch.isMatch(string, patterns[, options]);
|
|
1711
|
+
*
|
|
1712
|
+
* console.log(picomatch.isMatch('a.a', ['b.*', '*.a'])); //=> true
|
|
1713
|
+
* console.log(picomatch.isMatch('a.a', 'b.*')); //=> false
|
|
1714
|
+
* ```
|
|
1715
|
+
* @param {String|Array} str The string to test.
|
|
1716
|
+
* @param {String|Array} patterns One or more glob patterns to use for matching.
|
|
1717
|
+
* @param {Object} [options] See available [options](#options).
|
|
1718
|
+
* @return {Boolean} Returns true if any patterns match `str`
|
|
1719
|
+
* @api public
|
|
1720
|
+
*/
|
|
1721
|
+
picomatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str);
|
|
1722
|
+
/**
|
|
1723
|
+
* Parse a glob pattern to create the source string for a regular
|
|
1724
|
+
* expression.
|
|
1725
|
+
*
|
|
1726
|
+
* ```js
|
|
1727
|
+
* const picomatch = require('picomatch');
|
|
1728
|
+
* const result = picomatch.parse(pattern[, options]);
|
|
1729
|
+
* ```
|
|
1730
|
+
* @param {String} `pattern`
|
|
1731
|
+
* @param {Object} `options`
|
|
1732
|
+
* @return {Object} Returns an object with useful properties and output to be used as a regex source string.
|
|
1733
|
+
* @api public
|
|
1734
|
+
*/
|
|
1735
|
+
picomatch.parse = (pattern, options) => {
|
|
1736
|
+
if (Array.isArray(pattern)) return pattern.map((p) => picomatch.parse(p, options));
|
|
1737
|
+
return parse(pattern, {
|
|
1738
|
+
...options,
|
|
1739
|
+
fastpaths: false
|
|
1740
|
+
});
|
|
1741
|
+
};
|
|
1742
|
+
/**
|
|
1743
|
+
* Scan a glob pattern to separate the pattern into segments.
|
|
1744
|
+
*
|
|
1745
|
+
* ```js
|
|
1746
|
+
* const picomatch = require('picomatch');
|
|
1747
|
+
* // picomatch.scan(input[, options]);
|
|
1748
|
+
*
|
|
1749
|
+
* const result = picomatch.scan('!./foo/*.js');
|
|
1750
|
+
* console.log(result);
|
|
1751
|
+
* { prefix: '!./',
|
|
1752
|
+
* input: '!./foo/*.js',
|
|
1753
|
+
* start: 3,
|
|
1754
|
+
* base: 'foo',
|
|
1755
|
+
* glob: '*.js',
|
|
1756
|
+
* isBrace: false,
|
|
1757
|
+
* isBracket: false,
|
|
1758
|
+
* isGlob: true,
|
|
1759
|
+
* isExtglob: false,
|
|
1760
|
+
* isGlobstar: false,
|
|
1761
|
+
* negated: true }
|
|
1762
|
+
* ```
|
|
1763
|
+
* @param {String} `input` Glob pattern to scan.
|
|
1764
|
+
* @param {Object} `options`
|
|
1765
|
+
* @return {Object} Returns an object with
|
|
1766
|
+
* @api public
|
|
1767
|
+
*/
|
|
1768
|
+
picomatch.scan = (input, options) => scan(input, options);
|
|
1769
|
+
/**
|
|
1770
|
+
* Compile a regular expression from the `state` object returned by the
|
|
1771
|
+
* [parse()](#parse) method.
|
|
1772
|
+
*
|
|
1773
|
+
* ```js
|
|
1774
|
+
* const picomatch = require('picomatch');
|
|
1775
|
+
* const state = picomatch.parse('*.js');
|
|
1776
|
+
* // picomatch.compileRe(state[, options]);
|
|
1777
|
+
*
|
|
1778
|
+
* console.log(picomatch.compileRe(state));
|
|
1779
|
+
* //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/
|
|
1780
|
+
* ```
|
|
1781
|
+
* @param {Object} `state`
|
|
1782
|
+
* @param {Object} `options`
|
|
1783
|
+
* @param {Boolean} `returnOutput` Intended for implementors, this argument allows you to return the raw output from the parser.
|
|
1784
|
+
* @param {Boolean} `returnState` Adds the state to a `state` property on the returned regex. Useful for implementors and debugging.
|
|
1785
|
+
* @return {RegExp}
|
|
1786
|
+
* @api public
|
|
1787
|
+
*/
|
|
1788
|
+
picomatch.compileRe = (state, options, returnOutput = false, returnState = false) => {
|
|
1789
|
+
if (returnOutput === true) return state.output;
|
|
1790
|
+
const opts = options || {};
|
|
1791
|
+
const prepend = opts.contains ? "" : "^";
|
|
1792
|
+
const append = opts.contains ? "" : "$";
|
|
1793
|
+
let source = `${prepend}(?:${state.output})${append}`;
|
|
1794
|
+
if (state && state.negated === true) source = `^(?!${source}).*$`;
|
|
1795
|
+
const regex = picomatch.toRegex(source, options);
|
|
1796
|
+
if (returnState === true) regex.state = state;
|
|
1797
|
+
return regex;
|
|
1798
|
+
};
|
|
1799
|
+
/**
|
|
1800
|
+
* Create a regular expression from a parsed glob pattern.
|
|
1801
|
+
*
|
|
1802
|
+
* ```js
|
|
1803
|
+
* const picomatch = require('picomatch');
|
|
1804
|
+
* // picomatch.makeRe(state[, options]);
|
|
1805
|
+
*
|
|
1806
|
+
* const result = picomatch.makeRe('*.js');
|
|
1807
|
+
* console.log(result);
|
|
1808
|
+
* //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/
|
|
1809
|
+
* ```
|
|
1810
|
+
* @param {String} `state` The object returned from the `.parse` method.
|
|
1811
|
+
* @param {Object} `options`
|
|
1812
|
+
* @param {Boolean} `returnOutput` Implementors may use this argument to return the compiled output, instead of a regular expression. This is not exposed on the options to prevent end-users from mutating the result.
|
|
1813
|
+
* @param {Boolean} `returnState` Implementors may use this argument to return the state from the parsed glob with the returned regular expression.
|
|
1814
|
+
* @return {RegExp} Returns a regex created from the given pattern.
|
|
1815
|
+
* @api public
|
|
1816
|
+
*/
|
|
1817
|
+
picomatch.makeRe = (input, options = {}, returnOutput = false, returnState = false) => {
|
|
1818
|
+
if (!input || typeof input !== "string") throw new TypeError("Expected a non-empty string");
|
|
1819
|
+
let parsed = {
|
|
1820
|
+
negated: false,
|
|
1821
|
+
fastpaths: true
|
|
1822
|
+
};
|
|
1823
|
+
if (options.fastpaths !== false && (input[0] === "." || input[0] === "*")) parsed.output = parse.fastpaths(input, options);
|
|
1824
|
+
if (!parsed.output) parsed = parse(input, options);
|
|
1825
|
+
return picomatch.compileRe(parsed, options, returnOutput, returnState);
|
|
1826
|
+
};
|
|
1827
|
+
/**
|
|
1828
|
+
* Create a regular expression from the given regex source string.
|
|
1829
|
+
*
|
|
1830
|
+
* ```js
|
|
1831
|
+
* const picomatch = require('picomatch');
|
|
1832
|
+
* // picomatch.toRegex(source[, options]);
|
|
1833
|
+
*
|
|
1834
|
+
* const { output } = picomatch.parse('*.js');
|
|
1835
|
+
* console.log(picomatch.toRegex(output));
|
|
1836
|
+
* //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/
|
|
1837
|
+
* ```
|
|
1838
|
+
* @param {String} `source` Regular expression source string.
|
|
1839
|
+
* @param {Object} `options`
|
|
1840
|
+
* @return {RegExp}
|
|
1841
|
+
* @api public
|
|
1842
|
+
*/
|
|
1843
|
+
picomatch.toRegex = (source, options) => {
|
|
1844
|
+
try {
|
|
1845
|
+
const opts = options || {};
|
|
1846
|
+
return new RegExp(source, opts.flags || (opts.nocase ? "i" : ""));
|
|
1847
|
+
} catch (err) {
|
|
1848
|
+
if (options && options.debug === true) throw err;
|
|
1849
|
+
return /$^/;
|
|
1850
|
+
}
|
|
1851
|
+
};
|
|
1852
|
+
/**
|
|
1853
|
+
* Picomatch constants.
|
|
1854
|
+
* @return {Object}
|
|
1855
|
+
*/
|
|
1856
|
+
picomatch.constants = constants;
|
|
1857
|
+
/**
|
|
1858
|
+
* Expose "picomatch"
|
|
1859
|
+
*/
|
|
1860
|
+
module.exports = picomatch;
|
|
1861
|
+
}));
|
|
1862
|
+
//#endregion
|
|
1863
|
+
//#region ../../node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/index.js
|
|
1864
|
+
var require_picomatch = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1865
|
+
const pico = require_picomatch$1();
|
|
1866
|
+
const utils = require_utils();
|
|
1867
|
+
function picomatch(glob, options, returnState = false) {
|
|
1868
|
+
if (options && (options.windows === null || options.windows === void 0)) options = {
|
|
1869
|
+
...options,
|
|
1870
|
+
windows: utils.isWindows()
|
|
1871
|
+
};
|
|
1872
|
+
return pico(glob, options, returnState);
|
|
1873
|
+
}
|
|
1874
|
+
Object.assign(picomatch, pico);
|
|
1875
|
+
module.exports = picomatch;
|
|
1876
|
+
}));
|
|
1877
|
+
//#endregion
|
|
1878
|
+
//#region ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/constants.js
|
|
1879
|
+
var require_constants = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1880
|
+
const SEMVER_SPEC_VERSION = "2.0.0";
|
|
1881
|
+
const MAX_LENGTH = 256;
|
|
1882
|
+
const MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || 9007199254740991;
|
|
1883
|
+
module.exports = {
|
|
1884
|
+
MAX_LENGTH,
|
|
1885
|
+
MAX_SAFE_COMPONENT_LENGTH: 16,
|
|
1886
|
+
MAX_SAFE_BUILD_LENGTH: MAX_LENGTH - 6,
|
|
1887
|
+
MAX_SAFE_INTEGER,
|
|
1888
|
+
RELEASE_TYPES: [
|
|
1889
|
+
"major",
|
|
1890
|
+
"premajor",
|
|
1891
|
+
"minor",
|
|
1892
|
+
"preminor",
|
|
1893
|
+
"patch",
|
|
1894
|
+
"prepatch",
|
|
1895
|
+
"prerelease"
|
|
1896
|
+
],
|
|
1897
|
+
SEMVER_SPEC_VERSION,
|
|
1898
|
+
FLAG_INCLUDE_PRERELEASE: 1,
|
|
1899
|
+
FLAG_LOOSE: 2
|
|
1900
|
+
};
|
|
1901
|
+
}));
|
|
1902
|
+
//#endregion
|
|
1903
|
+
//#region ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/debug.js
|
|
1904
|
+
var require_debug = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1905
|
+
module.exports = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => {};
|
|
1906
|
+
}));
|
|
1907
|
+
//#endregion
|
|
1908
|
+
//#region ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/re.js
|
|
1909
|
+
var require_re = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1910
|
+
const { MAX_SAFE_COMPONENT_LENGTH, MAX_SAFE_BUILD_LENGTH, MAX_LENGTH } = require_constants();
|
|
1911
|
+
const debug = require_debug();
|
|
1912
|
+
exports = module.exports = {};
|
|
1913
|
+
const re = exports.re = [];
|
|
1914
|
+
const safeRe = exports.safeRe = [];
|
|
1915
|
+
const src = exports.src = [];
|
|
1916
|
+
const safeSrc = exports.safeSrc = [];
|
|
1917
|
+
const t = exports.t = {};
|
|
1918
|
+
let R = 0;
|
|
1919
|
+
const LETTERDASHNUMBER = "[a-zA-Z0-9-]";
|
|
1920
|
+
const safeRegexReplacements = [
|
|
1921
|
+
["\\s", 1],
|
|
1922
|
+
["\\d", MAX_LENGTH],
|
|
1923
|
+
[LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH]
|
|
1924
|
+
];
|
|
1925
|
+
const makeSafeRegex = (value) => {
|
|
1926
|
+
for (const [token, max] of safeRegexReplacements) value = value.split(`${token}*`).join(`${token}{0,${max}}`).split(`${token}+`).join(`${token}{1,${max}}`);
|
|
1927
|
+
return value;
|
|
1928
|
+
};
|
|
1929
|
+
const createToken = (name, value, isGlobal) => {
|
|
1930
|
+
const safe = makeSafeRegex(value);
|
|
1931
|
+
const index = R++;
|
|
1932
|
+
debug(name, index, value);
|
|
1933
|
+
t[name] = index;
|
|
1934
|
+
src[index] = value;
|
|
1935
|
+
safeSrc[index] = safe;
|
|
1936
|
+
re[index] = new RegExp(value, isGlobal ? "g" : void 0);
|
|
1937
|
+
safeRe[index] = new RegExp(safe, isGlobal ? "g" : void 0);
|
|
1938
|
+
};
|
|
1939
|
+
createToken("NUMERICIDENTIFIER", "0|[1-9]\\d*");
|
|
1940
|
+
createToken("NUMERICIDENTIFIERLOOSE", "\\d+");
|
|
1941
|
+
createToken("NONNUMERICIDENTIFIER", `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`);
|
|
1942
|
+
createToken("MAINVERSION", `(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})`);
|
|
1943
|
+
createToken("MAINVERSIONLOOSE", `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})`);
|
|
1944
|
+
createToken("PRERELEASEIDENTIFIER", `(?:${src[t.NONNUMERICIDENTIFIER]}|${src[t.NUMERICIDENTIFIER]})`);
|
|
1945
|
+
createToken("PRERELEASEIDENTIFIERLOOSE", `(?:${src[t.NONNUMERICIDENTIFIER]}|${src[t.NUMERICIDENTIFIERLOOSE]})`);
|
|
1946
|
+
createToken("PRERELEASE", `(?:-(${src[t.PRERELEASEIDENTIFIER]}(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`);
|
|
1947
|
+
createToken("PRERELEASELOOSE", `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`);
|
|
1948
|
+
createToken("BUILDIDENTIFIER", `${LETTERDASHNUMBER}+`);
|
|
1949
|
+
createToken("BUILD", `(?:\\+(${src[t.BUILDIDENTIFIER]}(?:\\.${src[t.BUILDIDENTIFIER]})*))`);
|
|
1950
|
+
createToken("FULLPLAIN", `v?${src[t.MAINVERSION]}${src[t.PRERELEASE]}?${src[t.BUILD]}?`);
|
|
1951
|
+
createToken("FULL", `^${src[t.FULLPLAIN]}$`);
|
|
1952
|
+
createToken("LOOSEPLAIN", `[v=\\s]*${src[t.MAINVERSIONLOOSE]}${src[t.PRERELEASELOOSE]}?${src[t.BUILD]}?`);
|
|
1953
|
+
createToken("LOOSE", `^${src[t.LOOSEPLAIN]}$`);
|
|
1954
|
+
createToken("GTLT", "((?:<|>)?=?)");
|
|
1955
|
+
createToken("XRANGEIDENTIFIERLOOSE", `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);
|
|
1956
|
+
createToken("XRANGEIDENTIFIER", `${src[t.NUMERICIDENTIFIER]}|x|X|\\*`);
|
|
1957
|
+
createToken("XRANGEPLAIN", `[v=\\s]*(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:${src[t.PRERELEASE]})?${src[t.BUILD]}?)?)?`);
|
|
1958
|
+
createToken("XRANGEPLAINLOOSE", `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:${src[t.PRERELEASELOOSE]})?${src[t.BUILD]}?)?)?`);
|
|
1959
|
+
createToken("XRANGE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`);
|
|
1960
|
+
createToken("XRANGELOOSE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`);
|
|
1961
|
+
createToken("COERCEPLAIN", `(^|[^\\d])(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}})(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`);
|
|
1962
|
+
createToken("COERCE", `${src[t.COERCEPLAIN]}(?:$|[^\\d])`);
|
|
1963
|
+
createToken("COERCEFULL", src[t.COERCEPLAIN] + `(?:${src[t.PRERELEASE]})?(?:${src[t.BUILD]})?(?:$|[^\\d])`);
|
|
1964
|
+
createToken("COERCERTL", src[t.COERCE], true);
|
|
1965
|
+
createToken("COERCERTLFULL", src[t.COERCEFULL], true);
|
|
1966
|
+
createToken("LONETILDE", "(?:~>?)");
|
|
1967
|
+
createToken("TILDETRIM", `(\\s*)${src[t.LONETILDE]}\\s+`, true);
|
|
1968
|
+
exports.tildeTrimReplace = "$1~";
|
|
1969
|
+
createToken("TILDE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`);
|
|
1970
|
+
createToken("TILDELOOSE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`);
|
|
1971
|
+
createToken("LONECARET", "(?:\\^)");
|
|
1972
|
+
createToken("CARETTRIM", `(\\s*)${src[t.LONECARET]}\\s+`, true);
|
|
1973
|
+
exports.caretTrimReplace = "$1^";
|
|
1974
|
+
createToken("CARET", `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`);
|
|
1975
|
+
createToken("CARETLOOSE", `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`);
|
|
1976
|
+
createToken("COMPARATORLOOSE", `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`);
|
|
1977
|
+
createToken("COMPARATOR", `^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`);
|
|
1978
|
+
createToken("COMPARATORTRIM", `(\\s*)${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true);
|
|
1979
|
+
exports.comparatorTrimReplace = "$1$2$3";
|
|
1980
|
+
createToken("HYPHENRANGE", `^\\s*(${src[t.XRANGEPLAIN]})\\s+-\\s+(${src[t.XRANGEPLAIN]})\\s*$`);
|
|
1981
|
+
createToken("HYPHENRANGELOOSE", `^\\s*(${src[t.XRANGEPLAINLOOSE]})\\s+-\\s+(${src[t.XRANGEPLAINLOOSE]})\\s*$`);
|
|
1982
|
+
createToken("STAR", "(<|>)?=?\\s*\\*");
|
|
1983
|
+
createToken("GTE0", "^\\s*>=\\s*0\\.0\\.0\\s*$");
|
|
1984
|
+
createToken("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$");
|
|
1985
|
+
}));
|
|
1986
|
+
//#endregion
|
|
1987
|
+
//#region ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/parse-options.js
|
|
1988
|
+
var require_parse_options = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1989
|
+
const looseOption = Object.freeze({ loose: true });
|
|
1990
|
+
const emptyOpts = Object.freeze({});
|
|
1991
|
+
const parseOptions = (options) => {
|
|
1992
|
+
if (!options) return emptyOpts;
|
|
1993
|
+
if (typeof options !== "object") return looseOption;
|
|
1994
|
+
return options;
|
|
1995
|
+
};
|
|
1996
|
+
module.exports = parseOptions;
|
|
1997
|
+
}));
|
|
1998
|
+
//#endregion
|
|
1999
|
+
//#region ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/identifiers.js
|
|
2000
|
+
var require_identifiers = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2001
|
+
const numeric = /^[0-9]+$/;
|
|
2002
|
+
const compareIdentifiers = (a, b) => {
|
|
2003
|
+
if (typeof a === "number" && typeof b === "number") return a === b ? 0 : a < b ? -1 : 1;
|
|
2004
|
+
const anum = numeric.test(a);
|
|
2005
|
+
const bnum = numeric.test(b);
|
|
2006
|
+
if (anum && bnum) {
|
|
2007
|
+
a = +a;
|
|
2008
|
+
b = +b;
|
|
2009
|
+
}
|
|
2010
|
+
return a === b ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a < b ? -1 : 1;
|
|
2011
|
+
};
|
|
2012
|
+
const rcompareIdentifiers = (a, b) => compareIdentifiers(b, a);
|
|
2013
|
+
module.exports = {
|
|
2014
|
+
compareIdentifiers,
|
|
2015
|
+
rcompareIdentifiers
|
|
2016
|
+
};
|
|
2017
|
+
}));
|
|
2018
|
+
//#endregion
|
|
2019
|
+
//#region ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/classes/semver.js
|
|
2020
|
+
var require_semver$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2021
|
+
const debug = require_debug();
|
|
2022
|
+
const { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants();
|
|
2023
|
+
const { safeRe: re, t } = require_re();
|
|
2024
|
+
const parseOptions = require_parse_options();
|
|
2025
|
+
const { compareIdentifiers } = require_identifiers();
|
|
2026
|
+
module.exports = class SemVer {
|
|
2027
|
+
constructor(version, options) {
|
|
2028
|
+
options = parseOptions(options);
|
|
2029
|
+
if (version instanceof SemVer) if (version.loose === !!options.loose && version.includePrerelease === !!options.includePrerelease) return version;
|
|
2030
|
+
else version = version.version;
|
|
2031
|
+
else if (typeof version !== "string") throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version}".`);
|
|
2032
|
+
if (version.length > MAX_LENGTH) throw new TypeError(`version is longer than ${MAX_LENGTH} characters`);
|
|
2033
|
+
debug("SemVer", version, options);
|
|
2034
|
+
this.options = options;
|
|
2035
|
+
this.loose = !!options.loose;
|
|
2036
|
+
this.includePrerelease = !!options.includePrerelease;
|
|
2037
|
+
const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]);
|
|
2038
|
+
if (!m) throw new TypeError(`Invalid Version: ${version}`);
|
|
2039
|
+
this.raw = version;
|
|
2040
|
+
this.major = +m[1];
|
|
2041
|
+
this.minor = +m[2];
|
|
2042
|
+
this.patch = +m[3];
|
|
2043
|
+
if (this.major > MAX_SAFE_INTEGER || this.major < 0) throw new TypeError("Invalid major version");
|
|
2044
|
+
if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) throw new TypeError("Invalid minor version");
|
|
2045
|
+
if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) throw new TypeError("Invalid patch version");
|
|
2046
|
+
if (!m[4]) this.prerelease = [];
|
|
2047
|
+
else this.prerelease = m[4].split(".").map((id) => {
|
|
2048
|
+
if (/^[0-9]+$/.test(id)) {
|
|
2049
|
+
const num = +id;
|
|
2050
|
+
if (num >= 0 && num < MAX_SAFE_INTEGER) return num;
|
|
2051
|
+
}
|
|
2052
|
+
return id;
|
|
2053
|
+
});
|
|
2054
|
+
this.build = m[5] ? m[5].split(".") : [];
|
|
2055
|
+
this.format();
|
|
2056
|
+
}
|
|
2057
|
+
format() {
|
|
2058
|
+
this.version = `${this.major}.${this.minor}.${this.patch}`;
|
|
2059
|
+
if (this.prerelease.length) this.version += `-${this.prerelease.join(".")}`;
|
|
2060
|
+
return this.version;
|
|
2061
|
+
}
|
|
2062
|
+
toString() {
|
|
2063
|
+
return this.version;
|
|
2064
|
+
}
|
|
2065
|
+
compare(other) {
|
|
2066
|
+
debug("SemVer.compare", this.version, this.options, other);
|
|
2067
|
+
if (!(other instanceof SemVer)) {
|
|
2068
|
+
if (typeof other === "string" && other === this.version) return 0;
|
|
2069
|
+
other = new SemVer(other, this.options);
|
|
2070
|
+
}
|
|
2071
|
+
if (other.version === this.version) return 0;
|
|
2072
|
+
return this.compareMain(other) || this.comparePre(other);
|
|
2073
|
+
}
|
|
2074
|
+
compareMain(other) {
|
|
2075
|
+
if (!(other instanceof SemVer)) other = new SemVer(other, this.options);
|
|
2076
|
+
if (this.major < other.major) return -1;
|
|
2077
|
+
if (this.major > other.major) return 1;
|
|
2078
|
+
if (this.minor < other.minor) return -1;
|
|
2079
|
+
if (this.minor > other.minor) return 1;
|
|
2080
|
+
if (this.patch < other.patch) return -1;
|
|
2081
|
+
if (this.patch > other.patch) return 1;
|
|
2082
|
+
return 0;
|
|
2083
|
+
}
|
|
2084
|
+
comparePre(other) {
|
|
2085
|
+
if (!(other instanceof SemVer)) other = new SemVer(other, this.options);
|
|
2086
|
+
if (this.prerelease.length && !other.prerelease.length) return -1;
|
|
2087
|
+
else if (!this.prerelease.length && other.prerelease.length) return 1;
|
|
2088
|
+
else if (!this.prerelease.length && !other.prerelease.length) return 0;
|
|
2089
|
+
let i = 0;
|
|
2090
|
+
do {
|
|
2091
|
+
const a = this.prerelease[i];
|
|
2092
|
+
const b = other.prerelease[i];
|
|
2093
|
+
debug("prerelease compare", i, a, b);
|
|
2094
|
+
if (a === void 0 && b === void 0) return 0;
|
|
2095
|
+
else if (b === void 0) return 1;
|
|
2096
|
+
else if (a === void 0) return -1;
|
|
2097
|
+
else if (a === b) continue;
|
|
2098
|
+
else return compareIdentifiers(a, b);
|
|
2099
|
+
} while (++i);
|
|
2100
|
+
}
|
|
2101
|
+
compareBuild(other) {
|
|
2102
|
+
if (!(other instanceof SemVer)) other = new SemVer(other, this.options);
|
|
2103
|
+
let i = 0;
|
|
2104
|
+
do {
|
|
2105
|
+
const a = this.build[i];
|
|
2106
|
+
const b = other.build[i];
|
|
2107
|
+
debug("build compare", i, a, b);
|
|
2108
|
+
if (a === void 0 && b === void 0) return 0;
|
|
2109
|
+
else if (b === void 0) return 1;
|
|
2110
|
+
else if (a === void 0) return -1;
|
|
2111
|
+
else if (a === b) continue;
|
|
2112
|
+
else return compareIdentifiers(a, b);
|
|
2113
|
+
} while (++i);
|
|
2114
|
+
}
|
|
2115
|
+
inc(release, identifier, identifierBase) {
|
|
2116
|
+
if (release.startsWith("pre")) {
|
|
2117
|
+
if (!identifier && identifierBase === false) throw new Error("invalid increment argument: identifier is empty");
|
|
2118
|
+
if (identifier) {
|
|
2119
|
+
const match = `-${identifier}`.match(this.options.loose ? re[t.PRERELEASELOOSE] : re[t.PRERELEASE]);
|
|
2120
|
+
if (!match || match[1] !== identifier) throw new Error(`invalid identifier: ${identifier}`);
|
|
2121
|
+
}
|
|
2122
|
+
}
|
|
2123
|
+
switch (release) {
|
|
2124
|
+
case "premajor":
|
|
2125
|
+
this.prerelease.length = 0;
|
|
2126
|
+
this.patch = 0;
|
|
2127
|
+
this.minor = 0;
|
|
2128
|
+
this.major++;
|
|
2129
|
+
this.inc("pre", identifier, identifierBase);
|
|
2130
|
+
break;
|
|
2131
|
+
case "preminor":
|
|
2132
|
+
this.prerelease.length = 0;
|
|
2133
|
+
this.patch = 0;
|
|
2134
|
+
this.minor++;
|
|
2135
|
+
this.inc("pre", identifier, identifierBase);
|
|
2136
|
+
break;
|
|
2137
|
+
case "prepatch":
|
|
2138
|
+
this.prerelease.length = 0;
|
|
2139
|
+
this.inc("patch", identifier, identifierBase);
|
|
2140
|
+
this.inc("pre", identifier, identifierBase);
|
|
2141
|
+
break;
|
|
2142
|
+
case "prerelease":
|
|
2143
|
+
if (this.prerelease.length === 0) this.inc("patch", identifier, identifierBase);
|
|
2144
|
+
this.inc("pre", identifier, identifierBase);
|
|
2145
|
+
break;
|
|
2146
|
+
case "release":
|
|
2147
|
+
if (this.prerelease.length === 0) throw new Error(`version ${this.raw} is not a prerelease`);
|
|
2148
|
+
this.prerelease.length = 0;
|
|
2149
|
+
break;
|
|
2150
|
+
case "major":
|
|
2151
|
+
if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) this.major++;
|
|
2152
|
+
this.minor = 0;
|
|
2153
|
+
this.patch = 0;
|
|
2154
|
+
this.prerelease = [];
|
|
2155
|
+
break;
|
|
2156
|
+
case "minor":
|
|
2157
|
+
if (this.patch !== 0 || this.prerelease.length === 0) this.minor++;
|
|
2158
|
+
this.patch = 0;
|
|
2159
|
+
this.prerelease = [];
|
|
2160
|
+
break;
|
|
2161
|
+
case "patch":
|
|
2162
|
+
if (this.prerelease.length === 0) this.patch++;
|
|
2163
|
+
this.prerelease = [];
|
|
2164
|
+
break;
|
|
2165
|
+
case "pre": {
|
|
2166
|
+
const base = Number(identifierBase) ? 1 : 0;
|
|
2167
|
+
if (this.prerelease.length === 0) this.prerelease = [base];
|
|
2168
|
+
else {
|
|
2169
|
+
let i = this.prerelease.length;
|
|
2170
|
+
while (--i >= 0) if (typeof this.prerelease[i] === "number") {
|
|
2171
|
+
this.prerelease[i]++;
|
|
2172
|
+
i = -2;
|
|
2173
|
+
}
|
|
2174
|
+
if (i === -1) {
|
|
2175
|
+
if (identifier === this.prerelease.join(".") && identifierBase === false) throw new Error("invalid increment argument: identifier already exists");
|
|
2176
|
+
this.prerelease.push(base);
|
|
2177
|
+
}
|
|
2178
|
+
}
|
|
2179
|
+
if (identifier) {
|
|
2180
|
+
let prerelease = [identifier, base];
|
|
2181
|
+
if (identifierBase === false) prerelease = [identifier];
|
|
2182
|
+
if (compareIdentifiers(this.prerelease[0], identifier) === 0) {
|
|
2183
|
+
if (isNaN(this.prerelease[1])) this.prerelease = prerelease;
|
|
2184
|
+
} else this.prerelease = prerelease;
|
|
2185
|
+
}
|
|
2186
|
+
break;
|
|
2187
|
+
}
|
|
2188
|
+
default: throw new Error(`invalid increment argument: ${release}`);
|
|
2189
|
+
}
|
|
2190
|
+
this.raw = this.format();
|
|
2191
|
+
if (this.build.length) this.raw += `+${this.build.join(".")}`;
|
|
2192
|
+
return this;
|
|
2193
|
+
}
|
|
2194
|
+
};
|
|
2195
|
+
}));
|
|
2196
|
+
//#endregion
|
|
2197
|
+
//#region ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/parse.js
|
|
2198
|
+
var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2199
|
+
const SemVer = require_semver$1();
|
|
2200
|
+
const parse = (version, options, throwErrors = false) => {
|
|
2201
|
+
if (version instanceof SemVer) return version;
|
|
2202
|
+
try {
|
|
2203
|
+
return new SemVer(version, options);
|
|
2204
|
+
} catch (er) {
|
|
2205
|
+
if (!throwErrors) return null;
|
|
2206
|
+
throw er;
|
|
2207
|
+
}
|
|
2208
|
+
};
|
|
2209
|
+
module.exports = parse;
|
|
2210
|
+
}));
|
|
2211
|
+
//#endregion
|
|
2212
|
+
//#region ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/valid.js
|
|
2213
|
+
var require_valid$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2214
|
+
const parse = require_parse();
|
|
2215
|
+
const valid = (version, options) => {
|
|
2216
|
+
const v = parse(version, options);
|
|
2217
|
+
return v ? v.version : null;
|
|
2218
|
+
};
|
|
2219
|
+
module.exports = valid;
|
|
2220
|
+
}));
|
|
2221
|
+
//#endregion
|
|
2222
|
+
//#region ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/clean.js
|
|
2223
|
+
var require_clean = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2224
|
+
const parse = require_parse();
|
|
2225
|
+
const clean = (version, options) => {
|
|
2226
|
+
const s = parse(version.trim().replace(/^[=v]+/, ""), options);
|
|
2227
|
+
return s ? s.version : null;
|
|
2228
|
+
};
|
|
2229
|
+
module.exports = clean;
|
|
2230
|
+
}));
|
|
2231
|
+
//#endregion
|
|
2232
|
+
//#region ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/inc.js
|
|
2233
|
+
var require_inc = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2234
|
+
const SemVer = require_semver$1();
|
|
2235
|
+
const inc = (version, release, options, identifier, identifierBase) => {
|
|
2236
|
+
if (typeof options === "string") {
|
|
2237
|
+
identifierBase = identifier;
|
|
2238
|
+
identifier = options;
|
|
2239
|
+
options = void 0;
|
|
2240
|
+
}
|
|
2241
|
+
try {
|
|
2242
|
+
return new SemVer(version instanceof SemVer ? version.version : version, options).inc(release, identifier, identifierBase).version;
|
|
2243
|
+
} catch (er) {
|
|
2244
|
+
return null;
|
|
2245
|
+
}
|
|
2246
|
+
};
|
|
2247
|
+
module.exports = inc;
|
|
2248
|
+
}));
|
|
2249
|
+
//#endregion
|
|
2250
|
+
//#region ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/diff.js
|
|
2251
|
+
var require_diff = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2252
|
+
const parse = require_parse();
|
|
2253
|
+
const diff = (version1, version2) => {
|
|
2254
|
+
const v1 = parse(version1, null, true);
|
|
2255
|
+
const v2 = parse(version2, null, true);
|
|
2256
|
+
const comparison = v1.compare(v2);
|
|
2257
|
+
if (comparison === 0) return null;
|
|
2258
|
+
const v1Higher = comparison > 0;
|
|
2259
|
+
const highVersion = v1Higher ? v1 : v2;
|
|
2260
|
+
const lowVersion = v1Higher ? v2 : v1;
|
|
2261
|
+
const highHasPre = !!highVersion.prerelease.length;
|
|
2262
|
+
if (!!lowVersion.prerelease.length && !highHasPre) {
|
|
2263
|
+
if (!lowVersion.patch && !lowVersion.minor) return "major";
|
|
2264
|
+
if (lowVersion.compareMain(highVersion) === 0) {
|
|
2265
|
+
if (lowVersion.minor && !lowVersion.patch) return "minor";
|
|
2266
|
+
return "patch";
|
|
2267
|
+
}
|
|
2268
|
+
}
|
|
2269
|
+
const prefix = highHasPre ? "pre" : "";
|
|
2270
|
+
if (v1.major !== v2.major) return prefix + "major";
|
|
2271
|
+
if (v1.minor !== v2.minor) return prefix + "minor";
|
|
2272
|
+
if (v1.patch !== v2.patch) return prefix + "patch";
|
|
2273
|
+
return "prerelease";
|
|
2274
|
+
};
|
|
2275
|
+
module.exports = diff;
|
|
2276
|
+
}));
|
|
2277
|
+
//#endregion
|
|
2278
|
+
//#region ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/major.js
|
|
2279
|
+
var require_major = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2280
|
+
const SemVer = require_semver$1();
|
|
2281
|
+
const major = (a, loose) => new SemVer(a, loose).major;
|
|
2282
|
+
module.exports = major;
|
|
2283
|
+
}));
|
|
2284
|
+
//#endregion
|
|
2285
|
+
//#region ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/minor.js
|
|
2286
|
+
var require_minor = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2287
|
+
const SemVer = require_semver$1();
|
|
2288
|
+
const minor = (a, loose) => new SemVer(a, loose).minor;
|
|
2289
|
+
module.exports = minor;
|
|
2290
|
+
}));
|
|
2291
|
+
//#endregion
|
|
2292
|
+
//#region ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/patch.js
|
|
2293
|
+
var require_patch = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2294
|
+
const SemVer = require_semver$1();
|
|
2295
|
+
const patch = (a, loose) => new SemVer(a, loose).patch;
|
|
2296
|
+
module.exports = patch;
|
|
2297
|
+
}));
|
|
2298
|
+
//#endregion
|
|
2299
|
+
//#region ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/prerelease.js
|
|
2300
|
+
var require_prerelease = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2301
|
+
const parse = require_parse();
|
|
2302
|
+
const prerelease = (version, options) => {
|
|
2303
|
+
const parsed = parse(version, options);
|
|
2304
|
+
return parsed && parsed.prerelease.length ? parsed.prerelease : null;
|
|
2305
|
+
};
|
|
2306
|
+
module.exports = prerelease;
|
|
2307
|
+
}));
|
|
2308
|
+
//#endregion
|
|
2309
|
+
//#region ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/compare.js
|
|
2310
|
+
var require_compare = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2311
|
+
const SemVer = require_semver$1();
|
|
2312
|
+
const compare = (a, b, loose) => new SemVer(a, loose).compare(new SemVer(b, loose));
|
|
2313
|
+
module.exports = compare;
|
|
2314
|
+
}));
|
|
2315
|
+
//#endregion
|
|
2316
|
+
//#region ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/rcompare.js
|
|
2317
|
+
var require_rcompare = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2318
|
+
const compare = require_compare();
|
|
2319
|
+
const rcompare = (a, b, loose) => compare(b, a, loose);
|
|
2320
|
+
module.exports = rcompare;
|
|
2321
|
+
}));
|
|
2322
|
+
//#endregion
|
|
2323
|
+
//#region ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/compare-loose.js
|
|
2324
|
+
var require_compare_loose = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2325
|
+
const compare = require_compare();
|
|
2326
|
+
const compareLoose = (a, b) => compare(a, b, true);
|
|
2327
|
+
module.exports = compareLoose;
|
|
2328
|
+
}));
|
|
2329
|
+
//#endregion
|
|
2330
|
+
//#region ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/compare-build.js
|
|
2331
|
+
var require_compare_build = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2332
|
+
const SemVer = require_semver$1();
|
|
2333
|
+
const compareBuild = (a, b, loose) => {
|
|
2334
|
+
const versionA = new SemVer(a, loose);
|
|
2335
|
+
const versionB = new SemVer(b, loose);
|
|
2336
|
+
return versionA.compare(versionB) || versionA.compareBuild(versionB);
|
|
2337
|
+
};
|
|
2338
|
+
module.exports = compareBuild;
|
|
2339
|
+
}));
|
|
2340
|
+
//#endregion
|
|
2341
|
+
//#region ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/sort.js
|
|
2342
|
+
var require_sort = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2343
|
+
const compareBuild = require_compare_build();
|
|
2344
|
+
const sort = (list, loose) => list.sort((a, b) => compareBuild(a, b, loose));
|
|
2345
|
+
module.exports = sort;
|
|
2346
|
+
}));
|
|
2347
|
+
//#endregion
|
|
2348
|
+
//#region ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/rsort.js
|
|
2349
|
+
var require_rsort = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2350
|
+
const compareBuild = require_compare_build();
|
|
2351
|
+
const rsort = (list, loose) => list.sort((a, b) => compareBuild(b, a, loose));
|
|
2352
|
+
module.exports = rsort;
|
|
2353
|
+
}));
|
|
2354
|
+
//#endregion
|
|
2355
|
+
//#region ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/gt.js
|
|
2356
|
+
var require_gt = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2357
|
+
const compare = require_compare();
|
|
2358
|
+
const gt = (a, b, loose) => compare(a, b, loose) > 0;
|
|
2359
|
+
module.exports = gt;
|
|
2360
|
+
}));
|
|
2361
|
+
//#endregion
|
|
2362
|
+
//#region ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/lt.js
|
|
2363
|
+
var require_lt = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2364
|
+
const compare = require_compare();
|
|
2365
|
+
const lt = (a, b, loose) => compare(a, b, loose) < 0;
|
|
2366
|
+
module.exports = lt;
|
|
2367
|
+
}));
|
|
2368
|
+
//#endregion
|
|
2369
|
+
//#region ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/eq.js
|
|
2370
|
+
var require_eq = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2371
|
+
const compare = require_compare();
|
|
2372
|
+
const eq = (a, b, loose) => compare(a, b, loose) === 0;
|
|
2373
|
+
module.exports = eq;
|
|
2374
|
+
}));
|
|
2375
|
+
//#endregion
|
|
2376
|
+
//#region ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/neq.js
|
|
2377
|
+
var require_neq = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2378
|
+
const compare = require_compare();
|
|
2379
|
+
const neq = (a, b, loose) => compare(a, b, loose) !== 0;
|
|
2380
|
+
module.exports = neq;
|
|
2381
|
+
}));
|
|
2382
|
+
//#endregion
|
|
2383
|
+
//#region ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/gte.js
|
|
2384
|
+
var require_gte = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2385
|
+
const compare = require_compare();
|
|
2386
|
+
const gte = (a, b, loose) => compare(a, b, loose) >= 0;
|
|
2387
|
+
module.exports = gte;
|
|
2388
|
+
}));
|
|
2389
|
+
//#endregion
|
|
2390
|
+
//#region ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/lte.js
|
|
2391
|
+
var require_lte = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2392
|
+
const compare = require_compare();
|
|
2393
|
+
const lte = (a, b, loose) => compare(a, b, loose) <= 0;
|
|
2394
|
+
module.exports = lte;
|
|
2395
|
+
}));
|
|
2396
|
+
//#endregion
|
|
2397
|
+
//#region ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/cmp.js
|
|
2398
|
+
var require_cmp = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2399
|
+
const eq = require_eq();
|
|
2400
|
+
const neq = require_neq();
|
|
2401
|
+
const gt = require_gt();
|
|
2402
|
+
const gte = require_gte();
|
|
2403
|
+
const lt = require_lt();
|
|
2404
|
+
const lte = require_lte();
|
|
2405
|
+
const cmp = (a, op, b, loose) => {
|
|
2406
|
+
switch (op) {
|
|
2407
|
+
case "===":
|
|
2408
|
+
if (typeof a === "object") a = a.version;
|
|
2409
|
+
if (typeof b === "object") b = b.version;
|
|
2410
|
+
return a === b;
|
|
2411
|
+
case "!==":
|
|
2412
|
+
if (typeof a === "object") a = a.version;
|
|
2413
|
+
if (typeof b === "object") b = b.version;
|
|
2414
|
+
return a !== b;
|
|
2415
|
+
case "":
|
|
2416
|
+
case "=":
|
|
2417
|
+
case "==": return eq(a, b, loose);
|
|
2418
|
+
case "!=": return neq(a, b, loose);
|
|
2419
|
+
case ">": return gt(a, b, loose);
|
|
2420
|
+
case ">=": return gte(a, b, loose);
|
|
2421
|
+
case "<": return lt(a, b, loose);
|
|
2422
|
+
case "<=": return lte(a, b, loose);
|
|
2423
|
+
default: throw new TypeError(`Invalid operator: ${op}`);
|
|
2424
|
+
}
|
|
2425
|
+
};
|
|
2426
|
+
module.exports = cmp;
|
|
2427
|
+
}));
|
|
2428
|
+
//#endregion
|
|
2429
|
+
//#region ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/coerce.js
|
|
2430
|
+
var require_coerce = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2431
|
+
const SemVer = require_semver$1();
|
|
2432
|
+
const parse = require_parse();
|
|
2433
|
+
const { safeRe: re, t } = require_re();
|
|
2434
|
+
const coerce = (version, options) => {
|
|
2435
|
+
if (version instanceof SemVer) return version;
|
|
2436
|
+
if (typeof version === "number") version = String(version);
|
|
2437
|
+
if (typeof version !== "string") return null;
|
|
2438
|
+
options = options || {};
|
|
2439
|
+
let match = null;
|
|
2440
|
+
if (!options.rtl) match = version.match(options.includePrerelease ? re[t.COERCEFULL] : re[t.COERCE]);
|
|
2441
|
+
else {
|
|
2442
|
+
const coerceRtlRegex = options.includePrerelease ? re[t.COERCERTLFULL] : re[t.COERCERTL];
|
|
2443
|
+
let next;
|
|
2444
|
+
while ((next = coerceRtlRegex.exec(version)) && (!match || match.index + match[0].length !== version.length)) {
|
|
2445
|
+
if (!match || next.index + next[0].length !== match.index + match[0].length) match = next;
|
|
2446
|
+
coerceRtlRegex.lastIndex = next.index + next[1].length + next[2].length;
|
|
2447
|
+
}
|
|
2448
|
+
coerceRtlRegex.lastIndex = -1;
|
|
2449
|
+
}
|
|
2450
|
+
if (match === null) return null;
|
|
2451
|
+
const major = match[2];
|
|
2452
|
+
return parse(`${major}.${match[3] || "0"}.${match[4] || "0"}${options.includePrerelease && match[5] ? `-${match[5]}` : ""}${options.includePrerelease && match[6] ? `+${match[6]}` : ""}`, options);
|
|
2453
|
+
};
|
|
2454
|
+
module.exports = coerce;
|
|
2455
|
+
}));
|
|
2456
|
+
//#endregion
|
|
2457
|
+
//#region ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/lrucache.js
|
|
2458
|
+
var require_lrucache = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2459
|
+
var LRUCache = class {
|
|
2460
|
+
constructor() {
|
|
2461
|
+
this.max = 1e3;
|
|
2462
|
+
this.map = /* @__PURE__ */ new Map();
|
|
2463
|
+
}
|
|
2464
|
+
get(key) {
|
|
2465
|
+
const value = this.map.get(key);
|
|
2466
|
+
if (value === void 0) return;
|
|
2467
|
+
else {
|
|
2468
|
+
this.map.delete(key);
|
|
2469
|
+
this.map.set(key, value);
|
|
2470
|
+
return value;
|
|
2471
|
+
}
|
|
2472
|
+
}
|
|
2473
|
+
delete(key) {
|
|
2474
|
+
return this.map.delete(key);
|
|
2475
|
+
}
|
|
2476
|
+
set(key, value) {
|
|
2477
|
+
if (!this.delete(key) && value !== void 0) {
|
|
2478
|
+
if (this.map.size >= this.max) {
|
|
2479
|
+
const firstKey = this.map.keys().next().value;
|
|
2480
|
+
this.delete(firstKey);
|
|
2481
|
+
}
|
|
2482
|
+
this.map.set(key, value);
|
|
2483
|
+
}
|
|
2484
|
+
return this;
|
|
2485
|
+
}
|
|
2486
|
+
};
|
|
2487
|
+
module.exports = LRUCache;
|
|
2488
|
+
}));
|
|
2489
|
+
//#endregion
|
|
2490
|
+
//#region ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/classes/range.js
|
|
2491
|
+
var require_range = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2492
|
+
const SPACE_CHARACTERS = /\s+/g;
|
|
2493
|
+
module.exports = class Range {
|
|
2494
|
+
constructor(range, options) {
|
|
2495
|
+
options = parseOptions(options);
|
|
2496
|
+
if (range instanceof Range) if (range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease) return range;
|
|
2497
|
+
else return new Range(range.raw, options);
|
|
2498
|
+
if (range instanceof Comparator) {
|
|
2499
|
+
this.raw = range.value;
|
|
2500
|
+
this.set = [[range]];
|
|
2501
|
+
this.formatted = void 0;
|
|
2502
|
+
return this;
|
|
2503
|
+
}
|
|
2504
|
+
this.options = options;
|
|
2505
|
+
this.loose = !!options.loose;
|
|
2506
|
+
this.includePrerelease = !!options.includePrerelease;
|
|
2507
|
+
this.raw = range.trim().replace(SPACE_CHARACTERS, " ");
|
|
2508
|
+
this.set = this.raw.split("||").map((r) => this.parseRange(r.trim())).filter((c) => c.length);
|
|
2509
|
+
if (!this.set.length) throw new TypeError(`Invalid SemVer Range: ${this.raw}`);
|
|
2510
|
+
if (this.set.length > 1) {
|
|
2511
|
+
const first = this.set[0];
|
|
2512
|
+
this.set = this.set.filter((c) => !isNullSet(c[0]));
|
|
2513
|
+
if (this.set.length === 0) this.set = [first];
|
|
2514
|
+
else if (this.set.length > 1) {
|
|
2515
|
+
for (const c of this.set) if (c.length === 1 && isAny(c[0])) {
|
|
2516
|
+
this.set = [c];
|
|
2517
|
+
break;
|
|
2518
|
+
}
|
|
2519
|
+
}
|
|
2520
|
+
}
|
|
2521
|
+
this.formatted = void 0;
|
|
2522
|
+
}
|
|
2523
|
+
get range() {
|
|
2524
|
+
if (this.formatted === void 0) {
|
|
2525
|
+
this.formatted = "";
|
|
2526
|
+
for (let i = 0; i < this.set.length; i++) {
|
|
2527
|
+
if (i > 0) this.formatted += "||";
|
|
2528
|
+
const comps = this.set[i];
|
|
2529
|
+
for (let k = 0; k < comps.length; k++) {
|
|
2530
|
+
if (k > 0) this.formatted += " ";
|
|
2531
|
+
this.formatted += comps[k].toString().trim();
|
|
2532
|
+
}
|
|
2533
|
+
}
|
|
2534
|
+
}
|
|
2535
|
+
return this.formatted;
|
|
2536
|
+
}
|
|
2537
|
+
format() {
|
|
2538
|
+
return this.range;
|
|
2539
|
+
}
|
|
2540
|
+
toString() {
|
|
2541
|
+
return this.range;
|
|
2542
|
+
}
|
|
2543
|
+
parseRange(range) {
|
|
2544
|
+
const memoKey = ((this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) | (this.options.loose && FLAG_LOOSE)) + ":" + range;
|
|
2545
|
+
const cached = cache.get(memoKey);
|
|
2546
|
+
if (cached) return cached;
|
|
2547
|
+
const loose = this.options.loose;
|
|
2548
|
+
const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE];
|
|
2549
|
+
range = range.replace(hr, hyphenReplace(this.options.includePrerelease));
|
|
2550
|
+
debug("hyphen replace", range);
|
|
2551
|
+
range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace);
|
|
2552
|
+
debug("comparator trim", range);
|
|
2553
|
+
range = range.replace(re[t.TILDETRIM], tildeTrimReplace);
|
|
2554
|
+
debug("tilde trim", range);
|
|
2555
|
+
range = range.replace(re[t.CARETTRIM], caretTrimReplace);
|
|
2556
|
+
debug("caret trim", range);
|
|
2557
|
+
let rangeList = range.split(" ").map((comp) => parseComparator(comp, this.options)).join(" ").split(/\s+/).map((comp) => replaceGTE0(comp, this.options));
|
|
2558
|
+
if (loose) rangeList = rangeList.filter((comp) => {
|
|
2559
|
+
debug("loose invalid filter", comp, this.options);
|
|
2560
|
+
return !!comp.match(re[t.COMPARATORLOOSE]);
|
|
2561
|
+
});
|
|
2562
|
+
debug("range list", rangeList);
|
|
2563
|
+
const rangeMap = /* @__PURE__ */ new Map();
|
|
2564
|
+
const comparators = rangeList.map((comp) => new Comparator(comp, this.options));
|
|
2565
|
+
for (const comp of comparators) {
|
|
2566
|
+
if (isNullSet(comp)) return [comp];
|
|
2567
|
+
rangeMap.set(comp.value, comp);
|
|
2568
|
+
}
|
|
2569
|
+
if (rangeMap.size > 1 && rangeMap.has("")) rangeMap.delete("");
|
|
2570
|
+
const result = [...rangeMap.values()];
|
|
2571
|
+
cache.set(memoKey, result);
|
|
2572
|
+
return result;
|
|
2573
|
+
}
|
|
2574
|
+
intersects(range, options) {
|
|
2575
|
+
if (!(range instanceof Range)) throw new TypeError("a Range is required");
|
|
2576
|
+
return this.set.some((thisComparators) => {
|
|
2577
|
+
return isSatisfiable(thisComparators, options) && range.set.some((rangeComparators) => {
|
|
2578
|
+
return isSatisfiable(rangeComparators, options) && thisComparators.every((thisComparator) => {
|
|
2579
|
+
return rangeComparators.every((rangeComparator) => {
|
|
2580
|
+
return thisComparator.intersects(rangeComparator, options);
|
|
2581
|
+
});
|
|
2582
|
+
});
|
|
2583
|
+
});
|
|
2584
|
+
});
|
|
2585
|
+
}
|
|
2586
|
+
test(version) {
|
|
2587
|
+
if (!version) return false;
|
|
2588
|
+
if (typeof version === "string") try {
|
|
2589
|
+
version = new SemVer(version, this.options);
|
|
2590
|
+
} catch (er) {
|
|
2591
|
+
return false;
|
|
2592
|
+
}
|
|
2593
|
+
for (let i = 0; i < this.set.length; i++) if (testSet(this.set[i], version, this.options)) return true;
|
|
2594
|
+
return false;
|
|
2595
|
+
}
|
|
2596
|
+
};
|
|
2597
|
+
const cache = new (require_lrucache())();
|
|
2598
|
+
const parseOptions = require_parse_options();
|
|
2599
|
+
const Comparator = require_comparator();
|
|
2600
|
+
const debug = require_debug();
|
|
2601
|
+
const SemVer = require_semver$1();
|
|
2602
|
+
const { safeRe: re, t, comparatorTrimReplace, tildeTrimReplace, caretTrimReplace } = require_re();
|
|
2603
|
+
const { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = require_constants();
|
|
2604
|
+
const isNullSet = (c) => c.value === "<0.0.0-0";
|
|
2605
|
+
const isAny = (c) => c.value === "";
|
|
2606
|
+
const isSatisfiable = (comparators, options) => {
|
|
2607
|
+
let result = true;
|
|
2608
|
+
const remainingComparators = comparators.slice();
|
|
2609
|
+
let testComparator = remainingComparators.pop();
|
|
2610
|
+
while (result && remainingComparators.length) {
|
|
2611
|
+
result = remainingComparators.every((otherComparator) => {
|
|
2612
|
+
return testComparator.intersects(otherComparator, options);
|
|
2613
|
+
});
|
|
2614
|
+
testComparator = remainingComparators.pop();
|
|
2615
|
+
}
|
|
2616
|
+
return result;
|
|
2617
|
+
};
|
|
2618
|
+
const parseComparator = (comp, options) => {
|
|
2619
|
+
comp = comp.replace(re[t.BUILD], "");
|
|
2620
|
+
debug("comp", comp, options);
|
|
2621
|
+
comp = replaceCarets(comp, options);
|
|
2622
|
+
debug("caret", comp);
|
|
2623
|
+
comp = replaceTildes(comp, options);
|
|
2624
|
+
debug("tildes", comp);
|
|
2625
|
+
comp = replaceXRanges(comp, options);
|
|
2626
|
+
debug("xrange", comp);
|
|
2627
|
+
comp = replaceStars(comp, options);
|
|
2628
|
+
debug("stars", comp);
|
|
2629
|
+
return comp;
|
|
2630
|
+
};
|
|
2631
|
+
const isX = (id) => !id || id.toLowerCase() === "x" || id === "*";
|
|
2632
|
+
const replaceTildes = (comp, options) => {
|
|
2633
|
+
return comp.trim().split(/\s+/).map((c) => replaceTilde(c, options)).join(" ");
|
|
2634
|
+
};
|
|
2635
|
+
const replaceTilde = (comp, options) => {
|
|
2636
|
+
const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE];
|
|
2637
|
+
return comp.replace(r, (_, M, m, p, pr) => {
|
|
2638
|
+
debug("tilde", comp, _, M, m, p, pr);
|
|
2639
|
+
let ret;
|
|
2640
|
+
if (isX(M)) ret = "";
|
|
2641
|
+
else if (isX(m)) ret = `>=${M}.0.0 <${+M + 1}.0.0-0`;
|
|
2642
|
+
else if (isX(p)) ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0`;
|
|
2643
|
+
else if (pr) {
|
|
2644
|
+
debug("replaceTilde pr", pr);
|
|
2645
|
+
ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`;
|
|
2646
|
+
} else ret = `>=${M}.${m}.${p} <${M}.${+m + 1}.0-0`;
|
|
2647
|
+
debug("tilde return", ret);
|
|
2648
|
+
return ret;
|
|
2649
|
+
});
|
|
2650
|
+
};
|
|
2651
|
+
const replaceCarets = (comp, options) => {
|
|
2652
|
+
return comp.trim().split(/\s+/).map((c) => replaceCaret(c, options)).join(" ");
|
|
2653
|
+
};
|
|
2654
|
+
const replaceCaret = (comp, options) => {
|
|
2655
|
+
debug("caret", comp, options);
|
|
2656
|
+
const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET];
|
|
2657
|
+
const z = options.includePrerelease ? "-0" : "";
|
|
2658
|
+
return comp.replace(r, (_, M, m, p, pr) => {
|
|
2659
|
+
debug("caret", comp, _, M, m, p, pr);
|
|
2660
|
+
let ret;
|
|
2661
|
+
if (isX(M)) ret = "";
|
|
2662
|
+
else if (isX(m)) ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0`;
|
|
2663
|
+
else if (isX(p)) if (M === "0") ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0`;
|
|
2664
|
+
else ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0`;
|
|
2665
|
+
else if (pr) {
|
|
2666
|
+
debug("replaceCaret pr", pr);
|
|
2667
|
+
if (M === "0") if (m === "0") ret = `>=${M}.${m}.${p}-${pr} <${M}.${m}.${+p + 1}-0`;
|
|
2668
|
+
else ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`;
|
|
2669
|
+
else ret = `>=${M}.${m}.${p}-${pr} <${+M + 1}.0.0-0`;
|
|
2670
|
+
} else {
|
|
2671
|
+
debug("no pr");
|
|
2672
|
+
if (M === "0") if (m === "0") ret = `>=${M}.${m}.${p}${z} <${M}.${m}.${+p + 1}-0`;
|
|
2673
|
+
else ret = `>=${M}.${m}.${p}${z} <${M}.${+m + 1}.0-0`;
|
|
2674
|
+
else ret = `>=${M}.${m}.${p} <${+M + 1}.0.0-0`;
|
|
2675
|
+
}
|
|
2676
|
+
debug("caret return", ret);
|
|
2677
|
+
return ret;
|
|
2678
|
+
});
|
|
2679
|
+
};
|
|
2680
|
+
const replaceXRanges = (comp, options) => {
|
|
2681
|
+
debug("replaceXRanges", comp, options);
|
|
2682
|
+
return comp.split(/\s+/).map((c) => replaceXRange(c, options)).join(" ");
|
|
2683
|
+
};
|
|
2684
|
+
const replaceXRange = (comp, options) => {
|
|
2685
|
+
comp = comp.trim();
|
|
2686
|
+
const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE];
|
|
2687
|
+
return comp.replace(r, (ret, gtlt, M, m, p, pr) => {
|
|
2688
|
+
debug("xRange", comp, ret, gtlt, M, m, p, pr);
|
|
2689
|
+
const xM = isX(M);
|
|
2690
|
+
const xm = xM || isX(m);
|
|
2691
|
+
const xp = xm || isX(p);
|
|
2692
|
+
const anyX = xp;
|
|
2693
|
+
if (gtlt === "=" && anyX) gtlt = "";
|
|
2694
|
+
pr = options.includePrerelease ? "-0" : "";
|
|
2695
|
+
if (xM) if (gtlt === ">" || gtlt === "<") ret = "<0.0.0-0";
|
|
2696
|
+
else ret = "*";
|
|
2697
|
+
else if (gtlt && anyX) {
|
|
2698
|
+
if (xm) m = 0;
|
|
2699
|
+
p = 0;
|
|
2700
|
+
if (gtlt === ">") {
|
|
2701
|
+
gtlt = ">=";
|
|
2702
|
+
if (xm) {
|
|
2703
|
+
M = +M + 1;
|
|
2704
|
+
m = 0;
|
|
2705
|
+
p = 0;
|
|
2706
|
+
} else {
|
|
2707
|
+
m = +m + 1;
|
|
2708
|
+
p = 0;
|
|
2709
|
+
}
|
|
2710
|
+
} else if (gtlt === "<=") {
|
|
2711
|
+
gtlt = "<";
|
|
2712
|
+
if (xm) M = +M + 1;
|
|
2713
|
+
else m = +m + 1;
|
|
2714
|
+
}
|
|
2715
|
+
if (gtlt === "<") pr = "-0";
|
|
2716
|
+
ret = `${gtlt + M}.${m}.${p}${pr}`;
|
|
2717
|
+
} else if (xm) ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0`;
|
|
2718
|
+
else if (xp) ret = `>=${M}.${m}.0${pr} <${M}.${+m + 1}.0-0`;
|
|
2719
|
+
debug("xRange return", ret);
|
|
2720
|
+
return ret;
|
|
2721
|
+
});
|
|
2722
|
+
};
|
|
2723
|
+
const replaceStars = (comp, options) => {
|
|
2724
|
+
debug("replaceStars", comp, options);
|
|
2725
|
+
return comp.trim().replace(re[t.STAR], "");
|
|
2726
|
+
};
|
|
2727
|
+
const replaceGTE0 = (comp, options) => {
|
|
2728
|
+
debug("replaceGTE0", comp, options);
|
|
2729
|
+
return comp.trim().replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], "");
|
|
2730
|
+
};
|
|
2731
|
+
const hyphenReplace = (incPr) => ($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr) => {
|
|
2732
|
+
if (isX(fM)) from = "";
|
|
2733
|
+
else if (isX(fm)) from = `>=${fM}.0.0${incPr ? "-0" : ""}`;
|
|
2734
|
+
else if (isX(fp)) from = `>=${fM}.${fm}.0${incPr ? "-0" : ""}`;
|
|
2735
|
+
else if (fpr) from = `>=${from}`;
|
|
2736
|
+
else from = `>=${from}${incPr ? "-0" : ""}`;
|
|
2737
|
+
if (isX(tM)) to = "";
|
|
2738
|
+
else if (isX(tm)) to = `<${+tM + 1}.0.0-0`;
|
|
2739
|
+
else if (isX(tp)) to = `<${tM}.${+tm + 1}.0-0`;
|
|
2740
|
+
else if (tpr) to = `<=${tM}.${tm}.${tp}-${tpr}`;
|
|
2741
|
+
else if (incPr) to = `<${tM}.${tm}.${+tp + 1}-0`;
|
|
2742
|
+
else to = `<=${to}`;
|
|
2743
|
+
return `${from} ${to}`.trim();
|
|
2744
|
+
};
|
|
2745
|
+
const testSet = (set, version, options) => {
|
|
2746
|
+
for (let i = 0; i < set.length; i++) if (!set[i].test(version)) return false;
|
|
2747
|
+
if (version.prerelease.length && !options.includePrerelease) {
|
|
2748
|
+
for (let i = 0; i < set.length; i++) {
|
|
2749
|
+
debug(set[i].semver);
|
|
2750
|
+
if (set[i].semver === Comparator.ANY) continue;
|
|
2751
|
+
if (set[i].semver.prerelease.length > 0) {
|
|
2752
|
+
const allowed = set[i].semver;
|
|
2753
|
+
if (allowed.major === version.major && allowed.minor === version.minor && allowed.patch === version.patch) return true;
|
|
2754
|
+
}
|
|
2755
|
+
}
|
|
2756
|
+
return false;
|
|
2757
|
+
}
|
|
2758
|
+
return true;
|
|
2759
|
+
};
|
|
2760
|
+
}));
|
|
2761
|
+
//#endregion
|
|
2762
|
+
//#region ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/classes/comparator.js
|
|
2763
|
+
var require_comparator = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2764
|
+
const ANY = Symbol("SemVer ANY");
|
|
2765
|
+
module.exports = class Comparator {
|
|
2766
|
+
static get ANY() {
|
|
2767
|
+
return ANY;
|
|
2768
|
+
}
|
|
2769
|
+
constructor(comp, options) {
|
|
2770
|
+
options = parseOptions(options);
|
|
2771
|
+
if (comp instanceof Comparator) if (comp.loose === !!options.loose) return comp;
|
|
2772
|
+
else comp = comp.value;
|
|
2773
|
+
comp = comp.trim().split(/\s+/).join(" ");
|
|
2774
|
+
debug("comparator", comp, options);
|
|
2775
|
+
this.options = options;
|
|
2776
|
+
this.loose = !!options.loose;
|
|
2777
|
+
this.parse(comp);
|
|
2778
|
+
if (this.semver === ANY) this.value = "";
|
|
2779
|
+
else this.value = this.operator + this.semver.version;
|
|
2780
|
+
debug("comp", this);
|
|
2781
|
+
}
|
|
2782
|
+
parse(comp) {
|
|
2783
|
+
const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR];
|
|
2784
|
+
const m = comp.match(r);
|
|
2785
|
+
if (!m) throw new TypeError(`Invalid comparator: ${comp}`);
|
|
2786
|
+
this.operator = m[1] !== void 0 ? m[1] : "";
|
|
2787
|
+
if (this.operator === "=") this.operator = "";
|
|
2788
|
+
if (!m[2]) this.semver = ANY;
|
|
2789
|
+
else this.semver = new SemVer(m[2], this.options.loose);
|
|
2790
|
+
}
|
|
2791
|
+
toString() {
|
|
2792
|
+
return this.value;
|
|
2793
|
+
}
|
|
2794
|
+
test(version) {
|
|
2795
|
+
debug("Comparator.test", version, this.options.loose);
|
|
2796
|
+
if (this.semver === ANY || version === ANY) return true;
|
|
2797
|
+
if (typeof version === "string") try {
|
|
2798
|
+
version = new SemVer(version, this.options);
|
|
2799
|
+
} catch (er) {
|
|
2800
|
+
return false;
|
|
2801
|
+
}
|
|
2802
|
+
return cmp(version, this.operator, this.semver, this.options);
|
|
2803
|
+
}
|
|
2804
|
+
intersects(comp, options) {
|
|
2805
|
+
if (!(comp instanceof Comparator)) throw new TypeError("a Comparator is required");
|
|
2806
|
+
if (this.operator === "") {
|
|
2807
|
+
if (this.value === "") return true;
|
|
2808
|
+
return new Range(comp.value, options).test(this.value);
|
|
2809
|
+
} else if (comp.operator === "") {
|
|
2810
|
+
if (comp.value === "") return true;
|
|
2811
|
+
return new Range(this.value, options).test(comp.semver);
|
|
2812
|
+
}
|
|
2813
|
+
options = parseOptions(options);
|
|
2814
|
+
if (options.includePrerelease && (this.value === "<0.0.0-0" || comp.value === "<0.0.0-0")) return false;
|
|
2815
|
+
if (!options.includePrerelease && (this.value.startsWith("<0.0.0") || comp.value.startsWith("<0.0.0"))) return false;
|
|
2816
|
+
if (this.operator.startsWith(">") && comp.operator.startsWith(">")) return true;
|
|
2817
|
+
if (this.operator.startsWith("<") && comp.operator.startsWith("<")) return true;
|
|
2818
|
+
if (this.semver.version === comp.semver.version && this.operator.includes("=") && comp.operator.includes("=")) return true;
|
|
2819
|
+
if (cmp(this.semver, "<", comp.semver, options) && this.operator.startsWith(">") && comp.operator.startsWith("<")) return true;
|
|
2820
|
+
if (cmp(this.semver, ">", comp.semver, options) && this.operator.startsWith("<") && comp.operator.startsWith(">")) return true;
|
|
2821
|
+
return false;
|
|
2822
|
+
}
|
|
2823
|
+
};
|
|
2824
|
+
const parseOptions = require_parse_options();
|
|
2825
|
+
const { safeRe: re, t } = require_re();
|
|
2826
|
+
const cmp = require_cmp();
|
|
2827
|
+
const debug = require_debug();
|
|
2828
|
+
const SemVer = require_semver$1();
|
|
2829
|
+
const Range = require_range();
|
|
2830
|
+
}));
|
|
2831
|
+
//#endregion
|
|
2832
|
+
//#region ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/satisfies.js
|
|
2833
|
+
var require_satisfies = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2834
|
+
const Range = require_range();
|
|
2835
|
+
const satisfies = (version, range, options) => {
|
|
2836
|
+
try {
|
|
2837
|
+
range = new Range(range, options);
|
|
2838
|
+
} catch (er) {
|
|
2839
|
+
return false;
|
|
2840
|
+
}
|
|
2841
|
+
return range.test(version);
|
|
2842
|
+
};
|
|
2843
|
+
module.exports = satisfies;
|
|
2844
|
+
}));
|
|
2845
|
+
//#endregion
|
|
2846
|
+
//#region ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/to-comparators.js
|
|
2847
|
+
var require_to_comparators = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2848
|
+
const Range = require_range();
|
|
2849
|
+
const toComparators = (range, options) => new Range(range, options).set.map((comp) => comp.map((c) => c.value).join(" ").trim().split(" "));
|
|
2850
|
+
module.exports = toComparators;
|
|
2851
|
+
}));
|
|
2852
|
+
//#endregion
|
|
2853
|
+
//#region ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/max-satisfying.js
|
|
2854
|
+
var require_max_satisfying = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2855
|
+
const SemVer = require_semver$1();
|
|
2856
|
+
const Range = require_range();
|
|
2857
|
+
const maxSatisfying = (versions, range, options) => {
|
|
2858
|
+
let max = null;
|
|
2859
|
+
let maxSV = null;
|
|
2860
|
+
let rangeObj = null;
|
|
2861
|
+
try {
|
|
2862
|
+
rangeObj = new Range(range, options);
|
|
2863
|
+
} catch (er) {
|
|
2864
|
+
return null;
|
|
2865
|
+
}
|
|
2866
|
+
versions.forEach((v) => {
|
|
2867
|
+
if (rangeObj.test(v)) {
|
|
2868
|
+
if (!max || maxSV.compare(v) === -1) {
|
|
2869
|
+
max = v;
|
|
2870
|
+
maxSV = new SemVer(max, options);
|
|
2871
|
+
}
|
|
2872
|
+
}
|
|
2873
|
+
});
|
|
2874
|
+
return max;
|
|
2875
|
+
};
|
|
2876
|
+
module.exports = maxSatisfying;
|
|
2877
|
+
}));
|
|
2878
|
+
//#endregion
|
|
2879
|
+
//#region ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/min-satisfying.js
|
|
2880
|
+
var require_min_satisfying = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2881
|
+
const SemVer = require_semver$1();
|
|
2882
|
+
const Range = require_range();
|
|
2883
|
+
const minSatisfying = (versions, range, options) => {
|
|
2884
|
+
let min = null;
|
|
2885
|
+
let minSV = null;
|
|
2886
|
+
let rangeObj = null;
|
|
2887
|
+
try {
|
|
2888
|
+
rangeObj = new Range(range, options);
|
|
2889
|
+
} catch (er) {
|
|
2890
|
+
return null;
|
|
2891
|
+
}
|
|
2892
|
+
versions.forEach((v) => {
|
|
2893
|
+
if (rangeObj.test(v)) {
|
|
2894
|
+
if (!min || minSV.compare(v) === 1) {
|
|
2895
|
+
min = v;
|
|
2896
|
+
minSV = new SemVer(min, options);
|
|
2897
|
+
}
|
|
2898
|
+
}
|
|
2899
|
+
});
|
|
2900
|
+
return min;
|
|
2901
|
+
};
|
|
2902
|
+
module.exports = minSatisfying;
|
|
2903
|
+
}));
|
|
2904
|
+
//#endregion
|
|
2905
|
+
//#region ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/min-version.js
|
|
2906
|
+
var require_min_version = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2907
|
+
const SemVer = require_semver$1();
|
|
2908
|
+
const Range = require_range();
|
|
2909
|
+
const gt = require_gt();
|
|
2910
|
+
const minVersion = (range, loose) => {
|
|
2911
|
+
range = new Range(range, loose);
|
|
2912
|
+
let minver = new SemVer("0.0.0");
|
|
2913
|
+
if (range.test(minver)) return minver;
|
|
2914
|
+
minver = new SemVer("0.0.0-0");
|
|
2915
|
+
if (range.test(minver)) return minver;
|
|
2916
|
+
minver = null;
|
|
2917
|
+
for (let i = 0; i < range.set.length; ++i) {
|
|
2918
|
+
const comparators = range.set[i];
|
|
2919
|
+
let setMin = null;
|
|
2920
|
+
comparators.forEach((comparator) => {
|
|
2921
|
+
const compver = new SemVer(comparator.semver.version);
|
|
2922
|
+
switch (comparator.operator) {
|
|
2923
|
+
case ">":
|
|
2924
|
+
if (compver.prerelease.length === 0) compver.patch++;
|
|
2925
|
+
else compver.prerelease.push(0);
|
|
2926
|
+
compver.raw = compver.format();
|
|
2927
|
+
case "":
|
|
2928
|
+
case ">=":
|
|
2929
|
+
if (!setMin || gt(compver, setMin)) setMin = compver;
|
|
2930
|
+
break;
|
|
2931
|
+
case "<":
|
|
2932
|
+
case "<=": break;
|
|
2933
|
+
/* istanbul ignore next */
|
|
2934
|
+
default: throw new Error(`Unexpected operation: ${comparator.operator}`);
|
|
2935
|
+
}
|
|
2936
|
+
});
|
|
2937
|
+
if (setMin && (!minver || gt(minver, setMin))) minver = setMin;
|
|
2938
|
+
}
|
|
2939
|
+
if (minver && range.test(minver)) return minver;
|
|
2940
|
+
return null;
|
|
2941
|
+
};
|
|
2942
|
+
module.exports = minVersion;
|
|
2943
|
+
}));
|
|
2944
|
+
//#endregion
|
|
2945
|
+
//#region ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/valid.js
|
|
2946
|
+
var require_valid = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2947
|
+
const Range = require_range();
|
|
2948
|
+
const validRange = (range, options) => {
|
|
2949
|
+
try {
|
|
2950
|
+
return new Range(range, options).range || "*";
|
|
2951
|
+
} catch (er) {
|
|
2952
|
+
return null;
|
|
2953
|
+
}
|
|
2954
|
+
};
|
|
2955
|
+
module.exports = validRange;
|
|
2956
|
+
}));
|
|
2957
|
+
//#endregion
|
|
2958
|
+
//#region ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/outside.js
|
|
2959
|
+
var require_outside = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2960
|
+
const SemVer = require_semver$1();
|
|
2961
|
+
const Comparator = require_comparator();
|
|
2962
|
+
const { ANY } = Comparator;
|
|
2963
|
+
const Range = require_range();
|
|
2964
|
+
const satisfies = require_satisfies();
|
|
2965
|
+
const gt = require_gt();
|
|
2966
|
+
const lt = require_lt();
|
|
2967
|
+
const lte = require_lte();
|
|
2968
|
+
const gte = require_gte();
|
|
2969
|
+
const outside = (version, range, hilo, options) => {
|
|
2970
|
+
version = new SemVer(version, options);
|
|
2971
|
+
range = new Range(range, options);
|
|
2972
|
+
let gtfn, ltefn, ltfn, comp, ecomp;
|
|
2973
|
+
switch (hilo) {
|
|
2974
|
+
case ">":
|
|
2975
|
+
gtfn = gt;
|
|
2976
|
+
ltefn = lte;
|
|
2977
|
+
ltfn = lt;
|
|
2978
|
+
comp = ">";
|
|
2979
|
+
ecomp = ">=";
|
|
2980
|
+
break;
|
|
2981
|
+
case "<":
|
|
2982
|
+
gtfn = lt;
|
|
2983
|
+
ltefn = gte;
|
|
2984
|
+
ltfn = gt;
|
|
2985
|
+
comp = "<";
|
|
2986
|
+
ecomp = "<=";
|
|
2987
|
+
break;
|
|
2988
|
+
default: throw new TypeError("Must provide a hilo val of \"<\" or \">\"");
|
|
2989
|
+
}
|
|
2990
|
+
if (satisfies(version, range, options)) return false;
|
|
2991
|
+
for (let i = 0; i < range.set.length; ++i) {
|
|
2992
|
+
const comparators = range.set[i];
|
|
2993
|
+
let high = null;
|
|
2994
|
+
let low = null;
|
|
2995
|
+
comparators.forEach((comparator) => {
|
|
2996
|
+
if (comparator.semver === ANY) comparator = new Comparator(">=0.0.0");
|
|
2997
|
+
high = high || comparator;
|
|
2998
|
+
low = low || comparator;
|
|
2999
|
+
if (gtfn(comparator.semver, high.semver, options)) high = comparator;
|
|
3000
|
+
else if (ltfn(comparator.semver, low.semver, options)) low = comparator;
|
|
3001
|
+
});
|
|
3002
|
+
if (high.operator === comp || high.operator === ecomp) return false;
|
|
3003
|
+
if ((!low.operator || low.operator === comp) && ltefn(version, low.semver)) return false;
|
|
3004
|
+
else if (low.operator === ecomp && ltfn(version, low.semver)) return false;
|
|
3005
|
+
}
|
|
3006
|
+
return true;
|
|
3007
|
+
};
|
|
3008
|
+
module.exports = outside;
|
|
3009
|
+
}));
|
|
3010
|
+
//#endregion
|
|
3011
|
+
//#region ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/gtr.js
|
|
3012
|
+
var require_gtr = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
3013
|
+
const outside = require_outside();
|
|
3014
|
+
const gtr = (version, range, options) => outside(version, range, ">", options);
|
|
3015
|
+
module.exports = gtr;
|
|
3016
|
+
}));
|
|
3017
|
+
//#endregion
|
|
3018
|
+
//#region ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/ltr.js
|
|
3019
|
+
var require_ltr = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
3020
|
+
const outside = require_outside();
|
|
3021
|
+
const ltr = (version, range, options) => outside(version, range, "<", options);
|
|
3022
|
+
module.exports = ltr;
|
|
3023
|
+
}));
|
|
3024
|
+
//#endregion
|
|
3025
|
+
//#region ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/intersects.js
|
|
3026
|
+
var require_intersects = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
3027
|
+
const Range = require_range();
|
|
3028
|
+
const intersects = (r1, r2, options) => {
|
|
3029
|
+
r1 = new Range(r1, options);
|
|
3030
|
+
r2 = new Range(r2, options);
|
|
3031
|
+
return r1.intersects(r2, options);
|
|
3032
|
+
};
|
|
3033
|
+
module.exports = intersects;
|
|
3034
|
+
}));
|
|
3035
|
+
//#endregion
|
|
3036
|
+
//#region ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/simplify.js
|
|
3037
|
+
var require_simplify = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
3038
|
+
const satisfies = require_satisfies();
|
|
3039
|
+
const compare = require_compare();
|
|
3040
|
+
module.exports = (versions, range, options) => {
|
|
3041
|
+
const set = [];
|
|
3042
|
+
let first = null;
|
|
3043
|
+
let prev = null;
|
|
3044
|
+
const v = versions.sort((a, b) => compare(a, b, options));
|
|
3045
|
+
for (const version of v) if (satisfies(version, range, options)) {
|
|
3046
|
+
prev = version;
|
|
3047
|
+
if (!first) first = version;
|
|
3048
|
+
} else {
|
|
3049
|
+
if (prev) set.push([first, prev]);
|
|
3050
|
+
prev = null;
|
|
3051
|
+
first = null;
|
|
3052
|
+
}
|
|
3053
|
+
if (first) set.push([first, null]);
|
|
3054
|
+
const ranges = [];
|
|
3055
|
+
for (const [min, max] of set) if (min === max) ranges.push(min);
|
|
3056
|
+
else if (!max && min === v[0]) ranges.push("*");
|
|
3057
|
+
else if (!max) ranges.push(`>=${min}`);
|
|
3058
|
+
else if (min === v[0]) ranges.push(`<=${max}`);
|
|
3059
|
+
else ranges.push(`${min} - ${max}`);
|
|
3060
|
+
const simplified = ranges.join(" || ");
|
|
3061
|
+
const original = typeof range.raw === "string" ? range.raw : String(range);
|
|
3062
|
+
return simplified.length < original.length ? simplified : range;
|
|
3063
|
+
};
|
|
3064
|
+
}));
|
|
3065
|
+
//#endregion
|
|
3066
|
+
//#region ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/subset.js
|
|
3067
|
+
var require_subset = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
3068
|
+
const Range = require_range();
|
|
3069
|
+
const Comparator = require_comparator();
|
|
3070
|
+
const { ANY } = Comparator;
|
|
3071
|
+
const satisfies = require_satisfies();
|
|
3072
|
+
const compare = require_compare();
|
|
3073
|
+
const subset = (sub, dom, options = {}) => {
|
|
3074
|
+
if (sub === dom) return true;
|
|
3075
|
+
sub = new Range(sub, options);
|
|
3076
|
+
dom = new Range(dom, options);
|
|
3077
|
+
let sawNonNull = false;
|
|
3078
|
+
OUTER: for (const simpleSub of sub.set) {
|
|
3079
|
+
for (const simpleDom of dom.set) {
|
|
3080
|
+
const isSub = simpleSubset(simpleSub, simpleDom, options);
|
|
3081
|
+
sawNonNull = sawNonNull || isSub !== null;
|
|
3082
|
+
if (isSub) continue OUTER;
|
|
3083
|
+
}
|
|
3084
|
+
if (sawNonNull) return false;
|
|
3085
|
+
}
|
|
3086
|
+
return true;
|
|
3087
|
+
};
|
|
3088
|
+
const minimumVersionWithPreRelease = [new Comparator(">=0.0.0-0")];
|
|
3089
|
+
const minimumVersion = [new Comparator(">=0.0.0")];
|
|
3090
|
+
const simpleSubset = (sub, dom, options) => {
|
|
3091
|
+
if (sub === dom) return true;
|
|
3092
|
+
if (sub.length === 1 && sub[0].semver === ANY) if (dom.length === 1 && dom[0].semver === ANY) return true;
|
|
3093
|
+
else if (options.includePrerelease) sub = minimumVersionWithPreRelease;
|
|
3094
|
+
else sub = minimumVersion;
|
|
3095
|
+
if (dom.length === 1 && dom[0].semver === ANY) if (options.includePrerelease) return true;
|
|
3096
|
+
else dom = minimumVersion;
|
|
3097
|
+
const eqSet = /* @__PURE__ */ new Set();
|
|
3098
|
+
let gt, lt;
|
|
3099
|
+
for (const c of sub) if (c.operator === ">" || c.operator === ">=") gt = higherGT(gt, c, options);
|
|
3100
|
+
else if (c.operator === "<" || c.operator === "<=") lt = lowerLT(lt, c, options);
|
|
3101
|
+
else eqSet.add(c.semver);
|
|
3102
|
+
if (eqSet.size > 1) return null;
|
|
3103
|
+
let gtltComp;
|
|
3104
|
+
if (gt && lt) {
|
|
3105
|
+
gtltComp = compare(gt.semver, lt.semver, options);
|
|
3106
|
+
if (gtltComp > 0) return null;
|
|
3107
|
+
else if (gtltComp === 0 && (gt.operator !== ">=" || lt.operator !== "<=")) return null;
|
|
3108
|
+
}
|
|
3109
|
+
for (const eq of eqSet) {
|
|
3110
|
+
if (gt && !satisfies(eq, String(gt), options)) return null;
|
|
3111
|
+
if (lt && !satisfies(eq, String(lt), options)) return null;
|
|
3112
|
+
for (const c of dom) if (!satisfies(eq, String(c), options)) return false;
|
|
3113
|
+
return true;
|
|
3114
|
+
}
|
|
3115
|
+
let higher, lower;
|
|
3116
|
+
let hasDomLT, hasDomGT;
|
|
3117
|
+
let needDomLTPre = lt && !options.includePrerelease && lt.semver.prerelease.length ? lt.semver : false;
|
|
3118
|
+
let needDomGTPre = gt && !options.includePrerelease && gt.semver.prerelease.length ? gt.semver : false;
|
|
3119
|
+
if (needDomLTPre && needDomLTPre.prerelease.length === 1 && lt.operator === "<" && needDomLTPre.prerelease[0] === 0) needDomLTPre = false;
|
|
3120
|
+
for (const c of dom) {
|
|
3121
|
+
hasDomGT = hasDomGT || c.operator === ">" || c.operator === ">=";
|
|
3122
|
+
hasDomLT = hasDomLT || c.operator === "<" || c.operator === "<=";
|
|
3123
|
+
if (gt) {
|
|
3124
|
+
if (needDomGTPre) {
|
|
3125
|
+
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;
|
|
3126
|
+
}
|
|
3127
|
+
if (c.operator === ">" || c.operator === ">=") {
|
|
3128
|
+
higher = higherGT(gt, c, options);
|
|
3129
|
+
if (higher === c && higher !== gt) return false;
|
|
3130
|
+
} else if (gt.operator === ">=" && !satisfies(gt.semver, String(c), options)) return false;
|
|
3131
|
+
}
|
|
3132
|
+
if (lt) {
|
|
3133
|
+
if (needDomLTPre) {
|
|
3134
|
+
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;
|
|
3135
|
+
}
|
|
3136
|
+
if (c.operator === "<" || c.operator === "<=") {
|
|
3137
|
+
lower = lowerLT(lt, c, options);
|
|
3138
|
+
if (lower === c && lower !== lt) return false;
|
|
3139
|
+
} else if (lt.operator === "<=" && !satisfies(lt.semver, String(c), options)) return false;
|
|
3140
|
+
}
|
|
3141
|
+
if (!c.operator && (lt || gt) && gtltComp !== 0) return false;
|
|
3142
|
+
}
|
|
3143
|
+
if (gt && hasDomLT && !lt && gtltComp !== 0) return false;
|
|
3144
|
+
if (lt && hasDomGT && !gt && gtltComp !== 0) return false;
|
|
3145
|
+
if (needDomGTPre || needDomLTPre) return false;
|
|
3146
|
+
return true;
|
|
3147
|
+
};
|
|
3148
|
+
const higherGT = (a, b, options) => {
|
|
3149
|
+
if (!a) return b;
|
|
3150
|
+
const comp = compare(a.semver, b.semver, options);
|
|
3151
|
+
return comp > 0 ? a : comp < 0 ? b : b.operator === ">" && a.operator === ">=" ? b : a;
|
|
3152
|
+
};
|
|
3153
|
+
const lowerLT = (a, b, options) => {
|
|
3154
|
+
if (!a) return b;
|
|
3155
|
+
const comp = compare(a.semver, b.semver, options);
|
|
3156
|
+
return comp < 0 ? a : comp > 0 ? b : b.operator === "<" && a.operator === "<=" ? b : a;
|
|
3157
|
+
};
|
|
3158
|
+
module.exports = subset;
|
|
3159
|
+
}));
|
|
3160
|
+
//#endregion
|
|
3161
|
+
//#region ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/index.js
|
|
3162
|
+
var require_semver = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
3163
|
+
const internalRe = require_re();
|
|
3164
|
+
const constants = require_constants();
|
|
3165
|
+
const SemVer = require_semver$1();
|
|
3166
|
+
const identifiers = require_identifiers();
|
|
3167
|
+
module.exports = {
|
|
3168
|
+
parse: require_parse(),
|
|
3169
|
+
valid: require_valid$1(),
|
|
3170
|
+
clean: require_clean(),
|
|
3171
|
+
inc: require_inc(),
|
|
3172
|
+
diff: require_diff(),
|
|
3173
|
+
major: require_major(),
|
|
3174
|
+
minor: require_minor(),
|
|
3175
|
+
patch: require_patch(),
|
|
3176
|
+
prerelease: require_prerelease(),
|
|
3177
|
+
compare: require_compare(),
|
|
3178
|
+
rcompare: require_rcompare(),
|
|
3179
|
+
compareLoose: require_compare_loose(),
|
|
3180
|
+
compareBuild: require_compare_build(),
|
|
3181
|
+
sort: require_sort(),
|
|
3182
|
+
rsort: require_rsort(),
|
|
3183
|
+
gt: require_gt(),
|
|
3184
|
+
lt: require_lt(),
|
|
3185
|
+
eq: require_eq(),
|
|
3186
|
+
neq: require_neq(),
|
|
3187
|
+
gte: require_gte(),
|
|
3188
|
+
lte: require_lte(),
|
|
3189
|
+
cmp: require_cmp(),
|
|
3190
|
+
coerce: require_coerce(),
|
|
3191
|
+
Comparator: require_comparator(),
|
|
3192
|
+
Range: require_range(),
|
|
3193
|
+
satisfies: require_satisfies(),
|
|
3194
|
+
toComparators: require_to_comparators(),
|
|
3195
|
+
maxSatisfying: require_max_satisfying(),
|
|
3196
|
+
minSatisfying: require_min_satisfying(),
|
|
3197
|
+
minVersion: require_min_version(),
|
|
3198
|
+
validRange: require_valid(),
|
|
3199
|
+
outside: require_outside(),
|
|
3200
|
+
gtr: require_gtr(),
|
|
3201
|
+
ltr: require_ltr(),
|
|
3202
|
+
intersects: require_intersects(),
|
|
3203
|
+
simplifyRange: require_simplify(),
|
|
3204
|
+
subset: require_subset(),
|
|
3205
|
+
SemVer,
|
|
3206
|
+
re: internalRe.re,
|
|
3207
|
+
src: internalRe.src,
|
|
3208
|
+
tokens: internalRe.t,
|
|
3209
|
+
SEMVER_SPEC_VERSION: constants.SEMVER_SPEC_VERSION,
|
|
3210
|
+
RELEASE_TYPES: constants.RELEASE_TYPES,
|
|
3211
|
+
compareIdentifiers: identifiers.compareIdentifiers,
|
|
3212
|
+
rcompareIdentifiers: identifiers.rcompareIdentifiers
|
|
3213
|
+
};
|
|
3214
|
+
}));
|
|
3215
|
+
//#endregion
|
|
3216
|
+
export { require_picomatch as n, require_semver as t };
|
|
3217
|
+
|
|
3218
|
+
//# sourceMappingURL=semver-DFtnEmN-.js.map
|
|
3219
|
+
//# debugId=901ba4e5-e2df-5352-b388-d03a653e9bde
|