likec4 1.48.0 → 1.49.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -1
- package/__app__/src/likec4.js +5595 -4127
- package/__app__/src/routes/index.js +3 -153
- package/__app__/src/routes/projects.js +21 -1087
- package/__app__/src/routes/single.js +1221 -16
- package/__app__/src/style.css +1 -1
- package/__app__/src/vendors.js +3507 -894
- package/__app__/src/webcomponent.js +1 -1
- package/config/schema.json +155 -143
- package/dist/THIRD-PARTY-LICENSES.md +1739 -0
- package/dist/_chunks/GraphvizBinaryAdapter.mjs +72 -0
- package/dist/_chunks/filenames.mjs +14 -0
- package/dist/_chunks/index.d.mts +224 -129
- package/dist/_chunks/index2.d.mts +2033 -1908
- package/dist/_chunks/libs/@chevrotain/gast.mjs +1 -3969
- package/dist/_chunks/libs/@chevrotain/regexp-to-ast.mjs +9 -785
- package/dist/_chunks/libs/@chevrotain/utils.mjs +1 -37
- package/dist/_chunks/libs/@hono/mcp.mjs +34 -0
- package/dist/_chunks/libs/@hono/node-server.mjs +1 -436
- package/dist/_chunks/libs/@logtape/logtape.d.mts +741 -0
- package/dist/_chunks/libs/@logtape/logtape.mjs +6 -1354
- package/dist/_chunks/libs/@lume/kiwi.mjs +1 -1355
- package/dist/_chunks/libs/@modelcontextprotocol/sdk.d.mts +14 -14
- package/dist/_chunks/libs/@modelcontextprotocol/sdk.mjs +12 -25105
- package/dist/_chunks/libs/@msgpack/msgpack.mjs +1 -1503
- package/dist/_chunks/libs/@nanostores/react.mjs +1 -30
- package/dist/_chunks/libs/@smithy/util-base64.mjs +1 -100
- package/dist/_chunks/libs/ajv.mjs +1 -777
- package/dist/_chunks/libs/atomically.mjs +1 -362
- package/dist/_chunks/libs/birpc.mjs +1 -201
- package/dist/_chunks/libs/chevrotain-allstar.mjs +2 -850
- package/dist/_chunks/libs/chevrotain.mjs +55 -6229
- package/dist/_chunks/libs/conf.mjs +1 -2258
- package/dist/_chunks/libs/defu.mjs +1 -42
- package/dist/_chunks/libs/esm-env.mjs +1 -5
- package/dist/_chunks/libs/eventemitter3.mjs +1 -243
- package/dist/_chunks/libs/fast-equals.mjs +1 -446
- package/dist/_chunks/libs/find-up-simple.mjs +1 -24
- package/dist/_chunks/libs/get-port.mjs +1 -107
- package/dist/_chunks/libs/is-docker.mjs +1 -26
- package/dist/_chunks/libs/is-error-instance.mjs +1 -26
- package/dist/_chunks/libs/is-inside-container.mjs +1 -20
- package/dist/_chunks/libs/is-plain-obj.mjs +1 -9
- package/dist/_chunks/libs/isexe.mjs +1 -127
- package/dist/_chunks/libs/json5.mjs +14 -959
- package/dist/_chunks/libs/khroma.mjs +1 -605
- package/dist/_chunks/libs/ky.mjs +2 -807
- package/dist/_chunks/libs/langium.d.mts +2880 -2844
- package/dist/_chunks/libs/langium.mjs +32 -20351
- package/dist/_chunks/libs/merge-error-cause.mjs +2 -746
- package/dist/_chunks/libs/nanostores.mjs +1 -198
- package/dist/_chunks/libs/p-limit.mjs +1 -120
- package/dist/_chunks/libs/p-queue.mjs +1 -449
- package/dist/_chunks/libs/package-manager-detector.mjs +1 -559
- package/dist/_chunks/libs/package-up.mjs +1 -10
- package/dist/_chunks/libs/parse-ms.mjs +1 -36
- package/dist/_chunks/libs/pathe.mjs +1 -0
- package/dist/_chunks/libs/picomatch.mjs +1 -1673
- package/dist/_chunks/libs/pretty-ms.mjs +1 -80
- package/dist/_chunks/libs/remeda.mjs +1 -690
- package/dist/_chunks/libs/safe-stringify.mjs +1 -21
- package/dist/_chunks/libs/strip-indent.mjs +1 -15
- package/dist/_chunks/libs/tinyrainbow.mjs +1 -88
- package/dist/_chunks/libs/ts-graphviz.mjs +4 -725
- package/dist/_chunks/libs/ufo.mjs +1 -240
- package/dist/_chunks/libs/which.mjs +1 -84
- package/dist/_chunks/libs/word-wrap.mjs +12 -43
- package/dist/_chunks/node.mjs +481 -0
- package/dist/_chunks/plugin.mjs +98 -772
- package/dist/_chunks/rolldown-runtime.mjs +1 -48
- package/dist/_chunks/sequence-view.mjs +1 -575
- package/dist/cli/index.mjs +127 -1846
- package/dist/config/index.d.mts +2 -2
- package/dist/config/index.mjs +1 -6
- package/dist/index.d.mts +148 -7
- package/dist/index.mjs +1 -21
- package/dist/model/builder.mjs +1 -3
- package/dist/model/index.d.mts +57 -3
- package/dist/model/index.mjs +1 -5
- package/dist/vite-plugin/index.d.mts +4 -3
- package/dist/vite-plugin/index.mjs +1 -22
- package/dist/vite-plugin/internal.d.mts +5 -5
- package/dist/vite-plugin/internal.mjs +1 -68
- package/package.json +60 -41
- package/react/{index.d.ts → index.d.mts} +112 -70
- package/react/{index.js → index.mjs} +21361 -22064
- package/react/package.json +2 -5
- package/vite-plugin-modules.d.ts +5 -5
- package/dist/_chunks/LikeC4.d.mts +0 -121
- package/dist/_chunks/LikeC4.mjs +0 -202
- package/dist/_chunks/config-app.prod.d.mts +0 -18
- package/dist/_chunks/config-app.prod.mjs +0 -188
- package/dist/_chunks/config-webcomponent.prod.mjs +0 -71
- package/dist/_chunks/define-config.mjs +0 -409
- package/dist/_chunks/index3.d.mts +0 -60
- package/dist/_chunks/index4.d.mts +0 -1
- package/dist/_chunks/libs/@smithy/is-array-buffer.mjs +0 -10
- package/dist/_chunks/libs/hono.mjs +0 -1829
- package/dist/_chunks/libs/nanoid.mjs +0 -29
- package/dist/_chunks/model.mjs +0 -12
- package/dist/_chunks/module.d.mts +0 -71
- package/dist/_chunks/module.mjs +0 -18657
- package/dist/_chunks/vite-build.mjs +0 -69
- package/dist/_chunks/vite-dev.mjs +0 -79
- package/dist/_chunks/vite-preview.mjs +0 -27
- package/dist/language/module.d.mts +0 -5
- package/dist/language/module.mjs +0 -20
- package/dist/vite/vite-build.d.mts +0 -26
- package/dist/vite/vite-build.mjs +0 -27
- package/dist/vite/vite-dev.d.mts +0 -34
- package/dist/vite/vite-dev.mjs +0 -29
- package/dist/vite/vite-preview.d.mts +0 -20
- package/dist/vite/vite-preview.mjs +0 -26
|
@@ -1,1673 +1 @@
|
|
|
1
|
-
import { t as __commonJSMin } from "../rolldown-runtime.mjs";
|
|
2
|
-
|
|
3
|
-
//#region ../../node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/constants.js
|
|
4
|
-
var require_constants = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
5
|
-
const WIN_SLASH = "\\\\/";
|
|
6
|
-
const WIN_NO_SLASH = `[^${WIN_SLASH}]`;
|
|
7
|
-
/**
|
|
8
|
-
* Posix glob regex
|
|
9
|
-
*/
|
|
10
|
-
const DOT_LITERAL = "\\.";
|
|
11
|
-
const PLUS_LITERAL = "\\+";
|
|
12
|
-
const QMARK_LITERAL = "\\?";
|
|
13
|
-
const SLASH_LITERAL = "\\/";
|
|
14
|
-
const ONE_CHAR = "(?=.)";
|
|
15
|
-
const QMARK = "[^/]";
|
|
16
|
-
const END_ANCHOR = `(?:${SLASH_LITERAL}|$)`;
|
|
17
|
-
const START_ANCHOR = `(?:^|${SLASH_LITERAL})`;
|
|
18
|
-
const DOTS_SLASH = `${DOT_LITERAL}{1,2}${END_ANCHOR}`;
|
|
19
|
-
const POSIX_CHARS = {
|
|
20
|
-
DOT_LITERAL,
|
|
21
|
-
PLUS_LITERAL,
|
|
22
|
-
QMARK_LITERAL,
|
|
23
|
-
SLASH_LITERAL,
|
|
24
|
-
ONE_CHAR,
|
|
25
|
-
QMARK,
|
|
26
|
-
END_ANCHOR,
|
|
27
|
-
DOTS_SLASH,
|
|
28
|
-
NO_DOT: `(?!${DOT_LITERAL})`,
|
|
29
|
-
NO_DOTS: `(?!${START_ANCHOR}${DOTS_SLASH})`,
|
|
30
|
-
NO_DOT_SLASH: `(?!${DOT_LITERAL}{0,1}${END_ANCHOR})`,
|
|
31
|
-
NO_DOTS_SLASH: `(?!${DOTS_SLASH})`,
|
|
32
|
-
QMARK_NO_DOT: `[^.${SLASH_LITERAL}]`,
|
|
33
|
-
STAR: `${QMARK}*?`,
|
|
34
|
-
START_ANCHOR,
|
|
35
|
-
SEP: "/"
|
|
36
|
-
};
|
|
37
|
-
/**
|
|
38
|
-
* Windows glob regex
|
|
39
|
-
*/
|
|
40
|
-
const WINDOWS_CHARS = {
|
|
41
|
-
...POSIX_CHARS,
|
|
42
|
-
SLASH_LITERAL: `[${WIN_SLASH}]`,
|
|
43
|
-
QMARK: WIN_NO_SLASH,
|
|
44
|
-
STAR: `${WIN_NO_SLASH}*?`,
|
|
45
|
-
DOTS_SLASH: `${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$)`,
|
|
46
|
-
NO_DOT: `(?!${DOT_LITERAL})`,
|
|
47
|
-
NO_DOTS: `(?!(?:^|[${WIN_SLASH}])${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,
|
|
48
|
-
NO_DOT_SLASH: `(?!${DOT_LITERAL}{0,1}(?:[${WIN_SLASH}]|$))`,
|
|
49
|
-
NO_DOTS_SLASH: `(?!${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,
|
|
50
|
-
QMARK_NO_DOT: `[^.${WIN_SLASH}]`,
|
|
51
|
-
START_ANCHOR: `(?:^|[${WIN_SLASH}])`,
|
|
52
|
-
END_ANCHOR: `(?:[${WIN_SLASH}]|$)`,
|
|
53
|
-
SEP: "\\"
|
|
54
|
-
};
|
|
55
|
-
/**
|
|
56
|
-
* POSIX Bracket Regex
|
|
57
|
-
*/
|
|
58
|
-
const POSIX_REGEX_SOURCE = {
|
|
59
|
-
alnum: "a-zA-Z0-9",
|
|
60
|
-
alpha: "a-zA-Z",
|
|
61
|
-
ascii: "\\x00-\\x7F",
|
|
62
|
-
blank: " \\t",
|
|
63
|
-
cntrl: "\\x00-\\x1F\\x7F",
|
|
64
|
-
digit: "0-9",
|
|
65
|
-
graph: "\\x21-\\x7E",
|
|
66
|
-
lower: "a-z",
|
|
67
|
-
print: "\\x20-\\x7E ",
|
|
68
|
-
punct: "\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",
|
|
69
|
-
space: " \\t\\r\\n\\v\\f",
|
|
70
|
-
upper: "A-Z",
|
|
71
|
-
word: "A-Za-z0-9_",
|
|
72
|
-
xdigit: "A-Fa-f0-9"
|
|
73
|
-
};
|
|
74
|
-
module.exports = {
|
|
75
|
-
MAX_LENGTH: 1024 * 64,
|
|
76
|
-
POSIX_REGEX_SOURCE,
|
|
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
|
-
extglobChars(chars) {
|
|
133
|
-
return {
|
|
134
|
-
"!": {
|
|
135
|
-
type: "negate",
|
|
136
|
-
open: "(?:(?!(?:",
|
|
137
|
-
close: `))${chars.STAR})`
|
|
138
|
-
},
|
|
139
|
-
"?": {
|
|
140
|
-
type: "qmark",
|
|
141
|
-
open: "(?:",
|
|
142
|
-
close: ")?"
|
|
143
|
-
},
|
|
144
|
-
"+": {
|
|
145
|
-
type: "plus",
|
|
146
|
-
open: "(?:",
|
|
147
|
-
close: ")+"
|
|
148
|
-
},
|
|
149
|
-
"*": {
|
|
150
|
-
type: "star",
|
|
151
|
-
open: "(?:",
|
|
152
|
-
close: ")*"
|
|
153
|
-
},
|
|
154
|
-
"@": {
|
|
155
|
-
type: "at",
|
|
156
|
-
open: "(?:",
|
|
157
|
-
close: ")"
|
|
158
|
-
}
|
|
159
|
-
};
|
|
160
|
-
},
|
|
161
|
-
globChars(win32) {
|
|
162
|
-
return win32 === true ? WINDOWS_CHARS : POSIX_CHARS;
|
|
163
|
-
}
|
|
164
|
-
};
|
|
165
|
-
}));
|
|
166
|
-
|
|
167
|
-
//#endregion
|
|
168
|
-
//#region ../../node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/utils.js
|
|
169
|
-
var require_utils = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
170
|
-
const { REGEX_BACKSLASH, REGEX_REMOVE_BACKSLASH, REGEX_SPECIAL_CHARS, REGEX_SPECIAL_CHARS_GLOBAL } = require_constants();
|
|
171
|
-
exports.isObject = (val) => val !== null && typeof val === "object" && !Array.isArray(val);
|
|
172
|
-
exports.hasRegexChars = (str) => REGEX_SPECIAL_CHARS.test(str);
|
|
173
|
-
exports.isRegexChar = (str) => str.length === 1 && exports.hasRegexChars(str);
|
|
174
|
-
exports.escapeRegex = (str) => str.replace(REGEX_SPECIAL_CHARS_GLOBAL, "\\$1");
|
|
175
|
-
exports.toPosixSlashes = (str) => str.replace(REGEX_BACKSLASH, "/");
|
|
176
|
-
exports.isWindows = () => {
|
|
177
|
-
if (typeof navigator !== "undefined" && navigator.platform) {
|
|
178
|
-
const platform = navigator.platform.toLowerCase();
|
|
179
|
-
return platform === "win32" || platform === "windows";
|
|
180
|
-
}
|
|
181
|
-
if (typeof process !== "undefined" && process.platform) return process.platform === "win32";
|
|
182
|
-
return false;
|
|
183
|
-
};
|
|
184
|
-
exports.removeBackslashes = (str) => {
|
|
185
|
-
return str.replace(REGEX_REMOVE_BACKSLASH, (match) => {
|
|
186
|
-
return match === "\\" ? "" : match;
|
|
187
|
-
});
|
|
188
|
-
};
|
|
189
|
-
exports.escapeLast = (input, char, lastIdx) => {
|
|
190
|
-
const idx = input.lastIndexOf(char, lastIdx);
|
|
191
|
-
if (idx === -1) return input;
|
|
192
|
-
if (input[idx - 1] === "\\") return exports.escapeLast(input, char, idx - 1);
|
|
193
|
-
return `${input.slice(0, idx)}\\${input.slice(idx)}`;
|
|
194
|
-
};
|
|
195
|
-
exports.removePrefix = (input, state = {}) => {
|
|
196
|
-
let output = input;
|
|
197
|
-
if (output.startsWith("./")) {
|
|
198
|
-
output = output.slice(2);
|
|
199
|
-
state.prefix = "./";
|
|
200
|
-
}
|
|
201
|
-
return output;
|
|
202
|
-
};
|
|
203
|
-
exports.wrapOutput = (input, state = {}, options = {}) => {
|
|
204
|
-
let output = `${options.contains ? "" : "^"}(?:${input})${options.contains ? "" : "$"}`;
|
|
205
|
-
if (state.negated === true) output = `(?:^(?!${output}).*$)`;
|
|
206
|
-
return output;
|
|
207
|
-
};
|
|
208
|
-
exports.basename = (path, { windows } = {}) => {
|
|
209
|
-
const segs = path.split(windows ? /[\\/]/ : "/");
|
|
210
|
-
const last = segs[segs.length - 1];
|
|
211
|
-
if (last === "") return segs[segs.length - 2];
|
|
212
|
-
return last;
|
|
213
|
-
};
|
|
214
|
-
}));
|
|
215
|
-
|
|
216
|
-
//#endregion
|
|
217
|
-
//#region ../../node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/scan.js
|
|
218
|
-
var require_scan = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
219
|
-
const utils = require_utils();
|
|
220
|
-
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();
|
|
221
|
-
const isPathSeparator = (code) => {
|
|
222
|
-
return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH;
|
|
223
|
-
};
|
|
224
|
-
const depth = (token) => {
|
|
225
|
-
if (token.isPrefix !== true) token.depth = token.isGlobstar ? Infinity : 1;
|
|
226
|
-
};
|
|
227
|
-
/**
|
|
228
|
-
* Quickly scans a glob pattern and returns an object with a handful of
|
|
229
|
-
* useful properties, like `isGlob`, `path` (the leading non-glob, if it exists),
|
|
230
|
-
* `glob` (the actual pattern), `negated` (true if the path starts with `!` but not
|
|
231
|
-
* with `!(`) and `negatedExtglob` (true if the path starts with `!(`).
|
|
232
|
-
*
|
|
233
|
-
* ```js
|
|
234
|
-
* const pm = require('picomatch');
|
|
235
|
-
* console.log(pm.scan('foo/bar/*.js'));
|
|
236
|
-
* { isGlob: true, input: 'foo/bar/*.js', base: 'foo/bar', glob: '*.js' }
|
|
237
|
-
* ```
|
|
238
|
-
* @param {String} `str`
|
|
239
|
-
* @param {Object} `options`
|
|
240
|
-
* @return {Object} Returns an object with tokens and regex source string.
|
|
241
|
-
* @api public
|
|
242
|
-
*/
|
|
243
|
-
const scan = (input, options) => {
|
|
244
|
-
const opts = options || {};
|
|
245
|
-
const length = input.length - 1;
|
|
246
|
-
const scanToEnd = opts.parts === true || opts.scanToEnd === true;
|
|
247
|
-
const slashes = [];
|
|
248
|
-
const tokens = [];
|
|
249
|
-
const parts = [];
|
|
250
|
-
let str = input;
|
|
251
|
-
let index = -1;
|
|
252
|
-
let start = 0;
|
|
253
|
-
let lastIndex = 0;
|
|
254
|
-
let isBrace = false;
|
|
255
|
-
let isBracket = false;
|
|
256
|
-
let isGlob = false;
|
|
257
|
-
let isExtglob = false;
|
|
258
|
-
let isGlobstar = false;
|
|
259
|
-
let braceEscaped = false;
|
|
260
|
-
let backslashes = false;
|
|
261
|
-
let negated = false;
|
|
262
|
-
let negatedExtglob = false;
|
|
263
|
-
let finished = false;
|
|
264
|
-
let braces = 0;
|
|
265
|
-
let prev;
|
|
266
|
-
let code;
|
|
267
|
-
let token = {
|
|
268
|
-
value: "",
|
|
269
|
-
depth: 0,
|
|
270
|
-
isGlob: false
|
|
271
|
-
};
|
|
272
|
-
const eos = () => index >= length;
|
|
273
|
-
const peek = () => str.charCodeAt(index + 1);
|
|
274
|
-
const advance = () => {
|
|
275
|
-
prev = code;
|
|
276
|
-
return str.charCodeAt(++index);
|
|
277
|
-
};
|
|
278
|
-
while (index < length) {
|
|
279
|
-
code = advance();
|
|
280
|
-
let next;
|
|
281
|
-
if (code === CHAR_BACKWARD_SLASH) {
|
|
282
|
-
backslashes = token.backslashes = true;
|
|
283
|
-
code = advance();
|
|
284
|
-
if (code === CHAR_LEFT_CURLY_BRACE) braceEscaped = true;
|
|
285
|
-
continue;
|
|
286
|
-
}
|
|
287
|
-
if (braceEscaped === true || code === CHAR_LEFT_CURLY_BRACE) {
|
|
288
|
-
braces++;
|
|
289
|
-
while (eos() !== true && (code = advance())) {
|
|
290
|
-
if (code === CHAR_BACKWARD_SLASH) {
|
|
291
|
-
backslashes = token.backslashes = true;
|
|
292
|
-
advance();
|
|
293
|
-
continue;
|
|
294
|
-
}
|
|
295
|
-
if (code === CHAR_LEFT_CURLY_BRACE) {
|
|
296
|
-
braces++;
|
|
297
|
-
continue;
|
|
298
|
-
}
|
|
299
|
-
if (braceEscaped !== true && code === CHAR_DOT && (code = advance()) === CHAR_DOT) {
|
|
300
|
-
isBrace = token.isBrace = true;
|
|
301
|
-
isGlob = token.isGlob = true;
|
|
302
|
-
finished = true;
|
|
303
|
-
if (scanToEnd === true) continue;
|
|
304
|
-
break;
|
|
305
|
-
}
|
|
306
|
-
if (braceEscaped !== true && code === CHAR_COMMA) {
|
|
307
|
-
isBrace = token.isBrace = true;
|
|
308
|
-
isGlob = token.isGlob = true;
|
|
309
|
-
finished = true;
|
|
310
|
-
if (scanToEnd === true) continue;
|
|
311
|
-
break;
|
|
312
|
-
}
|
|
313
|
-
if (code === CHAR_RIGHT_CURLY_BRACE) {
|
|
314
|
-
braces--;
|
|
315
|
-
if (braces === 0) {
|
|
316
|
-
braceEscaped = false;
|
|
317
|
-
isBrace = token.isBrace = true;
|
|
318
|
-
finished = true;
|
|
319
|
-
break;
|
|
320
|
-
}
|
|
321
|
-
}
|
|
322
|
-
}
|
|
323
|
-
if (scanToEnd === true) continue;
|
|
324
|
-
break;
|
|
325
|
-
}
|
|
326
|
-
if (code === CHAR_FORWARD_SLASH) {
|
|
327
|
-
slashes.push(index);
|
|
328
|
-
tokens.push(token);
|
|
329
|
-
token = {
|
|
330
|
-
value: "",
|
|
331
|
-
depth: 0,
|
|
332
|
-
isGlob: false
|
|
333
|
-
};
|
|
334
|
-
if (finished === true) continue;
|
|
335
|
-
if (prev === CHAR_DOT && index === start + 1) {
|
|
336
|
-
start += 2;
|
|
337
|
-
continue;
|
|
338
|
-
}
|
|
339
|
-
lastIndex = index + 1;
|
|
340
|
-
continue;
|
|
341
|
-
}
|
|
342
|
-
if (opts.noext !== true) {
|
|
343
|
-
if ((code === CHAR_PLUS || code === CHAR_AT || code === CHAR_ASTERISK || code === CHAR_QUESTION_MARK || code === CHAR_EXCLAMATION_MARK) === true && peek() === CHAR_LEFT_PARENTHESES) {
|
|
344
|
-
isGlob = token.isGlob = true;
|
|
345
|
-
isExtglob = token.isExtglob = true;
|
|
346
|
-
finished = true;
|
|
347
|
-
if (code === CHAR_EXCLAMATION_MARK && index === start) negatedExtglob = true;
|
|
348
|
-
if (scanToEnd === true) {
|
|
349
|
-
while (eos() !== true && (code = advance())) {
|
|
350
|
-
if (code === CHAR_BACKWARD_SLASH) {
|
|
351
|
-
backslashes = token.backslashes = true;
|
|
352
|
-
code = advance();
|
|
353
|
-
continue;
|
|
354
|
-
}
|
|
355
|
-
if (code === CHAR_RIGHT_PARENTHESES) {
|
|
356
|
-
isGlob = token.isGlob = true;
|
|
357
|
-
finished = true;
|
|
358
|
-
break;
|
|
359
|
-
}
|
|
360
|
-
}
|
|
361
|
-
continue;
|
|
362
|
-
}
|
|
363
|
-
break;
|
|
364
|
-
}
|
|
365
|
-
}
|
|
366
|
-
if (code === CHAR_ASTERISK) {
|
|
367
|
-
if (prev === CHAR_ASTERISK) isGlobstar = token.isGlobstar = true;
|
|
368
|
-
isGlob = token.isGlob = true;
|
|
369
|
-
finished = true;
|
|
370
|
-
if (scanToEnd === true) continue;
|
|
371
|
-
break;
|
|
372
|
-
}
|
|
373
|
-
if (code === CHAR_QUESTION_MARK) {
|
|
374
|
-
isGlob = token.isGlob = true;
|
|
375
|
-
finished = true;
|
|
376
|
-
if (scanToEnd === true) continue;
|
|
377
|
-
break;
|
|
378
|
-
}
|
|
379
|
-
if (code === CHAR_LEFT_SQUARE_BRACKET) {
|
|
380
|
-
while (eos() !== true && (next = advance())) {
|
|
381
|
-
if (next === CHAR_BACKWARD_SLASH) {
|
|
382
|
-
backslashes = token.backslashes = true;
|
|
383
|
-
advance();
|
|
384
|
-
continue;
|
|
385
|
-
}
|
|
386
|
-
if (next === CHAR_RIGHT_SQUARE_BRACKET) {
|
|
387
|
-
isBracket = token.isBracket = true;
|
|
388
|
-
isGlob = token.isGlob = true;
|
|
389
|
-
finished = true;
|
|
390
|
-
break;
|
|
391
|
-
}
|
|
392
|
-
}
|
|
393
|
-
if (scanToEnd === true) continue;
|
|
394
|
-
break;
|
|
395
|
-
}
|
|
396
|
-
if (opts.nonegate !== true && code === CHAR_EXCLAMATION_MARK && index === start) {
|
|
397
|
-
negated = token.negated = true;
|
|
398
|
-
start++;
|
|
399
|
-
continue;
|
|
400
|
-
}
|
|
401
|
-
if (opts.noparen !== true && code === CHAR_LEFT_PARENTHESES) {
|
|
402
|
-
isGlob = token.isGlob = true;
|
|
403
|
-
if (scanToEnd === true) {
|
|
404
|
-
while (eos() !== true && (code = advance())) {
|
|
405
|
-
if (code === CHAR_LEFT_PARENTHESES) {
|
|
406
|
-
backslashes = token.backslashes = true;
|
|
407
|
-
code = advance();
|
|
408
|
-
continue;
|
|
409
|
-
}
|
|
410
|
-
if (code === CHAR_RIGHT_PARENTHESES) {
|
|
411
|
-
finished = true;
|
|
412
|
-
break;
|
|
413
|
-
}
|
|
414
|
-
}
|
|
415
|
-
continue;
|
|
416
|
-
}
|
|
417
|
-
break;
|
|
418
|
-
}
|
|
419
|
-
if (isGlob === true) {
|
|
420
|
-
finished = true;
|
|
421
|
-
if (scanToEnd === true) continue;
|
|
422
|
-
break;
|
|
423
|
-
}
|
|
424
|
-
}
|
|
425
|
-
if (opts.noext === true) {
|
|
426
|
-
isExtglob = false;
|
|
427
|
-
isGlob = false;
|
|
428
|
-
}
|
|
429
|
-
let base = str;
|
|
430
|
-
let prefix = "";
|
|
431
|
-
let glob = "";
|
|
432
|
-
if (start > 0) {
|
|
433
|
-
prefix = str.slice(0, start);
|
|
434
|
-
str = str.slice(start);
|
|
435
|
-
lastIndex -= start;
|
|
436
|
-
}
|
|
437
|
-
if (base && isGlob === true && lastIndex > 0) {
|
|
438
|
-
base = str.slice(0, lastIndex);
|
|
439
|
-
glob = str.slice(lastIndex);
|
|
440
|
-
} else if (isGlob === true) {
|
|
441
|
-
base = "";
|
|
442
|
-
glob = str;
|
|
443
|
-
} else base = str;
|
|
444
|
-
if (base && base !== "" && base !== "/" && base !== str) {
|
|
445
|
-
if (isPathSeparator(base.charCodeAt(base.length - 1))) base = base.slice(0, -1);
|
|
446
|
-
}
|
|
447
|
-
if (opts.unescape === true) {
|
|
448
|
-
if (glob) glob = utils.removeBackslashes(glob);
|
|
449
|
-
if (base && backslashes === true) base = utils.removeBackslashes(base);
|
|
450
|
-
}
|
|
451
|
-
const state = {
|
|
452
|
-
prefix,
|
|
453
|
-
input,
|
|
454
|
-
start,
|
|
455
|
-
base,
|
|
456
|
-
glob,
|
|
457
|
-
isBrace,
|
|
458
|
-
isBracket,
|
|
459
|
-
isGlob,
|
|
460
|
-
isExtglob,
|
|
461
|
-
isGlobstar,
|
|
462
|
-
negated,
|
|
463
|
-
negatedExtglob
|
|
464
|
-
};
|
|
465
|
-
if (opts.tokens === true) {
|
|
466
|
-
state.maxDepth = 0;
|
|
467
|
-
if (!isPathSeparator(code)) tokens.push(token);
|
|
468
|
-
state.tokens = tokens;
|
|
469
|
-
}
|
|
470
|
-
if (opts.parts === true || opts.tokens === true) {
|
|
471
|
-
let prevIndex;
|
|
472
|
-
for (let idx = 0; idx < slashes.length; idx++) {
|
|
473
|
-
const n = prevIndex ? prevIndex + 1 : start;
|
|
474
|
-
const i = slashes[idx];
|
|
475
|
-
const value = input.slice(n, i);
|
|
476
|
-
if (opts.tokens) {
|
|
477
|
-
if (idx === 0 && start !== 0) {
|
|
478
|
-
tokens[idx].isPrefix = true;
|
|
479
|
-
tokens[idx].value = prefix;
|
|
480
|
-
} else tokens[idx].value = value;
|
|
481
|
-
depth(tokens[idx]);
|
|
482
|
-
state.maxDepth += tokens[idx].depth;
|
|
483
|
-
}
|
|
484
|
-
if (idx !== 0 || value !== "") parts.push(value);
|
|
485
|
-
prevIndex = i;
|
|
486
|
-
}
|
|
487
|
-
if (prevIndex && prevIndex + 1 < input.length) {
|
|
488
|
-
const value = input.slice(prevIndex + 1);
|
|
489
|
-
parts.push(value);
|
|
490
|
-
if (opts.tokens) {
|
|
491
|
-
tokens[tokens.length - 1].value = value;
|
|
492
|
-
depth(tokens[tokens.length - 1]);
|
|
493
|
-
state.maxDepth += tokens[tokens.length - 1].depth;
|
|
494
|
-
}
|
|
495
|
-
}
|
|
496
|
-
state.slashes = slashes;
|
|
497
|
-
state.parts = parts;
|
|
498
|
-
}
|
|
499
|
-
return state;
|
|
500
|
-
};
|
|
501
|
-
module.exports = scan;
|
|
502
|
-
}));
|
|
503
|
-
|
|
504
|
-
//#endregion
|
|
505
|
-
//#region ../../node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/parse.js
|
|
506
|
-
var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
507
|
-
const constants = require_constants();
|
|
508
|
-
const utils = require_utils();
|
|
509
|
-
/**
|
|
510
|
-
* Constants
|
|
511
|
-
*/
|
|
512
|
-
const { MAX_LENGTH, POSIX_REGEX_SOURCE, REGEX_NON_SPECIAL_CHARS, REGEX_SPECIAL_CHARS_BACKREF, REPLACEMENTS } = constants;
|
|
513
|
-
/**
|
|
514
|
-
* Helpers
|
|
515
|
-
*/
|
|
516
|
-
const expandRange = (args, options) => {
|
|
517
|
-
if (typeof options.expandRange === "function") return options.expandRange(...args, options);
|
|
518
|
-
args.sort();
|
|
519
|
-
const value = `[${args.join("-")}]`;
|
|
520
|
-
try {
|
|
521
|
-
new RegExp(value);
|
|
522
|
-
} catch (ex) {
|
|
523
|
-
return args.map((v) => utils.escapeRegex(v)).join("..");
|
|
524
|
-
}
|
|
525
|
-
return value;
|
|
526
|
-
};
|
|
527
|
-
/**
|
|
528
|
-
* Create the message for a syntax error
|
|
529
|
-
*/
|
|
530
|
-
const syntaxError = (type, char) => {
|
|
531
|
-
return `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`;
|
|
532
|
-
};
|
|
533
|
-
/**
|
|
534
|
-
* Parse the given input string.
|
|
535
|
-
* @param {String} input
|
|
536
|
-
* @param {Object} options
|
|
537
|
-
* @return {Object}
|
|
538
|
-
*/
|
|
539
|
-
const parse = (input, options) => {
|
|
540
|
-
if (typeof input !== "string") throw new TypeError("Expected a string");
|
|
541
|
-
input = REPLACEMENTS[input] || input;
|
|
542
|
-
const opts = { ...options };
|
|
543
|
-
const max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
|
|
544
|
-
let len = input.length;
|
|
545
|
-
if (len > max) throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
|
|
546
|
-
const bos = {
|
|
547
|
-
type: "bos",
|
|
548
|
-
value: "",
|
|
549
|
-
output: opts.prepend || ""
|
|
550
|
-
};
|
|
551
|
-
const tokens = [bos];
|
|
552
|
-
const capture = opts.capture ? "" : "?:";
|
|
553
|
-
const PLATFORM_CHARS = constants.globChars(opts.windows);
|
|
554
|
-
const EXTGLOB_CHARS = constants.extglobChars(PLATFORM_CHARS);
|
|
555
|
-
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;
|
|
556
|
-
const globstar = (opts) => {
|
|
557
|
-
return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
|
|
558
|
-
};
|
|
559
|
-
const nodot = opts.dot ? "" : NO_DOT;
|
|
560
|
-
const qmarkNoDot = opts.dot ? QMARK : QMARK_NO_DOT;
|
|
561
|
-
let star = opts.bash === true ? globstar(opts) : STAR;
|
|
562
|
-
if (opts.capture) star = `(${star})`;
|
|
563
|
-
if (typeof opts.noext === "boolean") opts.noextglob = opts.noext;
|
|
564
|
-
const state = {
|
|
565
|
-
input,
|
|
566
|
-
index: -1,
|
|
567
|
-
start: 0,
|
|
568
|
-
dot: opts.dot === true,
|
|
569
|
-
consumed: "",
|
|
570
|
-
output: "",
|
|
571
|
-
prefix: "",
|
|
572
|
-
backtrack: false,
|
|
573
|
-
negated: false,
|
|
574
|
-
brackets: 0,
|
|
575
|
-
braces: 0,
|
|
576
|
-
parens: 0,
|
|
577
|
-
quotes: 0,
|
|
578
|
-
globstar: false,
|
|
579
|
-
tokens
|
|
580
|
-
};
|
|
581
|
-
input = utils.removePrefix(input, state);
|
|
582
|
-
len = input.length;
|
|
583
|
-
const extglobs = [];
|
|
584
|
-
const braces = [];
|
|
585
|
-
const stack = [];
|
|
586
|
-
let prev = bos;
|
|
587
|
-
let value;
|
|
588
|
-
/**
|
|
589
|
-
* Tokenizing helpers
|
|
590
|
-
*/
|
|
591
|
-
const eos = () => state.index === len - 1;
|
|
592
|
-
const peek = state.peek = (n = 1) => input[state.index + n];
|
|
593
|
-
const advance = state.advance = () => input[++state.index] || "";
|
|
594
|
-
const remaining = () => input.slice(state.index + 1);
|
|
595
|
-
const consume = (value = "", num = 0) => {
|
|
596
|
-
state.consumed += value;
|
|
597
|
-
state.index += num;
|
|
598
|
-
};
|
|
599
|
-
const append = (token) => {
|
|
600
|
-
state.output += token.output != null ? token.output : token.value;
|
|
601
|
-
consume(token.value);
|
|
602
|
-
};
|
|
603
|
-
const negate = () => {
|
|
604
|
-
let count = 1;
|
|
605
|
-
while (peek() === "!" && (peek(2) !== "(" || peek(3) === "?")) {
|
|
606
|
-
advance();
|
|
607
|
-
state.start++;
|
|
608
|
-
count++;
|
|
609
|
-
}
|
|
610
|
-
if (count % 2 === 0) return false;
|
|
611
|
-
state.negated = true;
|
|
612
|
-
state.start++;
|
|
613
|
-
return true;
|
|
614
|
-
};
|
|
615
|
-
const increment = (type) => {
|
|
616
|
-
state[type]++;
|
|
617
|
-
stack.push(type);
|
|
618
|
-
};
|
|
619
|
-
const decrement = (type) => {
|
|
620
|
-
state[type]--;
|
|
621
|
-
stack.pop();
|
|
622
|
-
};
|
|
623
|
-
/**
|
|
624
|
-
* Push tokens onto the tokens array. This helper speeds up
|
|
625
|
-
* tokenizing by 1) helping us avoid backtracking as much as possible,
|
|
626
|
-
* and 2) helping us avoid creating extra tokens when consecutive
|
|
627
|
-
* characters are plain text. This improves performance and simplifies
|
|
628
|
-
* lookbehinds.
|
|
629
|
-
*/
|
|
630
|
-
const push = (tok) => {
|
|
631
|
-
if (prev.type === "globstar") {
|
|
632
|
-
const isBrace = state.braces > 0 && (tok.type === "comma" || tok.type === "brace");
|
|
633
|
-
const isExtglob = tok.extglob === true || extglobs.length && (tok.type === "pipe" || tok.type === "paren");
|
|
634
|
-
if (tok.type !== "slash" && tok.type !== "paren" && !isBrace && !isExtglob) {
|
|
635
|
-
state.output = state.output.slice(0, -prev.output.length);
|
|
636
|
-
prev.type = "star";
|
|
637
|
-
prev.value = "*";
|
|
638
|
-
prev.output = star;
|
|
639
|
-
state.output += prev.output;
|
|
640
|
-
}
|
|
641
|
-
}
|
|
642
|
-
if (extglobs.length && tok.type !== "paren") extglobs[extglobs.length - 1].inner += tok.value;
|
|
643
|
-
if (tok.value || tok.output) append(tok);
|
|
644
|
-
if (prev && prev.type === "text" && tok.type === "text") {
|
|
645
|
-
prev.output = (prev.output || prev.value) + tok.value;
|
|
646
|
-
prev.value += tok.value;
|
|
647
|
-
return;
|
|
648
|
-
}
|
|
649
|
-
tok.prev = prev;
|
|
650
|
-
tokens.push(tok);
|
|
651
|
-
prev = tok;
|
|
652
|
-
};
|
|
653
|
-
const extglobOpen = (type, value) => {
|
|
654
|
-
const token = {
|
|
655
|
-
...EXTGLOB_CHARS[value],
|
|
656
|
-
conditions: 1,
|
|
657
|
-
inner: ""
|
|
658
|
-
};
|
|
659
|
-
token.prev = prev;
|
|
660
|
-
token.parens = state.parens;
|
|
661
|
-
token.output = state.output;
|
|
662
|
-
const output = (opts.capture ? "(" : "") + token.open;
|
|
663
|
-
increment("parens");
|
|
664
|
-
push({
|
|
665
|
-
type,
|
|
666
|
-
value,
|
|
667
|
-
output: state.output ? "" : ONE_CHAR
|
|
668
|
-
});
|
|
669
|
-
push({
|
|
670
|
-
type: "paren",
|
|
671
|
-
extglob: true,
|
|
672
|
-
value: advance(),
|
|
673
|
-
output
|
|
674
|
-
});
|
|
675
|
-
extglobs.push(token);
|
|
676
|
-
};
|
|
677
|
-
const extglobClose = (token) => {
|
|
678
|
-
let output = token.close + (opts.capture ? ")" : "");
|
|
679
|
-
let rest;
|
|
680
|
-
if (token.type === "negate") {
|
|
681
|
-
let extglobStar = star;
|
|
682
|
-
if (token.inner && token.inner.length > 1 && token.inner.includes("/")) extglobStar = globstar(opts);
|
|
683
|
-
if (extglobStar !== star || eos() || /^\)+$/.test(remaining())) output = token.close = `)$))${extglobStar}`;
|
|
684
|
-
if (token.inner.includes("*") && (rest = remaining()) && /^\.[^\\/.]+$/.test(rest)) output = token.close = `)${parse(rest, {
|
|
685
|
-
...options,
|
|
686
|
-
fastpaths: false
|
|
687
|
-
}).output})${extglobStar})`;
|
|
688
|
-
if (token.prev.type === "bos") state.negatedExtglob = true;
|
|
689
|
-
}
|
|
690
|
-
push({
|
|
691
|
-
type: "paren",
|
|
692
|
-
extglob: true,
|
|
693
|
-
value,
|
|
694
|
-
output
|
|
695
|
-
});
|
|
696
|
-
decrement("parens");
|
|
697
|
-
};
|
|
698
|
-
/**
|
|
699
|
-
* Fast paths
|
|
700
|
-
*/
|
|
701
|
-
if (opts.fastpaths !== false && !/(^[*!]|[/()[\]{}"])/.test(input)) {
|
|
702
|
-
let backslashes = false;
|
|
703
|
-
let output = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (m, esc, chars, first, rest, index) => {
|
|
704
|
-
if (first === "\\") {
|
|
705
|
-
backslashes = true;
|
|
706
|
-
return m;
|
|
707
|
-
}
|
|
708
|
-
if (first === "?") {
|
|
709
|
-
if (esc) return esc + first + (rest ? QMARK.repeat(rest.length) : "");
|
|
710
|
-
if (index === 0) return qmarkNoDot + (rest ? QMARK.repeat(rest.length) : "");
|
|
711
|
-
return QMARK.repeat(chars.length);
|
|
712
|
-
}
|
|
713
|
-
if (first === ".") return DOT_LITERAL.repeat(chars.length);
|
|
714
|
-
if (first === "*") {
|
|
715
|
-
if (esc) return esc + first + (rest ? star : "");
|
|
716
|
-
return star;
|
|
717
|
-
}
|
|
718
|
-
return esc ? m : `\\${m}`;
|
|
719
|
-
});
|
|
720
|
-
if (backslashes === true) if (opts.unescape === true) output = output.replace(/\\/g, "");
|
|
721
|
-
else output = output.replace(/\\+/g, (m) => {
|
|
722
|
-
return m.length % 2 === 0 ? "\\\\" : m ? "\\" : "";
|
|
723
|
-
});
|
|
724
|
-
if (output === input && opts.contains === true) {
|
|
725
|
-
state.output = input;
|
|
726
|
-
return state;
|
|
727
|
-
}
|
|
728
|
-
state.output = utils.wrapOutput(output, state, options);
|
|
729
|
-
return state;
|
|
730
|
-
}
|
|
731
|
-
/**
|
|
732
|
-
* Tokenize input until we reach end-of-string
|
|
733
|
-
*/
|
|
734
|
-
while (!eos()) {
|
|
735
|
-
value = advance();
|
|
736
|
-
if (value === "\0") continue;
|
|
737
|
-
/**
|
|
738
|
-
* Escaped characters
|
|
739
|
-
*/
|
|
740
|
-
if (value === "\\") {
|
|
741
|
-
const next = peek();
|
|
742
|
-
if (next === "/" && opts.bash !== true) continue;
|
|
743
|
-
if (next === "." || next === ";") continue;
|
|
744
|
-
if (!next) {
|
|
745
|
-
value += "\\";
|
|
746
|
-
push({
|
|
747
|
-
type: "text",
|
|
748
|
-
value
|
|
749
|
-
});
|
|
750
|
-
continue;
|
|
751
|
-
}
|
|
752
|
-
const match = /^\\+/.exec(remaining());
|
|
753
|
-
let slashes = 0;
|
|
754
|
-
if (match && match[0].length > 2) {
|
|
755
|
-
slashes = match[0].length;
|
|
756
|
-
state.index += slashes;
|
|
757
|
-
if (slashes % 2 !== 0) value += "\\";
|
|
758
|
-
}
|
|
759
|
-
if (opts.unescape === true) value = advance();
|
|
760
|
-
else value += advance();
|
|
761
|
-
if (state.brackets === 0) {
|
|
762
|
-
push({
|
|
763
|
-
type: "text",
|
|
764
|
-
value
|
|
765
|
-
});
|
|
766
|
-
continue;
|
|
767
|
-
}
|
|
768
|
-
}
|
|
769
|
-
/**
|
|
770
|
-
* If we're inside a regex character class, continue
|
|
771
|
-
* until we reach the closing bracket.
|
|
772
|
-
*/
|
|
773
|
-
if (state.brackets > 0 && (value !== "]" || prev.value === "[" || prev.value === "[^")) {
|
|
774
|
-
if (opts.posix !== false && value === ":") {
|
|
775
|
-
const inner = prev.value.slice(1);
|
|
776
|
-
if (inner.includes("[")) {
|
|
777
|
-
prev.posix = true;
|
|
778
|
-
if (inner.includes(":")) {
|
|
779
|
-
const idx = prev.value.lastIndexOf("[");
|
|
780
|
-
const pre = prev.value.slice(0, idx);
|
|
781
|
-
const posix = POSIX_REGEX_SOURCE[prev.value.slice(idx + 2)];
|
|
782
|
-
if (posix) {
|
|
783
|
-
prev.value = pre + posix;
|
|
784
|
-
state.backtrack = true;
|
|
785
|
-
advance();
|
|
786
|
-
if (!bos.output && tokens.indexOf(prev) === 1) bos.output = ONE_CHAR;
|
|
787
|
-
continue;
|
|
788
|
-
}
|
|
789
|
-
}
|
|
790
|
-
}
|
|
791
|
-
}
|
|
792
|
-
if (value === "[" && peek() !== ":" || value === "-" && peek() === "]") value = `\\${value}`;
|
|
793
|
-
if (value === "]" && (prev.value === "[" || prev.value === "[^")) value = `\\${value}`;
|
|
794
|
-
if (opts.posix === true && value === "!" && prev.value === "[") value = "^";
|
|
795
|
-
prev.value += value;
|
|
796
|
-
append({ value });
|
|
797
|
-
continue;
|
|
798
|
-
}
|
|
799
|
-
/**
|
|
800
|
-
* If we're inside a quoted string, continue
|
|
801
|
-
* until we reach the closing double quote.
|
|
802
|
-
*/
|
|
803
|
-
if (state.quotes === 1 && value !== "\"") {
|
|
804
|
-
value = utils.escapeRegex(value);
|
|
805
|
-
prev.value += value;
|
|
806
|
-
append({ value });
|
|
807
|
-
continue;
|
|
808
|
-
}
|
|
809
|
-
/**
|
|
810
|
-
* Double quotes
|
|
811
|
-
*/
|
|
812
|
-
if (value === "\"") {
|
|
813
|
-
state.quotes = state.quotes === 1 ? 0 : 1;
|
|
814
|
-
if (opts.keepQuotes === true) push({
|
|
815
|
-
type: "text",
|
|
816
|
-
value
|
|
817
|
-
});
|
|
818
|
-
continue;
|
|
819
|
-
}
|
|
820
|
-
/**
|
|
821
|
-
* Parentheses
|
|
822
|
-
*/
|
|
823
|
-
if (value === "(") {
|
|
824
|
-
increment("parens");
|
|
825
|
-
push({
|
|
826
|
-
type: "paren",
|
|
827
|
-
value
|
|
828
|
-
});
|
|
829
|
-
continue;
|
|
830
|
-
}
|
|
831
|
-
if (value === ")") {
|
|
832
|
-
if (state.parens === 0 && opts.strictBrackets === true) throw new SyntaxError(syntaxError("opening", "("));
|
|
833
|
-
const extglob = extglobs[extglobs.length - 1];
|
|
834
|
-
if (extglob && state.parens === extglob.parens + 1) {
|
|
835
|
-
extglobClose(extglobs.pop());
|
|
836
|
-
continue;
|
|
837
|
-
}
|
|
838
|
-
push({
|
|
839
|
-
type: "paren",
|
|
840
|
-
value,
|
|
841
|
-
output: state.parens ? ")" : "\\)"
|
|
842
|
-
});
|
|
843
|
-
decrement("parens");
|
|
844
|
-
continue;
|
|
845
|
-
}
|
|
846
|
-
/**
|
|
847
|
-
* Square brackets
|
|
848
|
-
*/
|
|
849
|
-
if (value === "[") {
|
|
850
|
-
if (opts.nobracket === true || !remaining().includes("]")) {
|
|
851
|
-
if (opts.nobracket !== true && opts.strictBrackets === true) throw new SyntaxError(syntaxError("closing", "]"));
|
|
852
|
-
value = `\\${value}`;
|
|
853
|
-
} else increment("brackets");
|
|
854
|
-
push({
|
|
855
|
-
type: "bracket",
|
|
856
|
-
value
|
|
857
|
-
});
|
|
858
|
-
continue;
|
|
859
|
-
}
|
|
860
|
-
if (value === "]") {
|
|
861
|
-
if (opts.nobracket === true || prev && prev.type === "bracket" && prev.value.length === 1) {
|
|
862
|
-
push({
|
|
863
|
-
type: "text",
|
|
864
|
-
value,
|
|
865
|
-
output: `\\${value}`
|
|
866
|
-
});
|
|
867
|
-
continue;
|
|
868
|
-
}
|
|
869
|
-
if (state.brackets === 0) {
|
|
870
|
-
if (opts.strictBrackets === true) throw new SyntaxError(syntaxError("opening", "["));
|
|
871
|
-
push({
|
|
872
|
-
type: "text",
|
|
873
|
-
value,
|
|
874
|
-
output: `\\${value}`
|
|
875
|
-
});
|
|
876
|
-
continue;
|
|
877
|
-
}
|
|
878
|
-
decrement("brackets");
|
|
879
|
-
const prevValue = prev.value.slice(1);
|
|
880
|
-
if (prev.posix !== true && prevValue[0] === "^" && !prevValue.includes("/")) value = `/${value}`;
|
|
881
|
-
prev.value += value;
|
|
882
|
-
append({ value });
|
|
883
|
-
if (opts.literalBrackets === false || utils.hasRegexChars(prevValue)) continue;
|
|
884
|
-
const escaped = utils.escapeRegex(prev.value);
|
|
885
|
-
state.output = state.output.slice(0, -prev.value.length);
|
|
886
|
-
if (opts.literalBrackets === true) {
|
|
887
|
-
state.output += escaped;
|
|
888
|
-
prev.value = escaped;
|
|
889
|
-
continue;
|
|
890
|
-
}
|
|
891
|
-
prev.value = `(${capture}${escaped}|${prev.value})`;
|
|
892
|
-
state.output += prev.value;
|
|
893
|
-
continue;
|
|
894
|
-
}
|
|
895
|
-
/**
|
|
896
|
-
* Braces
|
|
897
|
-
*/
|
|
898
|
-
if (value === "{" && opts.nobrace !== true) {
|
|
899
|
-
increment("braces");
|
|
900
|
-
const open = {
|
|
901
|
-
type: "brace",
|
|
902
|
-
value,
|
|
903
|
-
output: "(",
|
|
904
|
-
outputIndex: state.output.length,
|
|
905
|
-
tokensIndex: state.tokens.length
|
|
906
|
-
};
|
|
907
|
-
braces.push(open);
|
|
908
|
-
push(open);
|
|
909
|
-
continue;
|
|
910
|
-
}
|
|
911
|
-
if (value === "}") {
|
|
912
|
-
const brace = braces[braces.length - 1];
|
|
913
|
-
if (opts.nobrace === true || !brace) {
|
|
914
|
-
push({
|
|
915
|
-
type: "text",
|
|
916
|
-
value,
|
|
917
|
-
output: value
|
|
918
|
-
});
|
|
919
|
-
continue;
|
|
920
|
-
}
|
|
921
|
-
let output = ")";
|
|
922
|
-
if (brace.dots === true) {
|
|
923
|
-
const arr = tokens.slice();
|
|
924
|
-
const range = [];
|
|
925
|
-
for (let i = arr.length - 1; i >= 0; i--) {
|
|
926
|
-
tokens.pop();
|
|
927
|
-
if (arr[i].type === "brace") break;
|
|
928
|
-
if (arr[i].type !== "dots") range.unshift(arr[i].value);
|
|
929
|
-
}
|
|
930
|
-
output = expandRange(range, opts);
|
|
931
|
-
state.backtrack = true;
|
|
932
|
-
}
|
|
933
|
-
if (brace.comma !== true && brace.dots !== true) {
|
|
934
|
-
const out = state.output.slice(0, brace.outputIndex);
|
|
935
|
-
const toks = state.tokens.slice(brace.tokensIndex);
|
|
936
|
-
brace.value = brace.output = "\\{";
|
|
937
|
-
value = output = "\\}";
|
|
938
|
-
state.output = out;
|
|
939
|
-
for (const t of toks) state.output += t.output || t.value;
|
|
940
|
-
}
|
|
941
|
-
push({
|
|
942
|
-
type: "brace",
|
|
943
|
-
value,
|
|
944
|
-
output
|
|
945
|
-
});
|
|
946
|
-
decrement("braces");
|
|
947
|
-
braces.pop();
|
|
948
|
-
continue;
|
|
949
|
-
}
|
|
950
|
-
/**
|
|
951
|
-
* Pipes
|
|
952
|
-
*/
|
|
953
|
-
if (value === "|") {
|
|
954
|
-
if (extglobs.length > 0) extglobs[extglobs.length - 1].conditions++;
|
|
955
|
-
push({
|
|
956
|
-
type: "text",
|
|
957
|
-
value
|
|
958
|
-
});
|
|
959
|
-
continue;
|
|
960
|
-
}
|
|
961
|
-
/**
|
|
962
|
-
* Commas
|
|
963
|
-
*/
|
|
964
|
-
if (value === ",") {
|
|
965
|
-
let output = value;
|
|
966
|
-
const brace = braces[braces.length - 1];
|
|
967
|
-
if (brace && stack[stack.length - 1] === "braces") {
|
|
968
|
-
brace.comma = true;
|
|
969
|
-
output = "|";
|
|
970
|
-
}
|
|
971
|
-
push({
|
|
972
|
-
type: "comma",
|
|
973
|
-
value,
|
|
974
|
-
output
|
|
975
|
-
});
|
|
976
|
-
continue;
|
|
977
|
-
}
|
|
978
|
-
/**
|
|
979
|
-
* Slashes
|
|
980
|
-
*/
|
|
981
|
-
if (value === "/") {
|
|
982
|
-
if (prev.type === "dot" && state.index === state.start + 1) {
|
|
983
|
-
state.start = state.index + 1;
|
|
984
|
-
state.consumed = "";
|
|
985
|
-
state.output = "";
|
|
986
|
-
tokens.pop();
|
|
987
|
-
prev = bos;
|
|
988
|
-
continue;
|
|
989
|
-
}
|
|
990
|
-
push({
|
|
991
|
-
type: "slash",
|
|
992
|
-
value,
|
|
993
|
-
output: SLASH_LITERAL
|
|
994
|
-
});
|
|
995
|
-
continue;
|
|
996
|
-
}
|
|
997
|
-
/**
|
|
998
|
-
* Dots
|
|
999
|
-
*/
|
|
1000
|
-
if (value === ".") {
|
|
1001
|
-
if (state.braces > 0 && prev.type === "dot") {
|
|
1002
|
-
if (prev.value === ".") prev.output = DOT_LITERAL;
|
|
1003
|
-
const brace = braces[braces.length - 1];
|
|
1004
|
-
prev.type = "dots";
|
|
1005
|
-
prev.output += value;
|
|
1006
|
-
prev.value += value;
|
|
1007
|
-
brace.dots = true;
|
|
1008
|
-
continue;
|
|
1009
|
-
}
|
|
1010
|
-
if (state.braces + state.parens === 0 && prev.type !== "bos" && prev.type !== "slash") {
|
|
1011
|
-
push({
|
|
1012
|
-
type: "text",
|
|
1013
|
-
value,
|
|
1014
|
-
output: DOT_LITERAL
|
|
1015
|
-
});
|
|
1016
|
-
continue;
|
|
1017
|
-
}
|
|
1018
|
-
push({
|
|
1019
|
-
type: "dot",
|
|
1020
|
-
value,
|
|
1021
|
-
output: DOT_LITERAL
|
|
1022
|
-
});
|
|
1023
|
-
continue;
|
|
1024
|
-
}
|
|
1025
|
-
/**
|
|
1026
|
-
* Question marks
|
|
1027
|
-
*/
|
|
1028
|
-
if (value === "?") {
|
|
1029
|
-
if (!(prev && prev.value === "(") && opts.noextglob !== true && peek() === "(" && peek(2) !== "?") {
|
|
1030
|
-
extglobOpen("qmark", value);
|
|
1031
|
-
continue;
|
|
1032
|
-
}
|
|
1033
|
-
if (prev && prev.type === "paren") {
|
|
1034
|
-
const next = peek();
|
|
1035
|
-
let output = value;
|
|
1036
|
-
if (prev.value === "(" && !/[!=<:]/.test(next) || next === "<" && !/<([!=]|\w+>)/.test(remaining())) output = `\\${value}`;
|
|
1037
|
-
push({
|
|
1038
|
-
type: "text",
|
|
1039
|
-
value,
|
|
1040
|
-
output
|
|
1041
|
-
});
|
|
1042
|
-
continue;
|
|
1043
|
-
}
|
|
1044
|
-
if (opts.dot !== true && (prev.type === "slash" || prev.type === "bos")) {
|
|
1045
|
-
push({
|
|
1046
|
-
type: "qmark",
|
|
1047
|
-
value,
|
|
1048
|
-
output: QMARK_NO_DOT
|
|
1049
|
-
});
|
|
1050
|
-
continue;
|
|
1051
|
-
}
|
|
1052
|
-
push({
|
|
1053
|
-
type: "qmark",
|
|
1054
|
-
value,
|
|
1055
|
-
output: QMARK
|
|
1056
|
-
});
|
|
1057
|
-
continue;
|
|
1058
|
-
}
|
|
1059
|
-
/**
|
|
1060
|
-
* Exclamation
|
|
1061
|
-
*/
|
|
1062
|
-
if (value === "!") {
|
|
1063
|
-
if (opts.noextglob !== true && peek() === "(") {
|
|
1064
|
-
if (peek(2) !== "?" || !/[!=<:]/.test(peek(3))) {
|
|
1065
|
-
extglobOpen("negate", value);
|
|
1066
|
-
continue;
|
|
1067
|
-
}
|
|
1068
|
-
}
|
|
1069
|
-
if (opts.nonegate !== true && state.index === 0) {
|
|
1070
|
-
negate();
|
|
1071
|
-
continue;
|
|
1072
|
-
}
|
|
1073
|
-
}
|
|
1074
|
-
/**
|
|
1075
|
-
* Plus
|
|
1076
|
-
*/
|
|
1077
|
-
if (value === "+") {
|
|
1078
|
-
if (opts.noextglob !== true && peek() === "(" && peek(2) !== "?") {
|
|
1079
|
-
extglobOpen("plus", value);
|
|
1080
|
-
continue;
|
|
1081
|
-
}
|
|
1082
|
-
if (prev && prev.value === "(" || opts.regex === false) {
|
|
1083
|
-
push({
|
|
1084
|
-
type: "plus",
|
|
1085
|
-
value,
|
|
1086
|
-
output: PLUS_LITERAL
|
|
1087
|
-
});
|
|
1088
|
-
continue;
|
|
1089
|
-
}
|
|
1090
|
-
if (prev && (prev.type === "bracket" || prev.type === "paren" || prev.type === "brace") || state.parens > 0) {
|
|
1091
|
-
push({
|
|
1092
|
-
type: "plus",
|
|
1093
|
-
value
|
|
1094
|
-
});
|
|
1095
|
-
continue;
|
|
1096
|
-
}
|
|
1097
|
-
push({
|
|
1098
|
-
type: "plus",
|
|
1099
|
-
value: PLUS_LITERAL
|
|
1100
|
-
});
|
|
1101
|
-
continue;
|
|
1102
|
-
}
|
|
1103
|
-
/**
|
|
1104
|
-
* Plain text
|
|
1105
|
-
*/
|
|
1106
|
-
if (value === "@") {
|
|
1107
|
-
if (opts.noextglob !== true && peek() === "(" && peek(2) !== "?") {
|
|
1108
|
-
push({
|
|
1109
|
-
type: "at",
|
|
1110
|
-
extglob: true,
|
|
1111
|
-
value,
|
|
1112
|
-
output: ""
|
|
1113
|
-
});
|
|
1114
|
-
continue;
|
|
1115
|
-
}
|
|
1116
|
-
push({
|
|
1117
|
-
type: "text",
|
|
1118
|
-
value
|
|
1119
|
-
});
|
|
1120
|
-
continue;
|
|
1121
|
-
}
|
|
1122
|
-
/**
|
|
1123
|
-
* Plain text
|
|
1124
|
-
*/
|
|
1125
|
-
if (value !== "*") {
|
|
1126
|
-
if (value === "$" || value === "^") value = `\\${value}`;
|
|
1127
|
-
const match = REGEX_NON_SPECIAL_CHARS.exec(remaining());
|
|
1128
|
-
if (match) {
|
|
1129
|
-
value += match[0];
|
|
1130
|
-
state.index += match[0].length;
|
|
1131
|
-
}
|
|
1132
|
-
push({
|
|
1133
|
-
type: "text",
|
|
1134
|
-
value
|
|
1135
|
-
});
|
|
1136
|
-
continue;
|
|
1137
|
-
}
|
|
1138
|
-
/**
|
|
1139
|
-
* Stars
|
|
1140
|
-
*/
|
|
1141
|
-
if (prev && (prev.type === "globstar" || prev.star === true)) {
|
|
1142
|
-
prev.type = "star";
|
|
1143
|
-
prev.star = true;
|
|
1144
|
-
prev.value += value;
|
|
1145
|
-
prev.output = star;
|
|
1146
|
-
state.backtrack = true;
|
|
1147
|
-
state.globstar = true;
|
|
1148
|
-
consume(value);
|
|
1149
|
-
continue;
|
|
1150
|
-
}
|
|
1151
|
-
let rest = remaining();
|
|
1152
|
-
if (opts.noextglob !== true && /^\([^?]/.test(rest)) {
|
|
1153
|
-
extglobOpen("star", value);
|
|
1154
|
-
continue;
|
|
1155
|
-
}
|
|
1156
|
-
if (prev.type === "star") {
|
|
1157
|
-
if (opts.noglobstar === true) {
|
|
1158
|
-
consume(value);
|
|
1159
|
-
continue;
|
|
1160
|
-
}
|
|
1161
|
-
const prior = prev.prev;
|
|
1162
|
-
const before = prior.prev;
|
|
1163
|
-
const isStart = prior.type === "slash" || prior.type === "bos";
|
|
1164
|
-
const afterStar = before && (before.type === "star" || before.type === "globstar");
|
|
1165
|
-
if (opts.bash === true && (!isStart || rest[0] && rest[0] !== "/")) {
|
|
1166
|
-
push({
|
|
1167
|
-
type: "star",
|
|
1168
|
-
value,
|
|
1169
|
-
output: ""
|
|
1170
|
-
});
|
|
1171
|
-
continue;
|
|
1172
|
-
}
|
|
1173
|
-
const isBrace = state.braces > 0 && (prior.type === "comma" || prior.type === "brace");
|
|
1174
|
-
const isExtglob = extglobs.length && (prior.type === "pipe" || prior.type === "paren");
|
|
1175
|
-
if (!isStart && prior.type !== "paren" && !isBrace && !isExtglob) {
|
|
1176
|
-
push({
|
|
1177
|
-
type: "star",
|
|
1178
|
-
value,
|
|
1179
|
-
output: ""
|
|
1180
|
-
});
|
|
1181
|
-
continue;
|
|
1182
|
-
}
|
|
1183
|
-
while (rest.slice(0, 3) === "/**") {
|
|
1184
|
-
const after = input[state.index + 4];
|
|
1185
|
-
if (after && after !== "/") break;
|
|
1186
|
-
rest = rest.slice(3);
|
|
1187
|
-
consume("/**", 3);
|
|
1188
|
-
}
|
|
1189
|
-
if (prior.type === "bos" && eos()) {
|
|
1190
|
-
prev.type = "globstar";
|
|
1191
|
-
prev.value += value;
|
|
1192
|
-
prev.output = globstar(opts);
|
|
1193
|
-
state.output = prev.output;
|
|
1194
|
-
state.globstar = true;
|
|
1195
|
-
consume(value);
|
|
1196
|
-
continue;
|
|
1197
|
-
}
|
|
1198
|
-
if (prior.type === "slash" && prior.prev.type !== "bos" && !afterStar && eos()) {
|
|
1199
|
-
state.output = state.output.slice(0, -(prior.output + prev.output).length);
|
|
1200
|
-
prior.output = `(?:${prior.output}`;
|
|
1201
|
-
prev.type = "globstar";
|
|
1202
|
-
prev.output = globstar(opts) + (opts.strictSlashes ? ")" : "|$)");
|
|
1203
|
-
prev.value += value;
|
|
1204
|
-
state.globstar = true;
|
|
1205
|
-
state.output += prior.output + prev.output;
|
|
1206
|
-
consume(value);
|
|
1207
|
-
continue;
|
|
1208
|
-
}
|
|
1209
|
-
if (prior.type === "slash" && prior.prev.type !== "bos" && rest[0] === "/") {
|
|
1210
|
-
const end = rest[1] !== void 0 ? "|$" : "";
|
|
1211
|
-
state.output = state.output.slice(0, -(prior.output + prev.output).length);
|
|
1212
|
-
prior.output = `(?:${prior.output}`;
|
|
1213
|
-
prev.type = "globstar";
|
|
1214
|
-
prev.output = `${globstar(opts)}${SLASH_LITERAL}|${SLASH_LITERAL}${end})`;
|
|
1215
|
-
prev.value += value;
|
|
1216
|
-
state.output += prior.output + prev.output;
|
|
1217
|
-
state.globstar = true;
|
|
1218
|
-
consume(value + advance());
|
|
1219
|
-
push({
|
|
1220
|
-
type: "slash",
|
|
1221
|
-
value: "/",
|
|
1222
|
-
output: ""
|
|
1223
|
-
});
|
|
1224
|
-
continue;
|
|
1225
|
-
}
|
|
1226
|
-
if (prior.type === "bos" && rest[0] === "/") {
|
|
1227
|
-
prev.type = "globstar";
|
|
1228
|
-
prev.value += value;
|
|
1229
|
-
prev.output = `(?:^|${SLASH_LITERAL}|${globstar(opts)}${SLASH_LITERAL})`;
|
|
1230
|
-
state.output = prev.output;
|
|
1231
|
-
state.globstar = true;
|
|
1232
|
-
consume(value + advance());
|
|
1233
|
-
push({
|
|
1234
|
-
type: "slash",
|
|
1235
|
-
value: "/",
|
|
1236
|
-
output: ""
|
|
1237
|
-
});
|
|
1238
|
-
continue;
|
|
1239
|
-
}
|
|
1240
|
-
state.output = state.output.slice(0, -prev.output.length);
|
|
1241
|
-
prev.type = "globstar";
|
|
1242
|
-
prev.output = globstar(opts);
|
|
1243
|
-
prev.value += value;
|
|
1244
|
-
state.output += prev.output;
|
|
1245
|
-
state.globstar = true;
|
|
1246
|
-
consume(value);
|
|
1247
|
-
continue;
|
|
1248
|
-
}
|
|
1249
|
-
const token = {
|
|
1250
|
-
type: "star",
|
|
1251
|
-
value,
|
|
1252
|
-
output: star
|
|
1253
|
-
};
|
|
1254
|
-
if (opts.bash === true) {
|
|
1255
|
-
token.output = ".*?";
|
|
1256
|
-
if (prev.type === "bos" || prev.type === "slash") token.output = nodot + token.output;
|
|
1257
|
-
push(token);
|
|
1258
|
-
continue;
|
|
1259
|
-
}
|
|
1260
|
-
if (prev && (prev.type === "bracket" || prev.type === "paren") && opts.regex === true) {
|
|
1261
|
-
token.output = value;
|
|
1262
|
-
push(token);
|
|
1263
|
-
continue;
|
|
1264
|
-
}
|
|
1265
|
-
if (state.index === state.start || prev.type === "slash" || prev.type === "dot") {
|
|
1266
|
-
if (prev.type === "dot") {
|
|
1267
|
-
state.output += NO_DOT_SLASH;
|
|
1268
|
-
prev.output += NO_DOT_SLASH;
|
|
1269
|
-
} else if (opts.dot === true) {
|
|
1270
|
-
state.output += NO_DOTS_SLASH;
|
|
1271
|
-
prev.output += NO_DOTS_SLASH;
|
|
1272
|
-
} else {
|
|
1273
|
-
state.output += nodot;
|
|
1274
|
-
prev.output += nodot;
|
|
1275
|
-
}
|
|
1276
|
-
if (peek() !== "*") {
|
|
1277
|
-
state.output += ONE_CHAR;
|
|
1278
|
-
prev.output += ONE_CHAR;
|
|
1279
|
-
}
|
|
1280
|
-
}
|
|
1281
|
-
push(token);
|
|
1282
|
-
}
|
|
1283
|
-
while (state.brackets > 0) {
|
|
1284
|
-
if (opts.strictBrackets === true) throw new SyntaxError(syntaxError("closing", "]"));
|
|
1285
|
-
state.output = utils.escapeLast(state.output, "[");
|
|
1286
|
-
decrement("brackets");
|
|
1287
|
-
}
|
|
1288
|
-
while (state.parens > 0) {
|
|
1289
|
-
if (opts.strictBrackets === true) throw new SyntaxError(syntaxError("closing", ")"));
|
|
1290
|
-
state.output = utils.escapeLast(state.output, "(");
|
|
1291
|
-
decrement("parens");
|
|
1292
|
-
}
|
|
1293
|
-
while (state.braces > 0) {
|
|
1294
|
-
if (opts.strictBrackets === true) throw new SyntaxError(syntaxError("closing", "}"));
|
|
1295
|
-
state.output = utils.escapeLast(state.output, "{");
|
|
1296
|
-
decrement("braces");
|
|
1297
|
-
}
|
|
1298
|
-
if (opts.strictSlashes !== true && (prev.type === "star" || prev.type === "bracket")) push({
|
|
1299
|
-
type: "maybe_slash",
|
|
1300
|
-
value: "",
|
|
1301
|
-
output: `${SLASH_LITERAL}?`
|
|
1302
|
-
});
|
|
1303
|
-
if (state.backtrack === true) {
|
|
1304
|
-
state.output = "";
|
|
1305
|
-
for (const token of state.tokens) {
|
|
1306
|
-
state.output += token.output != null ? token.output : token.value;
|
|
1307
|
-
if (token.suffix) state.output += token.suffix;
|
|
1308
|
-
}
|
|
1309
|
-
}
|
|
1310
|
-
return state;
|
|
1311
|
-
};
|
|
1312
|
-
/**
|
|
1313
|
-
* Fast paths for creating regular expressions for common glob patterns.
|
|
1314
|
-
* This can significantly speed up processing and has very little downside
|
|
1315
|
-
* impact when none of the fast paths match.
|
|
1316
|
-
*/
|
|
1317
|
-
parse.fastpaths = (input, options) => {
|
|
1318
|
-
const opts = { ...options };
|
|
1319
|
-
const max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
|
|
1320
|
-
const len = input.length;
|
|
1321
|
-
if (len > max) throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
|
|
1322
|
-
input = REPLACEMENTS[input] || input;
|
|
1323
|
-
const { DOT_LITERAL, SLASH_LITERAL, ONE_CHAR, DOTS_SLASH, NO_DOT, NO_DOTS, NO_DOTS_SLASH, STAR, START_ANCHOR } = constants.globChars(opts.windows);
|
|
1324
|
-
const nodot = opts.dot ? NO_DOTS : NO_DOT;
|
|
1325
|
-
const slashDot = opts.dot ? NO_DOTS_SLASH : NO_DOT;
|
|
1326
|
-
const capture = opts.capture ? "" : "?:";
|
|
1327
|
-
const state = {
|
|
1328
|
-
negated: false,
|
|
1329
|
-
prefix: ""
|
|
1330
|
-
};
|
|
1331
|
-
let star = opts.bash === true ? ".*?" : STAR;
|
|
1332
|
-
if (opts.capture) star = `(${star})`;
|
|
1333
|
-
const globstar = (opts) => {
|
|
1334
|
-
if (opts.noglobstar === true) return star;
|
|
1335
|
-
return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
|
|
1336
|
-
};
|
|
1337
|
-
const create = (str) => {
|
|
1338
|
-
switch (str) {
|
|
1339
|
-
case "*": return `${nodot}${ONE_CHAR}${star}`;
|
|
1340
|
-
case ".*": return `${DOT_LITERAL}${ONE_CHAR}${star}`;
|
|
1341
|
-
case "*.*": return `${nodot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;
|
|
1342
|
-
case "*/*": return `${nodot}${star}${SLASH_LITERAL}${ONE_CHAR}${slashDot}${star}`;
|
|
1343
|
-
case "**": return nodot + globstar(opts);
|
|
1344
|
-
case "**/*": return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${ONE_CHAR}${star}`;
|
|
1345
|
-
case "**/*.*": return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;
|
|
1346
|
-
case "**/.*": return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${DOT_LITERAL}${ONE_CHAR}${star}`;
|
|
1347
|
-
default: {
|
|
1348
|
-
const match = /^(.*?)\.(\w+)$/.exec(str);
|
|
1349
|
-
if (!match) return;
|
|
1350
|
-
const source = create(match[1]);
|
|
1351
|
-
if (!source) return;
|
|
1352
|
-
return source + DOT_LITERAL + match[2];
|
|
1353
|
-
}
|
|
1354
|
-
}
|
|
1355
|
-
};
|
|
1356
|
-
let source = create(utils.removePrefix(input, state));
|
|
1357
|
-
if (source && opts.strictSlashes !== true) source += `${SLASH_LITERAL}?`;
|
|
1358
|
-
return source;
|
|
1359
|
-
};
|
|
1360
|
-
module.exports = parse;
|
|
1361
|
-
}));
|
|
1362
|
-
|
|
1363
|
-
//#endregion
|
|
1364
|
-
//#region ../../node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/picomatch.js
|
|
1365
|
-
var require_picomatch$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1366
|
-
const scan = require_scan();
|
|
1367
|
-
const parse = require_parse();
|
|
1368
|
-
const utils = require_utils();
|
|
1369
|
-
const constants = require_constants();
|
|
1370
|
-
const isObject = (val) => val && typeof val === "object" && !Array.isArray(val);
|
|
1371
|
-
/**
|
|
1372
|
-
* Creates a matcher function from one or more glob patterns. The
|
|
1373
|
-
* returned function takes a string to match as its first argument,
|
|
1374
|
-
* and returns true if the string is a match. The returned matcher
|
|
1375
|
-
* function also takes a boolean as the second argument that, when true,
|
|
1376
|
-
* returns an object with additional information.
|
|
1377
|
-
*
|
|
1378
|
-
* ```js
|
|
1379
|
-
* const picomatch = require('picomatch');
|
|
1380
|
-
* // picomatch(glob[, options]);
|
|
1381
|
-
*
|
|
1382
|
-
* const isMatch = picomatch('*.!(*a)');
|
|
1383
|
-
* console.log(isMatch('a.a')); //=> false
|
|
1384
|
-
* console.log(isMatch('a.b')); //=> true
|
|
1385
|
-
* ```
|
|
1386
|
-
* @name picomatch
|
|
1387
|
-
* @param {String|Array} `globs` One or more glob patterns.
|
|
1388
|
-
* @param {Object=} `options`
|
|
1389
|
-
* @return {Function=} Returns a matcher function.
|
|
1390
|
-
* @api public
|
|
1391
|
-
*/
|
|
1392
|
-
const picomatch = (glob, options, returnState = false) => {
|
|
1393
|
-
if (Array.isArray(glob)) {
|
|
1394
|
-
const fns = glob.map((input) => picomatch(input, options, returnState));
|
|
1395
|
-
const arrayMatcher = (str) => {
|
|
1396
|
-
for (const isMatch of fns) {
|
|
1397
|
-
const state = isMatch(str);
|
|
1398
|
-
if (state) return state;
|
|
1399
|
-
}
|
|
1400
|
-
return false;
|
|
1401
|
-
};
|
|
1402
|
-
return arrayMatcher;
|
|
1403
|
-
}
|
|
1404
|
-
const isState = isObject(glob) && glob.tokens && glob.input;
|
|
1405
|
-
if (glob === "" || typeof glob !== "string" && !isState) throw new TypeError("Expected pattern to be a non-empty string");
|
|
1406
|
-
const opts = options || {};
|
|
1407
|
-
const posix = opts.windows;
|
|
1408
|
-
const regex = isState ? picomatch.compileRe(glob, options) : picomatch.makeRe(glob, options, false, true);
|
|
1409
|
-
const state = regex.state;
|
|
1410
|
-
delete regex.state;
|
|
1411
|
-
let isIgnored = () => false;
|
|
1412
|
-
if (opts.ignore) {
|
|
1413
|
-
const ignoreOpts = {
|
|
1414
|
-
...options,
|
|
1415
|
-
ignore: null,
|
|
1416
|
-
onMatch: null,
|
|
1417
|
-
onResult: null
|
|
1418
|
-
};
|
|
1419
|
-
isIgnored = picomatch(opts.ignore, ignoreOpts, returnState);
|
|
1420
|
-
}
|
|
1421
|
-
const matcher = (input, returnObject = false) => {
|
|
1422
|
-
const { isMatch, match, output } = picomatch.test(input, regex, options, {
|
|
1423
|
-
glob,
|
|
1424
|
-
posix
|
|
1425
|
-
});
|
|
1426
|
-
const result = {
|
|
1427
|
-
glob,
|
|
1428
|
-
state,
|
|
1429
|
-
regex,
|
|
1430
|
-
posix,
|
|
1431
|
-
input,
|
|
1432
|
-
output,
|
|
1433
|
-
match,
|
|
1434
|
-
isMatch
|
|
1435
|
-
};
|
|
1436
|
-
if (typeof opts.onResult === "function") opts.onResult(result);
|
|
1437
|
-
if (isMatch === false) {
|
|
1438
|
-
result.isMatch = false;
|
|
1439
|
-
return returnObject ? result : false;
|
|
1440
|
-
}
|
|
1441
|
-
if (isIgnored(input)) {
|
|
1442
|
-
if (typeof opts.onIgnore === "function") opts.onIgnore(result);
|
|
1443
|
-
result.isMatch = false;
|
|
1444
|
-
return returnObject ? result : false;
|
|
1445
|
-
}
|
|
1446
|
-
if (typeof opts.onMatch === "function") opts.onMatch(result);
|
|
1447
|
-
return returnObject ? result : true;
|
|
1448
|
-
};
|
|
1449
|
-
if (returnState) matcher.state = state;
|
|
1450
|
-
return matcher;
|
|
1451
|
-
};
|
|
1452
|
-
/**
|
|
1453
|
-
* Test `input` with the given `regex`. This is used by the main
|
|
1454
|
-
* `picomatch()` function to test the input string.
|
|
1455
|
-
*
|
|
1456
|
-
* ```js
|
|
1457
|
-
* const picomatch = require('picomatch');
|
|
1458
|
-
* // picomatch.test(input, regex[, options]);
|
|
1459
|
-
*
|
|
1460
|
-
* console.log(picomatch.test('foo/bar', /^(?:([^/]*?)\/([^/]*?))$/));
|
|
1461
|
-
* // { isMatch: true, match: [ 'foo/', 'foo', 'bar' ], output: 'foo/bar' }
|
|
1462
|
-
* ```
|
|
1463
|
-
* @param {String} `input` String to test.
|
|
1464
|
-
* @param {RegExp} `regex`
|
|
1465
|
-
* @return {Object} Returns an object with matching info.
|
|
1466
|
-
* @api public
|
|
1467
|
-
*/
|
|
1468
|
-
picomatch.test = (input, regex, options, { glob, posix } = {}) => {
|
|
1469
|
-
if (typeof input !== "string") throw new TypeError("Expected input to be a string");
|
|
1470
|
-
if (input === "") return {
|
|
1471
|
-
isMatch: false,
|
|
1472
|
-
output: ""
|
|
1473
|
-
};
|
|
1474
|
-
const opts = options || {};
|
|
1475
|
-
const format = opts.format || (posix ? utils.toPosixSlashes : null);
|
|
1476
|
-
let match = input === glob;
|
|
1477
|
-
let output = match && format ? format(input) : input;
|
|
1478
|
-
if (match === false) {
|
|
1479
|
-
output = format ? format(input) : input;
|
|
1480
|
-
match = output === glob;
|
|
1481
|
-
}
|
|
1482
|
-
if (match === false || opts.capture === true) if (opts.matchBase === true || opts.basename === true) match = picomatch.matchBase(input, regex, options, posix);
|
|
1483
|
-
else match = regex.exec(output);
|
|
1484
|
-
return {
|
|
1485
|
-
isMatch: Boolean(match),
|
|
1486
|
-
match,
|
|
1487
|
-
output
|
|
1488
|
-
};
|
|
1489
|
-
};
|
|
1490
|
-
/**
|
|
1491
|
-
* Match the basename of a filepath.
|
|
1492
|
-
*
|
|
1493
|
-
* ```js
|
|
1494
|
-
* const picomatch = require('picomatch');
|
|
1495
|
-
* // picomatch.matchBase(input, glob[, options]);
|
|
1496
|
-
* console.log(picomatch.matchBase('foo/bar.js', '*.js'); // true
|
|
1497
|
-
* ```
|
|
1498
|
-
* @param {String} `input` String to test.
|
|
1499
|
-
* @param {RegExp|String} `glob` Glob pattern or regex created by [.makeRe](#makeRe).
|
|
1500
|
-
* @return {Boolean}
|
|
1501
|
-
* @api public
|
|
1502
|
-
*/
|
|
1503
|
-
picomatch.matchBase = (input, glob, options) => {
|
|
1504
|
-
return (glob instanceof RegExp ? glob : picomatch.makeRe(glob, options)).test(utils.basename(input));
|
|
1505
|
-
};
|
|
1506
|
-
/**
|
|
1507
|
-
* Returns true if **any** of the given glob `patterns` match the specified `string`.
|
|
1508
|
-
*
|
|
1509
|
-
* ```js
|
|
1510
|
-
* const picomatch = require('picomatch');
|
|
1511
|
-
* // picomatch.isMatch(string, patterns[, options]);
|
|
1512
|
-
*
|
|
1513
|
-
* console.log(picomatch.isMatch('a.a', ['b.*', '*.a'])); //=> true
|
|
1514
|
-
* console.log(picomatch.isMatch('a.a', 'b.*')); //=> false
|
|
1515
|
-
* ```
|
|
1516
|
-
* @param {String|Array} str The string to test.
|
|
1517
|
-
* @param {String|Array} patterns One or more glob patterns to use for matching.
|
|
1518
|
-
* @param {Object} [options] See available [options](#options).
|
|
1519
|
-
* @return {Boolean} Returns true if any patterns match `str`
|
|
1520
|
-
* @api public
|
|
1521
|
-
*/
|
|
1522
|
-
picomatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str);
|
|
1523
|
-
/**
|
|
1524
|
-
* Parse a glob pattern to create the source string for a regular
|
|
1525
|
-
* expression.
|
|
1526
|
-
*
|
|
1527
|
-
* ```js
|
|
1528
|
-
* const picomatch = require('picomatch');
|
|
1529
|
-
* const result = picomatch.parse(pattern[, options]);
|
|
1530
|
-
* ```
|
|
1531
|
-
* @param {String} `pattern`
|
|
1532
|
-
* @param {Object} `options`
|
|
1533
|
-
* @return {Object} Returns an object with useful properties and output to be used as a regex source string.
|
|
1534
|
-
* @api public
|
|
1535
|
-
*/
|
|
1536
|
-
picomatch.parse = (pattern, options) => {
|
|
1537
|
-
if (Array.isArray(pattern)) return pattern.map((p) => picomatch.parse(p, options));
|
|
1538
|
-
return parse(pattern, {
|
|
1539
|
-
...options,
|
|
1540
|
-
fastpaths: false
|
|
1541
|
-
});
|
|
1542
|
-
};
|
|
1543
|
-
/**
|
|
1544
|
-
* Scan a glob pattern to separate the pattern into segments.
|
|
1545
|
-
*
|
|
1546
|
-
* ```js
|
|
1547
|
-
* const picomatch = require('picomatch');
|
|
1548
|
-
* // picomatch.scan(input[, options]);
|
|
1549
|
-
*
|
|
1550
|
-
* const result = picomatch.scan('!./foo/*.js');
|
|
1551
|
-
* console.log(result);
|
|
1552
|
-
* { prefix: '!./',
|
|
1553
|
-
* input: '!./foo/*.js',
|
|
1554
|
-
* start: 3,
|
|
1555
|
-
* base: 'foo',
|
|
1556
|
-
* glob: '*.js',
|
|
1557
|
-
* isBrace: false,
|
|
1558
|
-
* isBracket: false,
|
|
1559
|
-
* isGlob: true,
|
|
1560
|
-
* isExtglob: false,
|
|
1561
|
-
* isGlobstar: false,
|
|
1562
|
-
* negated: true }
|
|
1563
|
-
* ```
|
|
1564
|
-
* @param {String} `input` Glob pattern to scan.
|
|
1565
|
-
* @param {Object} `options`
|
|
1566
|
-
* @return {Object} Returns an object with
|
|
1567
|
-
* @api public
|
|
1568
|
-
*/
|
|
1569
|
-
picomatch.scan = (input, options) => scan(input, options);
|
|
1570
|
-
/**
|
|
1571
|
-
* Compile a regular expression from the `state` object returned by the
|
|
1572
|
-
* [parse()](#parse) method.
|
|
1573
|
-
*
|
|
1574
|
-
* @param {Object} `state`
|
|
1575
|
-
* @param {Object} `options`
|
|
1576
|
-
* @param {Boolean} `returnOutput` Intended for implementors, this argument allows you to return the raw output from the parser.
|
|
1577
|
-
* @param {Boolean} `returnState` Adds the state to a `state` property on the returned regex. Useful for implementors and debugging.
|
|
1578
|
-
* @return {RegExp}
|
|
1579
|
-
* @api public
|
|
1580
|
-
*/
|
|
1581
|
-
picomatch.compileRe = (state, options, returnOutput = false, returnState = false) => {
|
|
1582
|
-
if (returnOutput === true) return state.output;
|
|
1583
|
-
const opts = options || {};
|
|
1584
|
-
const prepend = opts.contains ? "" : "^";
|
|
1585
|
-
const append = opts.contains ? "" : "$";
|
|
1586
|
-
let source = `${prepend}(?:${state.output})${append}`;
|
|
1587
|
-
if (state && state.negated === true) source = `^(?!${source}).*$`;
|
|
1588
|
-
const regex = picomatch.toRegex(source, options);
|
|
1589
|
-
if (returnState === true) regex.state = state;
|
|
1590
|
-
return regex;
|
|
1591
|
-
};
|
|
1592
|
-
/**
|
|
1593
|
-
* Create a regular expression from a parsed glob pattern.
|
|
1594
|
-
*
|
|
1595
|
-
* ```js
|
|
1596
|
-
* const picomatch = require('picomatch');
|
|
1597
|
-
* const state = picomatch.parse('*.js');
|
|
1598
|
-
* // picomatch.compileRe(state[, options]);
|
|
1599
|
-
*
|
|
1600
|
-
* console.log(picomatch.compileRe(state));
|
|
1601
|
-
* //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/
|
|
1602
|
-
* ```
|
|
1603
|
-
* @param {String} `state` The object returned from the `.parse` method.
|
|
1604
|
-
* @param {Object} `options`
|
|
1605
|
-
* @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.
|
|
1606
|
-
* @param {Boolean} `returnState` Implementors may use this argument to return the state from the parsed glob with the returned regular expression.
|
|
1607
|
-
* @return {RegExp} Returns a regex created from the given pattern.
|
|
1608
|
-
* @api public
|
|
1609
|
-
*/
|
|
1610
|
-
picomatch.makeRe = (input, options = {}, returnOutput = false, returnState = false) => {
|
|
1611
|
-
if (!input || typeof input !== "string") throw new TypeError("Expected a non-empty string");
|
|
1612
|
-
let parsed = {
|
|
1613
|
-
negated: false,
|
|
1614
|
-
fastpaths: true
|
|
1615
|
-
};
|
|
1616
|
-
if (options.fastpaths !== false && (input[0] === "." || input[0] === "*")) parsed.output = parse.fastpaths(input, options);
|
|
1617
|
-
if (!parsed.output) parsed = parse(input, options);
|
|
1618
|
-
return picomatch.compileRe(parsed, options, returnOutput, returnState);
|
|
1619
|
-
};
|
|
1620
|
-
/**
|
|
1621
|
-
* Create a regular expression from the given regex source string.
|
|
1622
|
-
*
|
|
1623
|
-
* ```js
|
|
1624
|
-
* const picomatch = require('picomatch');
|
|
1625
|
-
* // picomatch.toRegex(source[, options]);
|
|
1626
|
-
*
|
|
1627
|
-
* const { output } = picomatch.parse('*.js');
|
|
1628
|
-
* console.log(picomatch.toRegex(output));
|
|
1629
|
-
* //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/
|
|
1630
|
-
* ```
|
|
1631
|
-
* @param {String} `source` Regular expression source string.
|
|
1632
|
-
* @param {Object} `options`
|
|
1633
|
-
* @return {RegExp}
|
|
1634
|
-
* @api public
|
|
1635
|
-
*/
|
|
1636
|
-
picomatch.toRegex = (source, options) => {
|
|
1637
|
-
try {
|
|
1638
|
-
const opts = options || {};
|
|
1639
|
-
return new RegExp(source, opts.flags || (opts.nocase ? "i" : ""));
|
|
1640
|
-
} catch (err) {
|
|
1641
|
-
if (options && options.debug === true) throw err;
|
|
1642
|
-
return /$^/;
|
|
1643
|
-
}
|
|
1644
|
-
};
|
|
1645
|
-
/**
|
|
1646
|
-
* Picomatch constants.
|
|
1647
|
-
* @return {Object}
|
|
1648
|
-
*/
|
|
1649
|
-
picomatch.constants = constants;
|
|
1650
|
-
/**
|
|
1651
|
-
* Expose "picomatch"
|
|
1652
|
-
*/
|
|
1653
|
-
module.exports = picomatch;
|
|
1654
|
-
}));
|
|
1655
|
-
|
|
1656
|
-
//#endregion
|
|
1657
|
-
//#region ../../node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/index.js
|
|
1658
|
-
var require_picomatch = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1659
|
-
const pico = require_picomatch$1();
|
|
1660
|
-
const utils = require_utils();
|
|
1661
|
-
function picomatch(glob, options, returnState = false) {
|
|
1662
|
-
if (options && (options.windows === null || options.windows === void 0)) options = {
|
|
1663
|
-
...options,
|
|
1664
|
-
windows: utils.isWindows()
|
|
1665
|
-
};
|
|
1666
|
-
return pico(glob, options, returnState);
|
|
1667
|
-
}
|
|
1668
|
-
Object.assign(picomatch, pico);
|
|
1669
|
-
module.exports = picomatch;
|
|
1670
|
-
}));
|
|
1671
|
-
|
|
1672
|
-
//#endregion
|
|
1673
|
-
export { require_picomatch as t };
|
|
1
|
+
import{t as __commonJSMin}from"../rolldown-runtime.mjs";var require_constants=__commonJSMin(((e,t)=>{let n=`[^\\\\/]`,r=`[^/]`,i=`(?:\\/|$)`,a=`(?:^|\\/)`,o=`\\.{1,2}${i}`,s={DOT_LITERAL:`\\.`,PLUS_LITERAL:`\\+`,QMARK_LITERAL:`\\?`,SLASH_LITERAL:`\\/`,ONE_CHAR:`(?=.)`,QMARK:r,END_ANCHOR:i,DOTS_SLASH:o,NO_DOT:`(?!\\.)`,NO_DOTS:`(?!${a}${o})`,NO_DOT_SLASH:`(?!\\.{0,1}${i})`,NO_DOTS_SLASH:`(?!${o})`,QMARK_NO_DOT:`[^.\\/]`,STAR:`${r}*?`,START_ANCHOR:a,SEP:`/`},c={...s,SLASH_LITERAL:`[\\\\/]`,QMARK:n,STAR:`${n}*?`,DOTS_SLASH:`\\.{1,2}(?:[\\\\/]|$)`,NO_DOT:`(?!\\.)`,NO_DOTS:`(?!(?:^|[\\\\/])\\.{1,2}(?:[\\\\/]|$))`,NO_DOT_SLASH:`(?!\\.{0,1}(?:[\\\\/]|$))`,NO_DOTS_SLASH:`(?!\\.{1,2}(?:[\\\\/]|$))`,QMARK_NO_DOT:`[^.\\\\/]`,START_ANCHOR:`(?:^|[\\\\/])`,END_ANCHOR:`(?:[\\\\/]|$)`,SEP:`\\`};t.exports={MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:{alnum:`a-zA-Z0-9`,alpha:`a-zA-Z`,ascii:`\\x00-\\x7F`,blank:` \\t`,cntrl:`\\x00-\\x1F\\x7F`,digit:`0-9`,graph:`\\x21-\\x7E`,lower:`a-z`,print:`\\x20-\\x7E `,punct:`\\-!"#$%&'()\\*+,./:;<=>?@[\\]^_\`{|}~`,space:` \\t\\r\\n\\v\\f`,upper:`A-Z`,word:`A-Za-z0-9_`,xdigit:`A-Fa-f0-9`},REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":`*`,"**/**":`**`,"**/**/**":`**`},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars(e){return{"!":{type:`negate`,open:`(?:(?!(?:`,close:`))${e.STAR})`},"?":{type:`qmark`,open:`(?:`,close:`)?`},"+":{type:`plus`,open:`(?:`,close:`)+`},"*":{type:`star`,open:`(?:`,close:`)*`},"@":{type:`at`,open:`(?:`,close:`)`}}},globChars(e){return e===!0?c:s}}})),require_utils=__commonJSMin((e=>{let{REGEX_BACKSLASH:n,REGEX_REMOVE_BACKSLASH:r,REGEX_SPECIAL_CHARS:i,REGEX_SPECIAL_CHARS_GLOBAL:a}=require_constants();e.isObject=e=>typeof e==`object`&&!!e&&!Array.isArray(e),e.hasRegexChars=e=>i.test(e),e.isRegexChar=t=>t.length===1&&e.hasRegexChars(t),e.escapeRegex=e=>e.replace(a,`\\$1`),e.toPosixSlashes=e=>e.replace(n,`/`),e.isWindows=()=>{if(typeof navigator<`u`&&navigator.platform){let e=navigator.platform.toLowerCase();return e===`win32`||e===`windows`}return typeof process<`u`&&process.platform?process.platform===`win32`:!1},e.removeBackslashes=e=>e.replace(r,e=>e===`\\`?``:e),e.escapeLast=(t,n,r)=>{let i=t.lastIndexOf(n,r);return i===-1?t:t[i-1]===`\\`?e.escapeLast(t,n,i-1):`${t.slice(0,i)}\\${t.slice(i)}`},e.removePrefix=(e,t={})=>{let n=e;return n.startsWith(`./`)&&(n=n.slice(2),t.prefix=`./`),n},e.wrapOutput=(e,t={},n={})=>{let r=`${n.contains?``:`^`}(?:${e})${n.contains?``:`$`}`;return t.negated===!0&&(r=`(?:^(?!${r}).*$)`),r},e.basename=(e,{windows:t}={})=>{let n=e.split(t?/[\\/]/:`/`),r=n[n.length-1];return r===``?n[n.length-2]:r}})),require_scan=__commonJSMin(((e,r)=>{let i=require_utils(),{CHAR_ASTERISK:a,CHAR_AT:o,CHAR_BACKWARD_SLASH:s,CHAR_COMMA:c,CHAR_DOT:l,CHAR_EXCLAMATION_MARK:u,CHAR_FORWARD_SLASH:d,CHAR_LEFT_CURLY_BRACE:f,CHAR_LEFT_PARENTHESES:p,CHAR_LEFT_SQUARE_BRACKET:m,CHAR_PLUS:h,CHAR_QUESTION_MARK:g,CHAR_RIGHT_CURLY_BRACE:_,CHAR_RIGHT_PARENTHESES:v,CHAR_RIGHT_SQUARE_BRACKET:y}=require_constants(),b=e=>e===d||e===s,x=e=>{e.isPrefix!==!0&&(e.depth=e.isGlobstar?1/0:1)},S=(e,t)=>{let n=t||{},r=e.length-1,S=n.parts===!0||n.scanToEnd===!0,C=[],w=[],T=[],E=e,D=-1,O=0,k=0,A=!1,j=!1,M=!1,N=!1,P=!1,F=!1,I=!1,L=!1,R=!1,z=!1,B=0,V,H,U={value:``,depth:0,isGlob:!1},W=()=>D>=r,G=()=>E.charCodeAt(D+1),K=()=>(V=H,E.charCodeAt(++D));for(;D<r;){H=K();let e;if(H===s){I=U.backslashes=!0,H=K(),H===f&&(F=!0);continue}if(F===!0||H===f){for(B++;W()!==!0&&(H=K());){if(H===s){I=U.backslashes=!0,K();continue}if(H===f){B++;continue}if(F!==!0&&H===l&&(H=K())===l){if(A=U.isBrace=!0,M=U.isGlob=!0,z=!0,S===!0)continue;break}if(F!==!0&&H===c){if(A=U.isBrace=!0,M=U.isGlob=!0,z=!0,S===!0)continue;break}if(H===_&&(B--,B===0)){F=!1,A=U.isBrace=!0,z=!0;break}}if(S===!0)continue;break}if(H===d){if(C.push(D),w.push(U),U={value:``,depth:0,isGlob:!1},z===!0)continue;if(V===l&&D===O+1){O+=2;continue}k=D+1;continue}if(n.noext!==!0&&(H===h||H===o||H===a||H===g||H===u)&&G()===p){if(M=U.isGlob=!0,N=U.isExtglob=!0,z=!0,H===u&&D===O&&(R=!0),S===!0){for(;W()!==!0&&(H=K());){if(H===s){I=U.backslashes=!0,H=K();continue}if(H===v){M=U.isGlob=!0,z=!0;break}}continue}break}if(H===a){if(V===a&&(P=U.isGlobstar=!0),M=U.isGlob=!0,z=!0,S===!0)continue;break}if(H===g){if(M=U.isGlob=!0,z=!0,S===!0)continue;break}if(H===m){for(;W()!==!0&&(e=K());){if(e===s){I=U.backslashes=!0,K();continue}if(e===y){j=U.isBracket=!0,M=U.isGlob=!0,z=!0;break}}if(S===!0)continue;break}if(n.nonegate!==!0&&H===u&&D===O){L=U.negated=!0,O++;continue}if(n.noparen!==!0&&H===p){if(M=U.isGlob=!0,S===!0){for(;W()!==!0&&(H=K());){if(H===p){I=U.backslashes=!0,H=K();continue}if(H===v){z=!0;break}}continue}break}if(M===!0){if(z=!0,S===!0)continue;break}}n.noext===!0&&(N=!1,M=!1);let q=E,J=``,Y=``;O>0&&(J=E.slice(0,O),E=E.slice(O),k-=O),q&&M===!0&&k>0?(q=E.slice(0,k),Y=E.slice(k)):M===!0?(q=``,Y=E):q=E,q&&q!==``&&q!==`/`&&q!==E&&b(q.charCodeAt(q.length-1))&&(q=q.slice(0,-1)),n.unescape===!0&&(Y&&=i.removeBackslashes(Y),q&&I===!0&&(q=i.removeBackslashes(q)));let X={prefix:J,input:e,start:O,base:q,glob:Y,isBrace:A,isBracket:j,isGlob:M,isExtglob:N,isGlobstar:P,negated:L,negatedExtglob:R};if(n.tokens===!0&&(X.maxDepth=0,b(H)||w.push(U),X.tokens=w),n.parts===!0||n.tokens===!0){let t;for(let r=0;r<C.length;r++){let i=t?t+1:O,a=C[r],o=e.slice(i,a);n.tokens&&(r===0&&O!==0?(w[r].isPrefix=!0,w[r].value=J):w[r].value=o,x(w[r]),X.maxDepth+=w[r].depth),(r!==0||o!==``)&&T.push(o),t=a}if(t&&t+1<e.length){let r=e.slice(t+1);T.push(r),n.tokens&&(w[w.length-1].value=r,x(w[w.length-1]),X.maxDepth+=w[w.length-1].depth)}X.slashes=C,X.parts=T}return X};r.exports=S})),require_parse=__commonJSMin(((e,r)=>{let i=require_constants(),a=require_utils(),{MAX_LENGTH:o,POSIX_REGEX_SOURCE:s,REGEX_NON_SPECIAL_CHARS:c,REGEX_SPECIAL_CHARS_BACKREF:l,REPLACEMENTS:u}=i,d=(e,t)=>{if(typeof t.expandRange==`function`)return t.expandRange(...e,t);e.sort();let n=`[${e.join(`-`)}]`;try{new RegExp(n)}catch{return e.map(e=>a.escapeRegex(e)).join(`..`)}return n},f=(e,t)=>`Missing ${e}: "${t}" - use "\\\\${t}" to match literal characters`,p=(e,t)=>{if(typeof e!=`string`)throw TypeError(`Expected a string`);e=u[e]||e;let n={...t},r=typeof n.maxLength==`number`?Math.min(o,n.maxLength):o,m=e.length;if(m>r)throw SyntaxError(`Input length: ${m}, exceeds maximum allowed length: ${r}`);let h={type:`bos`,value:``,output:n.prepend||``},g=[h],_=n.capture?``:`?:`,v=i.globChars(n.windows),y=i.extglobChars(v),{DOT_LITERAL:b,PLUS_LITERAL:x,SLASH_LITERAL:S,ONE_CHAR:C,DOTS_SLASH:w,NO_DOT:T,NO_DOT_SLASH:E,NO_DOTS_SLASH:D,QMARK:O,QMARK_NO_DOT:k,STAR:A,START_ANCHOR:j}=v,M=e=>`(${_}(?:(?!${j}${e.dot?w:b}).)*?)`,N=n.dot?``:T,P=n.dot?O:k,F=n.bash===!0?M(n):A;n.capture&&(F=`(${F})`),typeof n.noext==`boolean`&&(n.noextglob=n.noext);let I={input:e,index:-1,start:0,dot:n.dot===!0,consumed:``,output:``,prefix:``,backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:g};e=a.removePrefix(e,I),m=e.length;let L=[],R=[],z=[],B=h,V,H=()=>I.index===m-1,U=I.peek=(t=1)=>e[I.index+t],W=I.advance=()=>e[++I.index]||``,G=()=>e.slice(I.index+1),K=(e=``,t=0)=>{I.consumed+=e,I.index+=t},q=e=>{I.output+=e.output==null?e.value:e.output,K(e.value)},J=()=>{let e=1;for(;U()===`!`&&(U(2)!==`(`||U(3)===`?`);)W(),I.start++,e++;return e%2==0?!1:(I.negated=!0,I.start++,!0)},Y=e=>{I[e]++,z.push(e)},X=e=>{I[e]--,z.pop()},Z=e=>{if(B.type===`globstar`){let t=I.braces>0&&(e.type===`comma`||e.type===`brace`),n=e.extglob===!0||L.length&&(e.type===`pipe`||e.type===`paren`);e.type!==`slash`&&e.type!==`paren`&&!t&&!n&&(I.output=I.output.slice(0,-B.output.length),B.type=`star`,B.value=`*`,B.output=F,I.output+=B.output)}if(L.length&&e.type!==`paren`&&(L[L.length-1].inner+=e.value),(e.value||e.output)&&q(e),B&&B.type===`text`&&e.type===`text`){B.output=(B.output||B.value)+e.value,B.value+=e.value;return}e.prev=B,g.push(e),B=e},Q=(e,t)=>{let r={...y[t],conditions:1,inner:``};r.prev=B,r.parens=I.parens,r.output=I.output;let i=(n.capture?`(`:``)+r.open;Y(`parens`),Z({type:e,value:t,output:I.output?``:C}),Z({type:`paren`,extglob:!0,value:W(),output:i}),L.push(r)},$=e=>{let r=e.close+(n.capture?`)`:``),i;if(e.type===`negate`){let a=F;e.inner&&e.inner.length>1&&e.inner.includes(`/`)&&(a=M(n)),(a!==F||H()||/^\)+$/.test(G()))&&(r=e.close=`)$))${a}`),e.inner.includes(`*`)&&(i=G())&&/^\.[^\\/.]+$/.test(i)&&(r=e.close=`)${p(i,{...t,fastpaths:!1}).output})${a})`),e.prev.type===`bos`&&(I.negatedExtglob=!0)}Z({type:`paren`,extglob:!0,value:V,output:r}),X(`parens`)};if(n.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(e)){let r=!1,i=e.replace(l,(e,t,n,i,a,o)=>i===`\\`?(r=!0,e):i===`?`?t?t+i+(a?O.repeat(a.length):``):o===0?P+(a?O.repeat(a.length):``):O.repeat(n.length):i===`.`?b.repeat(n.length):i===`*`?t?t+i+(a?F:``):F:t?e:`\\${e}`);return r===!0&&(i=n.unescape===!0?i.replace(/\\/g,``):i.replace(/\\+/g,e=>e.length%2==0?`\\\\`:e?`\\`:``)),i===e&&n.contains===!0?(I.output=e,I):(I.output=a.wrapOutput(i,I,t),I)}for(;!H();){if(V=W(),V===`\0`)continue;if(V===`\\`){let e=U();if(e===`/`&&n.bash!==!0||e===`.`||e===`;`)continue;if(!e){V+=`\\`,Z({type:`text`,value:V});continue}let t=/^\\+/.exec(G()),r=0;if(t&&t[0].length>2&&(r=t[0].length,I.index+=r,r%2!=0&&(V+=`\\`)),n.unescape===!0?V=W():V+=W(),I.brackets===0){Z({type:`text`,value:V});continue}}if(I.brackets>0&&(V!==`]`||B.value===`[`||B.value===`[^`)){if(n.posix!==!1&&V===`:`){let e=B.value.slice(1);if(e.includes(`[`)&&(B.posix=!0,e.includes(`:`))){let e=B.value.lastIndexOf(`[`),t=B.value.slice(0,e),n=s[B.value.slice(e+2)];if(n){B.value=t+n,I.backtrack=!0,W(),!h.output&&g.indexOf(B)===1&&(h.output=C);continue}}}(V===`[`&&U()!==`:`||V===`-`&&U()===`]`)&&(V=`\\${V}`),V===`]`&&(B.value===`[`||B.value===`[^`)&&(V=`\\${V}`),n.posix===!0&&V===`!`&&B.value===`[`&&(V=`^`),B.value+=V,q({value:V});continue}if(I.quotes===1&&V!==`"`){V=a.escapeRegex(V),B.value+=V,q({value:V});continue}if(V===`"`){I.quotes=I.quotes===1?0:1,n.keepQuotes===!0&&Z({type:`text`,value:V});continue}if(V===`(`){Y(`parens`),Z({type:`paren`,value:V});continue}if(V===`)`){if(I.parens===0&&n.strictBrackets===!0)throw SyntaxError(f(`opening`,`(`));let e=L[L.length-1];if(e&&I.parens===e.parens+1){$(L.pop());continue}Z({type:`paren`,value:V,output:I.parens?`)`:`\\)`}),X(`parens`);continue}if(V===`[`){if(n.nobracket===!0||!G().includes(`]`)){if(n.nobracket!==!0&&n.strictBrackets===!0)throw SyntaxError(f(`closing`,`]`));V=`\\${V}`}else Y(`brackets`);Z({type:`bracket`,value:V});continue}if(V===`]`){if(n.nobracket===!0||B&&B.type===`bracket`&&B.value.length===1){Z({type:`text`,value:V,output:`\\${V}`});continue}if(I.brackets===0){if(n.strictBrackets===!0)throw SyntaxError(f(`opening`,`[`));Z({type:`text`,value:V,output:`\\${V}`});continue}X(`brackets`);let e=B.value.slice(1);if(B.posix!==!0&&e[0]===`^`&&!e.includes(`/`)&&(V=`/${V}`),B.value+=V,q({value:V}),n.literalBrackets===!1||a.hasRegexChars(e))continue;let t=a.escapeRegex(B.value);if(I.output=I.output.slice(0,-B.value.length),n.literalBrackets===!0){I.output+=t,B.value=t;continue}B.value=`(${_}${t}|${B.value})`,I.output+=B.value;continue}if(V===`{`&&n.nobrace!==!0){Y(`braces`);let e={type:`brace`,value:V,output:`(`,outputIndex:I.output.length,tokensIndex:I.tokens.length};R.push(e),Z(e);continue}if(V===`}`){let e=R[R.length-1];if(n.nobrace===!0||!e){Z({type:`text`,value:V,output:V});continue}let t=`)`;if(e.dots===!0){let e=g.slice(),r=[];for(let t=e.length-1;t>=0&&(g.pop(),e[t].type!==`brace`);t--)e[t].type!==`dots`&&r.unshift(e[t].value);t=d(r,n),I.backtrack=!0}if(e.comma!==!0&&e.dots!==!0){let n=I.output.slice(0,e.outputIndex),r=I.tokens.slice(e.tokensIndex);e.value=e.output=`\\{`,V=t=`\\}`,I.output=n;for(let e of r)I.output+=e.output||e.value}Z({type:`brace`,value:V,output:t}),X(`braces`),R.pop();continue}if(V===`|`){L.length>0&&L[L.length-1].conditions++,Z({type:`text`,value:V});continue}if(V===`,`){let e=V,t=R[R.length-1];t&&z[z.length-1]===`braces`&&(t.comma=!0,e=`|`),Z({type:`comma`,value:V,output:e});continue}if(V===`/`){if(B.type===`dot`&&I.index===I.start+1){I.start=I.index+1,I.consumed=``,I.output=``,g.pop(),B=h;continue}Z({type:`slash`,value:V,output:S});continue}if(V===`.`){if(I.braces>0&&B.type===`dot`){B.value===`.`&&(B.output=b);let e=R[R.length-1];B.type=`dots`,B.output+=V,B.value+=V,e.dots=!0;continue}if(I.braces+I.parens===0&&B.type!==`bos`&&B.type!==`slash`){Z({type:`text`,value:V,output:b});continue}Z({type:`dot`,value:V,output:b});continue}if(V===`?`){if(!(B&&B.value===`(`)&&n.noextglob!==!0&&U()===`(`&&U(2)!==`?`){Q(`qmark`,V);continue}if(B&&B.type===`paren`){let e=U(),t=V;(B.value===`(`&&!/[!=<:]/.test(e)||e===`<`&&!/<([!=]|\w+>)/.test(G()))&&(t=`\\${V}`),Z({type:`text`,value:V,output:t});continue}if(n.dot!==!0&&(B.type===`slash`||B.type===`bos`)){Z({type:`qmark`,value:V,output:k});continue}Z({type:`qmark`,value:V,output:O});continue}if(V===`!`){if(n.noextglob!==!0&&U()===`(`&&(U(2)!==`?`||!/[!=<:]/.test(U(3)))){Q(`negate`,V);continue}if(n.nonegate!==!0&&I.index===0){J();continue}}if(V===`+`){if(n.noextglob!==!0&&U()===`(`&&U(2)!==`?`){Q(`plus`,V);continue}if(B&&B.value===`(`||n.regex===!1){Z({type:`plus`,value:V,output:x});continue}if(B&&(B.type===`bracket`||B.type===`paren`||B.type===`brace`)||I.parens>0){Z({type:`plus`,value:V});continue}Z({type:`plus`,value:x});continue}if(V===`@`){if(n.noextglob!==!0&&U()===`(`&&U(2)!==`?`){Z({type:`at`,extglob:!0,value:V,output:``});continue}Z({type:`text`,value:V});continue}if(V!==`*`){(V===`$`||V===`^`)&&(V=`\\${V}`);let e=c.exec(G());e&&(V+=e[0],I.index+=e[0].length),Z({type:`text`,value:V});continue}if(B&&(B.type===`globstar`||B.star===!0)){B.type=`star`,B.star=!0,B.value+=V,B.output=F,I.backtrack=!0,I.globstar=!0,K(V);continue}let t=G();if(n.noextglob!==!0&&/^\([^?]/.test(t)){Q(`star`,V);continue}if(B.type===`star`){if(n.noglobstar===!0){K(V);continue}let r=B.prev,i=r.prev,a=r.type===`slash`||r.type===`bos`,o=i&&(i.type===`star`||i.type===`globstar`);if(n.bash===!0&&(!a||t[0]&&t[0]!==`/`)){Z({type:`star`,value:V,output:``});continue}let s=I.braces>0&&(r.type===`comma`||r.type===`brace`),c=L.length&&(r.type===`pipe`||r.type===`paren`);if(!a&&r.type!==`paren`&&!s&&!c){Z({type:`star`,value:V,output:``});continue}for(;t.slice(0,3)===`/**`;){let n=e[I.index+4];if(n&&n!==`/`)break;t=t.slice(3),K(`/**`,3)}if(r.type===`bos`&&H()){B.type=`globstar`,B.value+=V,B.output=M(n),I.output=B.output,I.globstar=!0,K(V);continue}if(r.type===`slash`&&r.prev.type!==`bos`&&!o&&H()){I.output=I.output.slice(0,-(r.output+B.output).length),r.output=`(?:${r.output}`,B.type=`globstar`,B.output=M(n)+(n.strictSlashes?`)`:`|$)`),B.value+=V,I.globstar=!0,I.output+=r.output+B.output,K(V);continue}if(r.type===`slash`&&r.prev.type!==`bos`&&t[0]===`/`){let e=t[1]===void 0?``:`|$`;I.output=I.output.slice(0,-(r.output+B.output).length),r.output=`(?:${r.output}`,B.type=`globstar`,B.output=`${M(n)}${S}|${S}${e})`,B.value+=V,I.output+=r.output+B.output,I.globstar=!0,K(V+W()),Z({type:`slash`,value:`/`,output:``});continue}if(r.type===`bos`&&t[0]===`/`){B.type=`globstar`,B.value+=V,B.output=`(?:^|${S}|${M(n)}${S})`,I.output=B.output,I.globstar=!0,K(V+W()),Z({type:`slash`,value:`/`,output:``});continue}I.output=I.output.slice(0,-B.output.length),B.type=`globstar`,B.output=M(n),B.value+=V,I.output+=B.output,I.globstar=!0,K(V);continue}let r={type:`star`,value:V,output:F};if(n.bash===!0){r.output=`.*?`,(B.type===`bos`||B.type===`slash`)&&(r.output=N+r.output),Z(r);continue}if(B&&(B.type===`bracket`||B.type===`paren`)&&n.regex===!0){r.output=V,Z(r);continue}(I.index===I.start||B.type===`slash`||B.type===`dot`)&&(B.type===`dot`?(I.output+=E,B.output+=E):n.dot===!0?(I.output+=D,B.output+=D):(I.output+=N,B.output+=N),U()!==`*`&&(I.output+=C,B.output+=C)),Z(r)}for(;I.brackets>0;){if(n.strictBrackets===!0)throw SyntaxError(f(`closing`,`]`));I.output=a.escapeLast(I.output,`[`),X(`brackets`)}for(;I.parens>0;){if(n.strictBrackets===!0)throw SyntaxError(f(`closing`,`)`));I.output=a.escapeLast(I.output,`(`),X(`parens`)}for(;I.braces>0;){if(n.strictBrackets===!0)throw SyntaxError(f(`closing`,`}`));I.output=a.escapeLast(I.output,`{`),X(`braces`)}if(n.strictSlashes!==!0&&(B.type===`star`||B.type===`bracket`)&&Z({type:`maybe_slash`,value:``,output:`${S}?`}),I.backtrack===!0){I.output=``;for(let e of I.tokens)I.output+=e.output==null?e.value:e.output,e.suffix&&(I.output+=e.suffix)}return I};p.fastpaths=(e,t)=>{let n={...t},r=typeof n.maxLength==`number`?Math.min(o,n.maxLength):o,s=e.length;if(s>r)throw SyntaxError(`Input length: ${s}, exceeds maximum allowed length: ${r}`);e=u[e]||e;let{DOT_LITERAL:c,SLASH_LITERAL:l,ONE_CHAR:d,DOTS_SLASH:f,NO_DOT:p,NO_DOTS:m,NO_DOTS_SLASH:h,STAR:g,START_ANCHOR:_}=i.globChars(n.windows),v=n.dot?m:p,y=n.dot?h:p,b=n.capture?``:`?:`,x={negated:!1,prefix:``},S=n.bash===!0?`.*?`:g;n.capture&&(S=`(${S})`);let C=e=>e.noglobstar===!0?S:`(${b}(?:(?!${_}${e.dot?f:c}).)*?)`,w=e=>{switch(e){case`*`:return`${v}${d}${S}`;case`.*`:return`${c}${d}${S}`;case`*.*`:return`${v}${S}${c}${d}${S}`;case`*/*`:return`${v}${S}${l}${d}${y}${S}`;case`**`:return v+C(n);case`**/*`:return`(?:${v}${C(n)}${l})?${y}${d}${S}`;case`**/*.*`:return`(?:${v}${C(n)}${l})?${y}${S}${c}${d}${S}`;case`**/.*`:return`(?:${v}${C(n)}${l})?${c}${d}${S}`;default:{let t=/^(.*?)\.(\w+)$/.exec(e);if(!t)return;let n=w(t[1]);return n?n+c+t[2]:void 0}}},T=w(a.removePrefix(e,x));return T&&n.strictSlashes!==!0&&(T+=`${l}?`),T},r.exports=p})),require_picomatch$1=__commonJSMin(((e,a)=>{let o=require_scan(),s=require_parse(),c=require_utils(),l=require_constants(),u=e=>e&&typeof e==`object`&&!Array.isArray(e),d=(e,t,n=!1)=>{if(Array.isArray(e)){let r=e.map(e=>d(e,t,n)),i=e=>{for(let t of r){let n=t(e);if(n)return n}return!1};return i}let r=u(e)&&e.tokens&&e.input;if(e===``||typeof e!=`string`&&!r)throw TypeError(`Expected pattern to be a non-empty string`);let i=t||{},a=i.windows,o=r?d.compileRe(e,t):d.makeRe(e,t,!1,!0),s=o.state;delete o.state;let c=()=>!1;if(i.ignore){let e={...t,ignore:null,onMatch:null,onResult:null};c=d(i.ignore,e,n)}let l=(n,r=!1)=>{let{isMatch:l,match:u,output:f}=d.test(n,o,t,{glob:e,posix:a}),p={glob:e,state:s,regex:o,posix:a,input:n,output:f,match:u,isMatch:l};return typeof i.onResult==`function`&&i.onResult(p),l===!1?(p.isMatch=!1,r?p:!1):c(n)?(typeof i.onIgnore==`function`&&i.onIgnore(p),p.isMatch=!1,r?p:!1):(typeof i.onMatch==`function`&&i.onMatch(p),r?p:!0)};return n&&(l.state=s),l};d.test=(e,t,n,{glob:r,posix:i}={})=>{if(typeof e!=`string`)throw TypeError(`Expected input to be a string`);if(e===``)return{isMatch:!1,output:``};let a=n||{},o=a.format||(i?c.toPosixSlashes:null),s=e===r,l=s&&o?o(e):e;return s===!1&&(l=o?o(e):e,s=l===r),(s===!1||a.capture===!0)&&(s=a.matchBase===!0||a.basename===!0?d.matchBase(e,t,n,i):t.exec(l)),{isMatch:!!s,match:s,output:l}},d.matchBase=(e,t,n)=>(t instanceof RegExp?t:d.makeRe(t,n)).test(c.basename(e)),d.isMatch=(e,t,n)=>d(t,n)(e),d.parse=(e,t)=>Array.isArray(e)?e.map(e=>d.parse(e,t)):s(e,{...t,fastpaths:!1}),d.scan=(e,t)=>o(e,t),d.compileRe=(e,t,n=!1,r=!1)=>{if(n===!0)return e.output;let i=t||{},a=i.contains?``:`^`,o=i.contains?``:`$`,s=`${a}(?:${e.output})${o}`;e&&e.negated===!0&&(s=`^(?!${s}).*$`);let c=d.toRegex(s,t);return r===!0&&(c.state=e),c},d.makeRe=(e,t={},n=!1,r=!1)=>{if(!e||typeof e!=`string`)throw TypeError(`Expected a non-empty string`);let i={negated:!1,fastpaths:!0};return t.fastpaths!==!1&&(e[0]===`.`||e[0]===`*`)&&(i.output=s.fastpaths(e,t)),i.output||(i=s(e,t)),d.compileRe(i,t,n,r)},d.toRegex=(e,t)=>{try{let n=t||{};return new RegExp(e,n.flags||(n.nocase?`i`:``))}catch(e){if(t&&t.debug===!0)throw e;return/$^/}},d.constants=l,a.exports=d})),require_picomatch=__commonJSMin(((e,t)=>{let r=require_picomatch$1(),i=require_utils();function o(e,t,n=!1){return t&&(t.windows===null||t.windows===void 0)&&(t={...t,windows:i.isWindows()}),r(e,t,n)}Object.assign(o,r),t.exports=o}));export{require_picomatch as t};
|