@rsbuild/core 2.1.6 → 2.1.8
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/compiled/cors/index.d.ts +1 -1
- package/compiled/css-loader/index.js +2 -2
- package/compiled/html-rspack-plugin/index.d.ts +1 -1
- package/compiled/html-rspack-plugin/index.js +14 -14
- package/compiled/postcss/index.js +1 -1
- package/compiled/postcss/lib/postcss.d.ts +4 -1
- package/compiled/postcss/package.json +1 -1
- package/compiled/postcss-loader/index.js +6 -6
- package/compiled/rslog/index.d.ts +7 -0
- package/compiled/rslog/package.json +1 -1
- package/dist/{711.js → 626.js} +336 -252
- package/dist/build.d.ts +4 -0
- package/dist/chokidar.js +1 -1046
- package/{dist-types → dist}/cli/commands.d.ts +2 -2
- package/{dist-types → dist}/cli/init.d.ts +3 -4
- package/dist/client/hmr.js +1 -1
- package/dist/client/overlay.js +1 -1
- package/{dist-types → dist}/configChain.d.ts +2 -2
- package/dist/connect-next.js +1 -876
- package/dist/cors.js +1 -1
- package/{dist-types → dist}/createCompiler.d.ts +2 -2
- package/{dist-types → dist}/createContext.d.ts +4 -3
- package/{dist-types → dist}/createRsbuild.d.ts +1 -1
- package/{dist-types → dist}/defaultConfig.d.ts +1 -1
- package/{dist-types → dist}/helpers/compiler.d.ts +1 -1
- package/{dist-types → dist}/helpers/css.d.ts +1 -1
- package/{dist-types → dist}/helpers/format.d.ts +1 -1
- package/{dist-types → dist}/helpers/fs.d.ts +2 -2
- package/{dist-types → dist}/helpers/index.d.ts +4 -4
- package/{dist-types → dist}/helpers/overlayConfig.d.ts +1 -1
- package/{dist-types → dist}/helpers/path.d.ts +1 -1
- package/dist/helpers/restartManager.d.ts +13 -0
- package/{dist-types → dist}/helpers/stats.d.ts +2 -2
- package/{dist-types → dist}/helpers/url.d.ts +2 -2
- package/{dist-types → dist}/helpers/vendors.d.ts +1 -1
- package/{dist-types → dist}/hooks.d.ts +2 -1
- package/dist/http-proxy-middleware.js +5 -3010
- package/{dist-types → dist}/index.d.ts +14 -14
- package/dist/index.js +1 -1
- package/{dist-types → dist}/initConfigs.d.ts +1 -1
- package/{dist-types → dist}/initPlugins.d.ts +2 -2
- package/{dist-types → dist}/inspectConfig.d.ts +2 -2
- package/dist/launch-editor-middleware.js +1 -544
- package/{dist-types → dist}/loadConfig.d.ts +6 -6
- package/{dist-types → dist}/loader/cssUrlLoader.d.ts +1 -1
- package/{dist-types → dist}/loader/ignoreCssLoader.d.ts +1 -1
- package/{dist-types → dist}/loader/transformLoader.d.ts +1 -1
- package/{dist-types → dist}/loader/transformRawLoader.d.ts +1 -1
- package/{dist-types → dist}/logger.d.ts +1 -1
- package/dist/manifest-plugin.js +1 -692
- package/dist/memfs.js +1 -5695
- package/{dist-types → dist}/mergeConfig.d.ts +1 -1
- package/dist/open.js +2 -439
- package/{dist-types → dist}/pluginHelper.d.ts +1 -1
- package/{dist-types → dist}/pluginManager.d.ts +2 -2
- package/{dist-types → dist}/plugins/appIcon.d.ts +1 -1
- package/{dist-types → dist}/plugins/asset.d.ts +1 -1
- package/{dist-types → dist}/plugins/basic.d.ts +1 -1
- package/dist/plugins/cache.d.ts +2 -0
- package/{dist-types → dist}/plugins/cleanOutput.d.ts +1 -1
- package/{dist-types → dist}/plugins/css.d.ts +1 -1
- package/{dist-types → dist}/plugins/define.d.ts +1 -1
- package/dist/plugins/entry.d.ts +2 -0
- package/{dist-types → dist}/plugins/externals.d.ts +2 -2
- package/{dist-types → dist}/plugins/fileSize.d.ts +1 -1
- package/{dist-types → dist}/plugins/html.d.ts +1 -1
- package/{dist-types → dist}/plugins/inlineChunk.d.ts +1 -1
- package/{dist-types → dist}/plugins/lazyCompilation.d.ts +1 -1
- package/{dist-types → dist}/plugins/manifest.d.ts +1 -1
- package/{dist-types → dist}/plugins/minimize.d.ts +3 -3
- package/{dist-types → dist}/plugins/moduleFederation.d.ts +1 -1
- package/{dist-types → dist}/plugins/nodeAddons.d.ts +1 -1
- package/dist/plugins/nonce.d.ts +2 -0
- package/{dist-types → dist}/plugins/output.d.ts +1 -1
- package/{dist-types → dist}/plugins/progress.d.ts +1 -1
- package/{dist-types → dist}/plugins/resolve.d.ts +1 -1
- package/{dist-types → dist}/plugins/resourceHints.d.ts +1 -1
- package/{dist-types → dist}/plugins/rsdoctor.d.ts +1 -1
- package/{dist-types → dist}/plugins/rspackProfile.d.ts +1 -1
- package/{dist-types → dist}/plugins/server.d.ts +1 -1
- package/{dist-types → dist}/plugins/sourceMap.d.ts +1 -1
- package/{dist-types → dist}/plugins/splitChunks.d.ts +1 -1
- package/dist/plugins/sri.d.ts +2 -0
- package/{dist-types → dist}/plugins/swc.d.ts +1 -1
- package/{dist-types → dist}/plugins/target.d.ts +1 -1
- package/dist/plugins/wasm.d.ts +2 -0
- package/{dist-types → dist}/plugins/worker.d.ts +1 -1
- package/dist/range-parser.js +1 -1
- package/dist/restart.d.ts +15 -0
- package/{dist-types → dist}/rspack-plugins/RsbuildHtmlPlugin.d.ts +1 -1
- package/{dist-types → dist}/rspack-plugins/resource-hints/HtmlResourceHintsPlugin.d.ts +1 -1
- package/{dist-types → dist}/rspack-plugins/resource-hints/doesChunkBelongToHtml.d.ts +1 -1
- package/{dist-types → dist}/rspack-plugins/resource-hints/extractChunks.d.ts +1 -1
- package/{dist-types → dist}/rspackConfig.d.ts +1 -1
- package/{dist-types → dist}/server/assets-middleware/getFileFromUrl.d.ts +1 -1
- package/{dist-types → dist}/server/assets-middleware/index.d.ts +2 -2
- package/{dist-types → dist}/server/assets-middleware/middleware.d.ts +1 -1
- package/{dist-types → dist}/server/assets-middleware/setupOutputFileSystem.d.ts +1 -1
- package/{dist-types → dist}/server/assets-middleware/setupWriteToDisk.d.ts +2 -2
- package/{dist-types → dist}/server/browserLogs.d.ts +1 -1
- package/{dist-types → dist}/server/buildManager.d.ts +3 -3
- package/{dist-types → dist}/server/cliShortcuts.d.ts +2 -2
- package/{dist-types → dist}/server/devMiddlewares.d.ts +4 -4
- package/{dist-types → dist}/server/devServer.d.ts +4 -4
- package/{dist-types → dist}/server/environment.d.ts +1 -1
- package/{dist-types → dist}/server/gzipMiddleware.d.ts +1 -1
- package/{dist-types → dist}/server/helper.d.ts +4 -4
- package/{dist-types → dist}/server/historyApiFallback.d.ts +2 -2
- package/{dist-types → dist}/server/httpServer.d.ts +1 -1
- package/{dist-types → dist}/server/middlewares.d.ts +2 -2
- package/{dist-types → dist}/server/open.d.ts +2 -2
- package/{dist-types → dist}/server/previewServer.d.ts +2 -2
- package/{dist-types → dist}/server/proxy.d.ts +3 -3
- package/{dist-types → dist}/server/runner/basic.d.ts +1 -1
- package/{dist-types → dist}/server/runner/cjs.d.ts +2 -2
- package/{dist-types → dist}/server/runner/esm.d.ts +2 -2
- package/{dist-types → dist}/server/runner/index.d.ts +1 -1
- package/{dist-types → dist}/server/serverSetup.d.ts +1 -1
- package/{dist-types → dist}/server/socketServer.d.ts +1 -1
- package/{dist-types → dist}/server/watchFiles.d.ts +4 -3
- package/dist/sirv.js +1 -1
- package/dist/tinyglobby.js +1 -1670
- package/{dist-types → dist}/types/config.d.ts +36 -19
- package/{dist-types → dist}/types/context.d.ts +11 -7
- package/{dist-types → dist}/types/hooks.d.ts +36 -9
- package/dist/types/index.d.ts +8 -0
- package/{dist-types → dist}/types/plugin.d.ts +10 -7
- package/{dist-types → dist}/types/rsbuild.d.ts +21 -14
- package/{dist-types → dist}/types/rspack.d.ts +2 -2
- package/{dist-types → dist}/types/thirdParty.d.ts +5 -5
- package/dist/ws.js +2 -1528
- package/package.json +11 -12
- package/dist-types/build.d.ts +0 -4
- package/dist-types/package.json +0 -1
- package/dist-types/plugins/cache.d.ts +0 -2
- package/dist-types/plugins/entry.d.ts +0 -2
- package/dist-types/plugins/nonce.d.ts +0 -2
- package/dist-types/plugins/sri.d.ts +0 -2
- package/dist-types/plugins/wasm.d.ts +0 -2
- package/dist-types/restart.d.ts +0 -19
- package/dist-types/types/index.d.ts +0 -8
- /package/dist/{711.js.LICENSE.txt → 626.js.LICENSE.txt} +0 -0
- /package/{dist-types → dist}/cli/index.d.ts +0 -0
- /package/dist/client/{307.js → 307~0.js} +0 -0
- /package/{dist-types → dist}/constants.d.ts +0 -0
- /package/{dist-types → dist}/helpers/exitHook.d.ts +0 -0
- /package/{dist-types → dist}/helpers/packageJson.d.ts +0 -0
- /package/{dist-types → dist}/helpers/version.d.ts +0 -0
- /package/{dist-types → dist}/loadEnv.d.ts +0 -0
- /package/{dist-types → dist}/loader/workerLoader.d.ts +0 -0
- /package/dist/{1~rslib-runtime.js → rslib-runtime.js} +0 -0
- /package/{dist-types → dist}/rspack-plugins/resource-hints/getResourceType.d.ts +0 -0
- /package/{dist-types → dist}/server/ansiHTML.d.ts +0 -0
- /package/{dist-types → dist}/server/assets-middleware/parseTokenList.d.ts +0 -0
- /package/{dist-types → dist}/server/compileState.d.ts +0 -0
- /package/{dist-types → dist}/server/gracefulShutdown.d.ts +0 -0
- /package/{dist-types → dist}/server/hmrFallback.d.ts +0 -0
- /package/{dist-types → dist}/server/overlay.d.ts +0 -0
- /package/{dist-types → dist}/server/publicPathnames.d.ts +0 -0
- /package/{dist-types → dist}/server/runner/asModule.d.ts +0 -0
- /package/{dist-types → dist}/server/runner/type.d.ts +0 -0
- /package/{dist-types → dist}/types/utils.d.ts +0 -0
package/dist/tinyglobby.js
CHANGED
|
@@ -1,1670 +1 @@
|
|
|
1
|
-
import * as __rspack_external_fs from "fs";
|
|
2
|
-
import { readdir, readdirSync, realpath, realpathSync, stat as external_fs_stat, statSync } from "fs";
|
|
3
|
-
import { basename, dirname, isAbsolute, normalize, posix, relative as external_path_relative, resolve, sep } from "path";
|
|
4
|
-
import { fileURLToPath } from "url";
|
|
5
|
-
import { createRequire } from "module";
|
|
6
|
-
import { __webpack_require__ } from "./1~rslib-runtime.js";
|
|
7
|
-
__webpack_require__.add({
|
|
8
|
-
"../../node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/index.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
9
|
-
let pico = __webpack_require__("../../node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/lib/picomatch.js"), utils = __webpack_require__("../../node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/lib/utils.js");
|
|
10
|
-
function picomatch(glob, options, returnState = !1) {
|
|
11
|
-
return options && (null === options.windows || void 0 === options.windows) && (options = {
|
|
12
|
-
...options,
|
|
13
|
-
windows: utils.isWindows()
|
|
14
|
-
}), pico(glob, options, returnState);
|
|
15
|
-
}
|
|
16
|
-
Object.assign(picomatch, pico), module.exports = picomatch;
|
|
17
|
-
},
|
|
18
|
-
"../../node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/lib/constants.js" (module) {
|
|
19
|
-
let WIN_NO_SLASH = "[^\\\\/]", QMARK = '[^/]', END_ANCHOR = "(?:\\/|$)", START_ANCHOR = "(?:^|\\/)", DOTS_SLASH = `\\.{1,2}${END_ANCHOR}`, NO_DOTS = `(?!${START_ANCHOR}${DOTS_SLASH})`, NO_DOT_SLASH = `(?!\\.{0,1}${END_ANCHOR})`, NO_DOTS_SLASH = `(?!${DOTS_SLASH})`, STAR = `${QMARK}*?`, 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: "(?!\\.)",
|
|
29
|
-
NO_DOTS,
|
|
30
|
-
NO_DOT_SLASH,
|
|
31
|
-
NO_DOTS_SLASH,
|
|
32
|
-
QMARK_NO_DOT: "[^.\\/]",
|
|
33
|
-
STAR,
|
|
34
|
-
START_ANCHOR,
|
|
35
|
-
SEP: '/'
|
|
36
|
-
}, WINDOWS_CHARS = {
|
|
37
|
-
...POSIX_CHARS,
|
|
38
|
-
SLASH_LITERAL: "[\\\\/]",
|
|
39
|
-
QMARK: WIN_NO_SLASH,
|
|
40
|
-
STAR: `${WIN_NO_SLASH}*?`,
|
|
41
|
-
DOTS_SLASH: "\\.{1,2}(?:[\\\\/]|$)",
|
|
42
|
-
NO_DOT: "(?!\\.)",
|
|
43
|
-
NO_DOTS: "(?!(?:^|[\\\\/])\\.{1,2}(?:[\\\\/]|$))",
|
|
44
|
-
NO_DOT_SLASH: "(?!\\.{0,1}(?:[\\\\/]|$))",
|
|
45
|
-
NO_DOTS_SLASH: "(?!\\.{1,2}(?:[\\\\/]|$))",
|
|
46
|
-
QMARK_NO_DOT: "[^.\\\\/]",
|
|
47
|
-
START_ANCHOR: "(?:^|[\\\\/])",
|
|
48
|
-
END_ANCHOR: "(?:[\\\\/]|$)",
|
|
49
|
-
SEP: '\\'
|
|
50
|
-
};
|
|
51
|
-
module.exports = {
|
|
52
|
-
DEFAULT_MAX_EXTGLOB_RECURSION: 0,
|
|
53
|
-
MAX_LENGTH: 65536,
|
|
54
|
-
POSIX_REGEX_SOURCE: {
|
|
55
|
-
__proto__: null,
|
|
56
|
-
alnum: 'a-zA-Z0-9',
|
|
57
|
-
alpha: 'a-zA-Z',
|
|
58
|
-
ascii: '\\x00-\\x7F',
|
|
59
|
-
blank: ' \\t',
|
|
60
|
-
cntrl: '\\x00-\\x1F\\x7F',
|
|
61
|
-
digit: '0-9',
|
|
62
|
-
graph: '\\x21-\\x7E',
|
|
63
|
-
lower: 'a-z',
|
|
64
|
-
print: '\\x20-\\x7E ',
|
|
65
|
-
punct: '\\-!"#$%&\'()\\*+,./:;<=>?@[\\]^_`{|}~',
|
|
66
|
-
space: ' \\t\\r\\n\\v\\f',
|
|
67
|
-
upper: 'A-Z',
|
|
68
|
-
word: 'A-Za-z0-9_',
|
|
69
|
-
xdigit: 'A-Fa-f0-9'
|
|
70
|
-
},
|
|
71
|
-
REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g,
|
|
72
|
-
REGEX_NON_SPECIAL_CHARS: /^[^@![\].,$*+?^{}()|\\/]+/,
|
|
73
|
-
REGEX_SPECIAL_CHARS: /[-*+?.^${}(|)[\]]/,
|
|
74
|
-
REGEX_SPECIAL_CHARS_BACKREF: /(\\?)((\W)(\3*))/g,
|
|
75
|
-
REGEX_SPECIAL_CHARS_GLOBAL: /([-*+?.^${}(|)[\]])/g,
|
|
76
|
-
REGEX_REMOVE_BACKSLASH: /(?:\[.*?[^\\]\]|\\(?=.))/g,
|
|
77
|
-
REPLACEMENTS: {
|
|
78
|
-
__proto__: null,
|
|
79
|
-
'***': '*',
|
|
80
|
-
'**/**': '**',
|
|
81
|
-
'**/**/**': '**'
|
|
82
|
-
},
|
|
83
|
-
CHAR_0: 48,
|
|
84
|
-
CHAR_9: 57,
|
|
85
|
-
CHAR_UPPERCASE_A: 65,
|
|
86
|
-
CHAR_LOWERCASE_A: 97,
|
|
87
|
-
CHAR_UPPERCASE_Z: 90,
|
|
88
|
-
CHAR_LOWERCASE_Z: 122,
|
|
89
|
-
CHAR_LEFT_PARENTHESES: 40,
|
|
90
|
-
CHAR_RIGHT_PARENTHESES: 41,
|
|
91
|
-
CHAR_ASTERISK: 42,
|
|
92
|
-
CHAR_AMPERSAND: 38,
|
|
93
|
-
CHAR_AT: 64,
|
|
94
|
-
CHAR_BACKWARD_SLASH: 92,
|
|
95
|
-
CHAR_CARRIAGE_RETURN: 13,
|
|
96
|
-
CHAR_CIRCUMFLEX_ACCENT: 94,
|
|
97
|
-
CHAR_COLON: 58,
|
|
98
|
-
CHAR_COMMA: 44,
|
|
99
|
-
CHAR_DOT: 46,
|
|
100
|
-
CHAR_DOUBLE_QUOTE: 34,
|
|
101
|
-
CHAR_EQUAL: 61,
|
|
102
|
-
CHAR_EXCLAMATION_MARK: 33,
|
|
103
|
-
CHAR_FORM_FEED: 12,
|
|
104
|
-
CHAR_FORWARD_SLASH: 47,
|
|
105
|
-
CHAR_GRAVE_ACCENT: 96,
|
|
106
|
-
CHAR_HASH: 35,
|
|
107
|
-
CHAR_HYPHEN_MINUS: 45,
|
|
108
|
-
CHAR_LEFT_ANGLE_BRACKET: 60,
|
|
109
|
-
CHAR_LEFT_CURLY_BRACE: 123,
|
|
110
|
-
CHAR_LEFT_SQUARE_BRACKET: 91,
|
|
111
|
-
CHAR_LINE_FEED: 10,
|
|
112
|
-
CHAR_NO_BREAK_SPACE: 160,
|
|
113
|
-
CHAR_PERCENT: 37,
|
|
114
|
-
CHAR_PLUS: 43,
|
|
115
|
-
CHAR_QUESTION_MARK: 63,
|
|
116
|
-
CHAR_RIGHT_ANGLE_BRACKET: 62,
|
|
117
|
-
CHAR_RIGHT_CURLY_BRACE: 125,
|
|
118
|
-
CHAR_RIGHT_SQUARE_BRACKET: 93,
|
|
119
|
-
CHAR_SEMICOLON: 59,
|
|
120
|
-
CHAR_SINGLE_QUOTE: 39,
|
|
121
|
-
CHAR_SPACE: 32,
|
|
122
|
-
CHAR_TAB: 9,
|
|
123
|
-
CHAR_UNDERSCORE: 95,
|
|
124
|
-
CHAR_VERTICAL_LINE: 124,
|
|
125
|
-
CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279,
|
|
126
|
-
extglobChars: (chars)=>({
|
|
127
|
-
'!': {
|
|
128
|
-
type: 'negate',
|
|
129
|
-
open: '(?:(?!(?:',
|
|
130
|
-
close: `))${chars.STAR})`
|
|
131
|
-
},
|
|
132
|
-
'?': {
|
|
133
|
-
type: 'qmark',
|
|
134
|
-
open: '(?:',
|
|
135
|
-
close: ')?'
|
|
136
|
-
},
|
|
137
|
-
'+': {
|
|
138
|
-
type: 'plus',
|
|
139
|
-
open: '(?:',
|
|
140
|
-
close: ')+'
|
|
141
|
-
},
|
|
142
|
-
'*': {
|
|
143
|
-
type: 'star',
|
|
144
|
-
open: '(?:',
|
|
145
|
-
close: ')*'
|
|
146
|
-
},
|
|
147
|
-
'@': {
|
|
148
|
-
type: 'at',
|
|
149
|
-
open: '(?:',
|
|
150
|
-
close: ')'
|
|
151
|
-
}
|
|
152
|
-
}),
|
|
153
|
-
globChars: (win32)=>!0 === win32 ? WINDOWS_CHARS : POSIX_CHARS
|
|
154
|
-
};
|
|
155
|
-
},
|
|
156
|
-
"../../node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/lib/parse.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
157
|
-
let constants = __webpack_require__("../../node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/lib/constants.js"), utils = __webpack_require__("../../node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/lib/utils.js"), { MAX_LENGTH, POSIX_REGEX_SOURCE, REGEX_NON_SPECIAL_CHARS, REGEX_SPECIAL_CHARS_BACKREF, REPLACEMENTS } = constants, expandRange = (args, options)=>{
|
|
158
|
-
if ('function' == typeof options.expandRange) return options.expandRange(...args, options);
|
|
159
|
-
args.sort();
|
|
160
|
-
let value = `[${args.join('-')}]`;
|
|
161
|
-
try {
|
|
162
|
-
new RegExp(value);
|
|
163
|
-
} catch (ex) {
|
|
164
|
-
return args.map((v)=>utils.escapeRegex(v)).join('..');
|
|
165
|
-
}
|
|
166
|
-
return value;
|
|
167
|
-
}, syntaxError = (type, char)=>`Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`, splitTopLevel = (input)=>{
|
|
168
|
-
let parts = [], bracket = 0, paren = 0, quote = 0, value = '', escaped = !1;
|
|
169
|
-
for (let ch of input){
|
|
170
|
-
if (!0 === escaped) {
|
|
171
|
-
value += ch, escaped = !1;
|
|
172
|
-
continue;
|
|
173
|
-
}
|
|
174
|
-
if ('\\' === ch) {
|
|
175
|
-
value += ch, escaped = !0;
|
|
176
|
-
continue;
|
|
177
|
-
}
|
|
178
|
-
if ('"' === ch) {
|
|
179
|
-
quote = +(1 !== quote), value += ch;
|
|
180
|
-
continue;
|
|
181
|
-
}
|
|
182
|
-
if (0 === quote) {
|
|
183
|
-
if ('[' === ch) bracket++;
|
|
184
|
-
else if (']' === ch && bracket > 0) bracket--;
|
|
185
|
-
else if (0 === bracket) {
|
|
186
|
-
if ('(' === ch) paren++;
|
|
187
|
-
else if (')' === ch && paren > 0) paren--;
|
|
188
|
-
else if ('|' === ch && 0 === paren) {
|
|
189
|
-
parts.push(value), value = '';
|
|
190
|
-
continue;
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
value += ch;
|
|
195
|
-
}
|
|
196
|
-
return parts.push(value), parts;
|
|
197
|
-
}, normalizeSimpleBranch = (branch)=>{
|
|
198
|
-
let value = branch.trim(), changed = !0;
|
|
199
|
-
for(; !0 === changed;)changed = !1, /^@\([^\\()[\]{}|]+\)$/.test(value) && (value = value.slice(2, -1), changed = !0);
|
|
200
|
-
if (((branch)=>{
|
|
201
|
-
let escaped = !1;
|
|
202
|
-
for (let ch of branch){
|
|
203
|
-
if (!0 === escaped) {
|
|
204
|
-
escaped = !1;
|
|
205
|
-
continue;
|
|
206
|
-
}
|
|
207
|
-
if ('\\' === ch) {
|
|
208
|
-
escaped = !0;
|
|
209
|
-
continue;
|
|
210
|
-
}
|
|
211
|
-
if (/[?*+@!()[\]{}]/.test(ch)) return !1;
|
|
212
|
-
}
|
|
213
|
-
return !0;
|
|
214
|
-
})(value)) return value.replace(/\\(.)/g, '$1');
|
|
215
|
-
}, parseRepeatedExtglob = (pattern, requireEnd = !0)=>{
|
|
216
|
-
if ('+' !== pattern[0] && '*' !== pattern[0] || '(' !== pattern[1]) return;
|
|
217
|
-
let bracket = 0, paren = 0, quote = 0, escaped = !1;
|
|
218
|
-
for(let i = 1; i < pattern.length; i++){
|
|
219
|
-
let ch = pattern[i];
|
|
220
|
-
if (!0 === escaped) {
|
|
221
|
-
escaped = !1;
|
|
222
|
-
continue;
|
|
223
|
-
}
|
|
224
|
-
if ('\\' === ch) {
|
|
225
|
-
escaped = !0;
|
|
226
|
-
continue;
|
|
227
|
-
}
|
|
228
|
-
if ('"' === ch) {
|
|
229
|
-
quote = +(1 !== quote);
|
|
230
|
-
continue;
|
|
231
|
-
}
|
|
232
|
-
if (1 !== quote) {
|
|
233
|
-
if ('[' === ch) {
|
|
234
|
-
bracket++;
|
|
235
|
-
continue;
|
|
236
|
-
}
|
|
237
|
-
if (']' === ch && bracket > 0) {
|
|
238
|
-
bracket--;
|
|
239
|
-
continue;
|
|
240
|
-
}
|
|
241
|
-
if (!(bracket > 0)) {
|
|
242
|
-
if ('(' === ch) {
|
|
243
|
-
paren++;
|
|
244
|
-
continue;
|
|
245
|
-
}
|
|
246
|
-
if (')' === ch && 0 == --paren) {
|
|
247
|
-
if (!0 === requireEnd && i !== pattern.length - 1) return;
|
|
248
|
-
return {
|
|
249
|
-
type: pattern[0],
|
|
250
|
-
body: pattern.slice(2, i),
|
|
251
|
-
end: i
|
|
252
|
-
};
|
|
253
|
-
}
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
|
-
}
|
|
257
|
-
}, getStarExtglobSequenceOutput = (pattern)=>{
|
|
258
|
-
let index = 0, chars = [];
|
|
259
|
-
for(; index < pattern.length;){
|
|
260
|
-
let match = parseRepeatedExtglob(pattern.slice(index), !1);
|
|
261
|
-
if (!match || '*' !== match.type) return;
|
|
262
|
-
let branches = splitTopLevel(match.body).map((branch)=>branch.trim());
|
|
263
|
-
if (1 !== branches.length) return;
|
|
264
|
-
let branch = normalizeSimpleBranch(branches[0]);
|
|
265
|
-
if (!branch || 1 !== branch.length) return;
|
|
266
|
-
chars.push(branch), index += match.end + 1;
|
|
267
|
-
}
|
|
268
|
-
if (chars.length < 1) return;
|
|
269
|
-
let source = 1 === chars.length ? utils.escapeRegex(chars[0]) : `[${chars.map((ch)=>utils.escapeRegex(ch)).join('')}]`;
|
|
270
|
-
return `${source}*`;
|
|
271
|
-
}, repeatedExtglobRecursion = (pattern)=>{
|
|
272
|
-
let depth = 0, value = pattern.trim(), match = parseRepeatedExtglob(value);
|
|
273
|
-
for(; match;)depth++, match = parseRepeatedExtglob(value = match.body.trim());
|
|
274
|
-
return depth;
|
|
275
|
-
}, parse = (input, options)=>{
|
|
276
|
-
let value;
|
|
277
|
-
if ('string' != typeof input) throw TypeError('Expected a string');
|
|
278
|
-
input = REPLACEMENTS[input] || input;
|
|
279
|
-
let opts = {
|
|
280
|
-
...options
|
|
281
|
-
}, max = 'number' == typeof opts.maxLength ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH, len = input.length;
|
|
282
|
-
if (len > max) throw SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
|
|
283
|
-
let bos = {
|
|
284
|
-
type: 'bos',
|
|
285
|
-
value: '',
|
|
286
|
-
output: opts.prepend || ''
|
|
287
|
-
}, tokens = [
|
|
288
|
-
bos
|
|
289
|
-
], capture = opts.capture ? '' : '?:', PLATFORM_CHARS = constants.globChars(opts.windows), EXTGLOB_CHARS = constants.extglobChars(PLATFORM_CHARS), { 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, globstar = (opts)=>`(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`, nodot = opts.dot ? '' : NO_DOT, qmarkNoDot = opts.dot ? QMARK : QMARK_NO_DOT, star = !0 === opts.bash ? globstar(opts) : STAR;
|
|
290
|
-
opts.capture && (star = `(${star})`), 'boolean' == typeof opts.noext && (opts.noextglob = opts.noext);
|
|
291
|
-
let state = {
|
|
292
|
-
input,
|
|
293
|
-
index: -1,
|
|
294
|
-
start: 0,
|
|
295
|
-
dot: !0 === opts.dot,
|
|
296
|
-
consumed: '',
|
|
297
|
-
output: '',
|
|
298
|
-
prefix: '',
|
|
299
|
-
backtrack: !1,
|
|
300
|
-
negated: !1,
|
|
301
|
-
brackets: 0,
|
|
302
|
-
braces: 0,
|
|
303
|
-
parens: 0,
|
|
304
|
-
quotes: 0,
|
|
305
|
-
globstar: !1,
|
|
306
|
-
tokens
|
|
307
|
-
};
|
|
308
|
-
len = (input = utils.removePrefix(input, state)).length;
|
|
309
|
-
let extglobs = [], braces = [], stack = [], prev = bos, eos = ()=>state.index === len - 1, peek = state.peek = (n = 1)=>input[state.index + n], advance = state.advance = ()=>input[++state.index] || '', remaining = ()=>input.slice(state.index + 1), consume = (value = '', num = 0)=>{
|
|
310
|
-
state.consumed += value, state.index += num;
|
|
311
|
-
}, append = (token)=>{
|
|
312
|
-
state.output += null != token.output ? token.output : token.value, consume(token.value);
|
|
313
|
-
}, negate = ()=>{
|
|
314
|
-
let count = 1;
|
|
315
|
-
for(; '!' === peek() && ('(' !== peek(2) || '?' === peek(3));)advance(), state.start++, count++;
|
|
316
|
-
return count % 2 != 0 && (state.negated = !0, state.start++, !0);
|
|
317
|
-
}, increment = (type)=>{
|
|
318
|
-
state[type]++, stack.push(type);
|
|
319
|
-
}, decrement = (type)=>{
|
|
320
|
-
state[type]--, stack.pop();
|
|
321
|
-
}, push = (tok)=>{
|
|
322
|
-
if ('globstar' === prev.type) {
|
|
323
|
-
let isBrace = state.braces > 0 && ('comma' === tok.type || 'brace' === tok.type), isExtglob = !0 === tok.extglob || extglobs.length && ('pipe' === tok.type || 'paren' === tok.type);
|
|
324
|
-
'slash' === tok.type || 'paren' === tok.type || isBrace || isExtglob || (state.output = state.output.slice(0, -prev.output.length), prev.type = 'star', prev.value = '*', prev.output = star, state.output += prev.output);
|
|
325
|
-
}
|
|
326
|
-
if (extglobs.length && 'paren' !== tok.type && (extglobs[extglobs.length - 1].inner += tok.value), (tok.value || tok.output) && append(tok), prev && 'text' === prev.type && 'text' === tok.type) {
|
|
327
|
-
prev.output = (prev.output || prev.value) + tok.value, prev.value += tok.value;
|
|
328
|
-
return;
|
|
329
|
-
}
|
|
330
|
-
tok.prev = prev, tokens.push(tok), prev = tok;
|
|
331
|
-
}, extglobOpen = (type, value)=>{
|
|
332
|
-
let token = {
|
|
333
|
-
...EXTGLOB_CHARS[value],
|
|
334
|
-
conditions: 1,
|
|
335
|
-
inner: ''
|
|
336
|
-
};
|
|
337
|
-
token.prev = prev, token.parens = state.parens, token.output = state.output, token.startIndex = state.index, token.tokensIndex = tokens.length;
|
|
338
|
-
let output = (opts.capture ? '(' : '') + token.open;
|
|
339
|
-
increment('parens'), push({
|
|
340
|
-
type,
|
|
341
|
-
value,
|
|
342
|
-
output: state.output ? '' : ONE_CHAR
|
|
343
|
-
}), push({
|
|
344
|
-
type: 'paren',
|
|
345
|
-
extglob: !0,
|
|
346
|
-
value: advance(),
|
|
347
|
-
output
|
|
348
|
-
}), extglobs.push(token);
|
|
349
|
-
}, extglobClose = (token)=>{
|
|
350
|
-
let rest, literal = input.slice(token.startIndex, state.index + 1), analysis = ((body, options)=>{
|
|
351
|
-
if (!1 === options.maxExtglobRecursion) return {
|
|
352
|
-
risky: !1
|
|
353
|
-
};
|
|
354
|
-
let max = 'number' == typeof options.maxExtglobRecursion ? options.maxExtglobRecursion : constants.DEFAULT_MAX_EXTGLOB_RECURSION, branches = splitTopLevel(body).map((branch)=>branch.trim());
|
|
355
|
-
if (branches.length > 1 && (branches.some((branch)=>'' === branch) || branches.some((branch)=>/^[*?]+$/.test(branch)) || ((branches)=>{
|
|
356
|
-
let values = branches.map(normalizeSimpleBranch).filter(Boolean);
|
|
357
|
-
for(let i = 0; i < values.length; i++)for(let j = i + 1; j < values.length; j++){
|
|
358
|
-
let a = values[i], b = values[j], char = a[0];
|
|
359
|
-
if (char && a === char.repeat(a.length) && b === char.repeat(b.length) && (a === b || a.startsWith(b) || b.startsWith(a))) return !0;
|
|
360
|
-
}
|
|
361
|
-
return !1;
|
|
362
|
-
})(branches))) return {
|
|
363
|
-
risky: !0
|
|
364
|
-
};
|
|
365
|
-
for (let branch of branches){
|
|
366
|
-
let safeOutput = getStarExtglobSequenceOutput(branch);
|
|
367
|
-
if (safeOutput) return {
|
|
368
|
-
risky: !0,
|
|
369
|
-
safeOutput
|
|
370
|
-
};
|
|
371
|
-
if (repeatedExtglobRecursion(branch) > max) return {
|
|
372
|
-
risky: !0
|
|
373
|
-
};
|
|
374
|
-
}
|
|
375
|
-
return {
|
|
376
|
-
risky: !1
|
|
377
|
-
};
|
|
378
|
-
})(input.slice(token.startIndex + 2, state.index), opts);
|
|
379
|
-
if (('plus' === token.type || 'star' === token.type) && analysis.risky) {
|
|
380
|
-
let safeOutput = analysis.safeOutput ? (token.output ? '' : ONE_CHAR) + (opts.capture ? `(${analysis.safeOutput})` : analysis.safeOutput) : void 0, open = tokens[token.tokensIndex];
|
|
381
|
-
open.type = 'text', open.value = literal, open.output = safeOutput || utils.escapeRegex(literal);
|
|
382
|
-
for(let i = token.tokensIndex + 1; i < tokens.length; i++)tokens[i].value = '', tokens[i].output = '', delete tokens[i].suffix;
|
|
383
|
-
state.output = token.output + open.output, state.backtrack = !0, push({
|
|
384
|
-
type: 'paren',
|
|
385
|
-
extglob: !0,
|
|
386
|
-
value,
|
|
387
|
-
output: ''
|
|
388
|
-
}), decrement('parens');
|
|
389
|
-
return;
|
|
390
|
-
}
|
|
391
|
-
let output = token.close + (opts.capture ? ')' : '');
|
|
392
|
-
if ('negate' === token.type) {
|
|
393
|
-
let extglobStar = star;
|
|
394
|
-
if (token.inner && token.inner.length > 1 && token.inner.includes('/') && (extglobStar = globstar(opts)), (extglobStar !== star || eos() || /^\)+$/.test(remaining())) && (output = token.close = `)$))${extglobStar}`), token.inner.includes('*') && (rest = remaining()) && /^\.[^\\/.]+$/.test(rest)) {
|
|
395
|
-
let expression = parse(rest, {
|
|
396
|
-
...options,
|
|
397
|
-
fastpaths: !1
|
|
398
|
-
}).output;
|
|
399
|
-
output = token.close = `)${expression})${extglobStar})`;
|
|
400
|
-
}
|
|
401
|
-
'bos' === token.prev.type && (state.negatedExtglob = !0);
|
|
402
|
-
}
|
|
403
|
-
push({
|
|
404
|
-
type: 'paren',
|
|
405
|
-
extglob: !0,
|
|
406
|
-
value,
|
|
407
|
-
output
|
|
408
|
-
}), decrement('parens');
|
|
409
|
-
};
|
|
410
|
-
if (!1 !== opts.fastpaths && !/(^[*!]|[/()[\]{}"])/.test(input)) {
|
|
411
|
-
let backslashes = !1, output = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (m, esc, chars, first, rest, index)=>'\\' === first ? (backslashes = !0, m) : '?' === first ? esc ? esc + first + (rest ? QMARK.repeat(rest.length) : '') : 0 === index ? qmarkNoDot + (rest ? QMARK.repeat(rest.length) : '') : QMARK.repeat(chars.length) : '.' === first ? DOT_LITERAL.repeat(chars.length) : '*' === first ? esc ? esc + first + (rest ? star : '') : star : esc ? m : `\\${m}`);
|
|
412
|
-
return (!0 === backslashes && (output = !0 === opts.unescape ? output.replace(/\\/g, '') : output.replace(/\\+/g, (m)=>m.length % 2 == 0 ? '\\\\' : m ? '\\' : '')), output === input && !0 === opts.contains) ? state.output = input : state.output = utils.wrapOutput(output, state, options), state;
|
|
413
|
-
}
|
|
414
|
-
for(; !eos();){
|
|
415
|
-
if ('\u0000' === (value = advance())) continue;
|
|
416
|
-
if ('\\' === value) {
|
|
417
|
-
let next = peek();
|
|
418
|
-
if ('/' === next && !0 !== opts.bash || '.' === next || ';' === next) continue;
|
|
419
|
-
if (!next) {
|
|
420
|
-
push({
|
|
421
|
-
type: 'text',
|
|
422
|
-
value: value += '\\'
|
|
423
|
-
});
|
|
424
|
-
continue;
|
|
425
|
-
}
|
|
426
|
-
let match = /^\\+/.exec(remaining()), slashes = 0;
|
|
427
|
-
if (match && match[0].length > 2 && (slashes = match[0].length, state.index += slashes, slashes % 2 != 0 && (value += '\\')), !0 === opts.unescape ? value = advance() : value += advance(), 0 === state.brackets) {
|
|
428
|
-
push({
|
|
429
|
-
type: 'text',
|
|
430
|
-
value
|
|
431
|
-
});
|
|
432
|
-
continue;
|
|
433
|
-
}
|
|
434
|
-
}
|
|
435
|
-
if (state.brackets > 0 && (']' !== value || '[' === prev.value || '[^' === prev.value)) {
|
|
436
|
-
if (!1 !== opts.posix && ':' === value) {
|
|
437
|
-
let inner = prev.value.slice(1);
|
|
438
|
-
if (inner.includes('[') && (prev.posix = !0, inner.includes(':'))) {
|
|
439
|
-
let idx = prev.value.lastIndexOf('['), pre = prev.value.slice(0, idx), posix = POSIX_REGEX_SOURCE[prev.value.slice(idx + 2)];
|
|
440
|
-
if (posix) {
|
|
441
|
-
prev.value = pre + posix, state.backtrack = !0, advance(), bos.output || 1 !== tokens.indexOf(prev) || (bos.output = ONE_CHAR);
|
|
442
|
-
continue;
|
|
443
|
-
}
|
|
444
|
-
}
|
|
445
|
-
}
|
|
446
|
-
('[' === value && ':' !== peek() || '-' === value && ']' === peek()) && (value = `\\${value}`), ']' === value && ('[' === prev.value || '[^' === prev.value) && (value = `\\${value}`), !0 === opts.posix && '!' === value && '[' === prev.value && (value = '^'), prev.value += value, append({
|
|
447
|
-
value
|
|
448
|
-
});
|
|
449
|
-
continue;
|
|
450
|
-
}
|
|
451
|
-
if (1 === state.quotes && '"' !== value) {
|
|
452
|
-
value = utils.escapeRegex(value), prev.value += value, append({
|
|
453
|
-
value
|
|
454
|
-
});
|
|
455
|
-
continue;
|
|
456
|
-
}
|
|
457
|
-
if ('"' === value) {
|
|
458
|
-
state.quotes = +(1 !== state.quotes), !0 === opts.keepQuotes && push({
|
|
459
|
-
type: 'text',
|
|
460
|
-
value
|
|
461
|
-
});
|
|
462
|
-
continue;
|
|
463
|
-
}
|
|
464
|
-
if ('(' === value) {
|
|
465
|
-
increment('parens'), push({
|
|
466
|
-
type: 'paren',
|
|
467
|
-
value
|
|
468
|
-
});
|
|
469
|
-
continue;
|
|
470
|
-
}
|
|
471
|
-
if (')' === value) {
|
|
472
|
-
if (0 === state.parens && !0 === opts.strictBrackets) throw SyntaxError(syntaxError('opening', '('));
|
|
473
|
-
let extglob = extglobs[extglobs.length - 1];
|
|
474
|
-
if (extglob && state.parens === extglob.parens + 1) {
|
|
475
|
-
extglobClose(extglobs.pop());
|
|
476
|
-
continue;
|
|
477
|
-
}
|
|
478
|
-
push({
|
|
479
|
-
type: 'paren',
|
|
480
|
-
value,
|
|
481
|
-
output: state.parens ? ')' : '\\)'
|
|
482
|
-
}), decrement('parens');
|
|
483
|
-
continue;
|
|
484
|
-
}
|
|
485
|
-
if ('[' === value) {
|
|
486
|
-
if (!0 !== opts.nobracket && remaining().includes(']')) increment('brackets');
|
|
487
|
-
else {
|
|
488
|
-
if (!0 !== opts.nobracket && !0 === opts.strictBrackets) throw SyntaxError(syntaxError('closing', ']'));
|
|
489
|
-
value = `\\${value}`;
|
|
490
|
-
}
|
|
491
|
-
push({
|
|
492
|
-
type: 'bracket',
|
|
493
|
-
value
|
|
494
|
-
});
|
|
495
|
-
continue;
|
|
496
|
-
}
|
|
497
|
-
if (']' === value) {
|
|
498
|
-
if (!0 === opts.nobracket || prev && 'bracket' === prev.type && 1 === prev.value.length) {
|
|
499
|
-
push({
|
|
500
|
-
type: 'text',
|
|
501
|
-
value,
|
|
502
|
-
output: `\\${value}`
|
|
503
|
-
});
|
|
504
|
-
continue;
|
|
505
|
-
}
|
|
506
|
-
if (0 === state.brackets) {
|
|
507
|
-
if (!0 === opts.strictBrackets) throw SyntaxError(syntaxError('opening', '['));
|
|
508
|
-
push({
|
|
509
|
-
type: 'text',
|
|
510
|
-
value,
|
|
511
|
-
output: `\\${value}`
|
|
512
|
-
});
|
|
513
|
-
continue;
|
|
514
|
-
}
|
|
515
|
-
decrement('brackets');
|
|
516
|
-
let prevValue = prev.value.slice(1);
|
|
517
|
-
if (!0 === prev.posix || '^' !== prevValue[0] || prevValue.includes('/') || (value = `/${value}`), prev.value += value, append({
|
|
518
|
-
value
|
|
519
|
-
}), !1 === opts.literalBrackets || utils.hasRegexChars(prevValue)) continue;
|
|
520
|
-
let escaped = utils.escapeRegex(prev.value);
|
|
521
|
-
if (state.output = state.output.slice(0, -prev.value.length), !0 === opts.literalBrackets) {
|
|
522
|
-
state.output += escaped, prev.value = escaped;
|
|
523
|
-
continue;
|
|
524
|
-
}
|
|
525
|
-
prev.value = `(${capture}${escaped}|${prev.value})`, state.output += prev.value;
|
|
526
|
-
continue;
|
|
527
|
-
}
|
|
528
|
-
if ('{' === value && !0 !== opts.nobrace) {
|
|
529
|
-
increment('braces');
|
|
530
|
-
let open = {
|
|
531
|
-
type: 'brace',
|
|
532
|
-
value,
|
|
533
|
-
output: '(',
|
|
534
|
-
outputIndex: state.output.length,
|
|
535
|
-
tokensIndex: state.tokens.length
|
|
536
|
-
};
|
|
537
|
-
braces.push(open), push(open);
|
|
538
|
-
continue;
|
|
539
|
-
}
|
|
540
|
-
if ('}' === value) {
|
|
541
|
-
let brace = braces[braces.length - 1];
|
|
542
|
-
if (!0 === opts.nobrace || !brace) {
|
|
543
|
-
push({
|
|
544
|
-
type: 'text',
|
|
545
|
-
value,
|
|
546
|
-
output: value
|
|
547
|
-
});
|
|
548
|
-
continue;
|
|
549
|
-
}
|
|
550
|
-
let output = ')';
|
|
551
|
-
if (!0 === brace.dots) {
|
|
552
|
-
let arr = tokens.slice(), range = [];
|
|
553
|
-
for(let i = arr.length - 1; i >= 0 && (tokens.pop(), 'brace' !== arr[i].type); i--)'dots' !== arr[i].type && range.unshift(arr[i].value);
|
|
554
|
-
output = expandRange(range, opts), state.backtrack = !0;
|
|
555
|
-
}
|
|
556
|
-
if (!0 !== brace.comma && !0 !== brace.dots) {
|
|
557
|
-
let out = state.output.slice(0, brace.outputIndex), toks = state.tokens.slice(brace.tokensIndex);
|
|
558
|
-
for (let t of (brace.value = brace.output = '\\{', value = output = '\\}', state.output = out, toks))state.output += t.output || t.value;
|
|
559
|
-
}
|
|
560
|
-
push({
|
|
561
|
-
type: 'brace',
|
|
562
|
-
value,
|
|
563
|
-
output
|
|
564
|
-
}), decrement('braces'), braces.pop();
|
|
565
|
-
continue;
|
|
566
|
-
}
|
|
567
|
-
if ('|' === value) {
|
|
568
|
-
extglobs.length > 0 && extglobs[extglobs.length - 1].conditions++, push({
|
|
569
|
-
type: 'text',
|
|
570
|
-
value
|
|
571
|
-
});
|
|
572
|
-
continue;
|
|
573
|
-
}
|
|
574
|
-
if (',' === value) {
|
|
575
|
-
let output = value, brace = braces[braces.length - 1];
|
|
576
|
-
brace && 'braces' === stack[stack.length - 1] && (brace.comma = !0, output = '|'), push({
|
|
577
|
-
type: 'comma',
|
|
578
|
-
value,
|
|
579
|
-
output
|
|
580
|
-
});
|
|
581
|
-
continue;
|
|
582
|
-
}
|
|
583
|
-
if ('/' === value) {
|
|
584
|
-
if ('dot' === prev.type && state.index === state.start + 1) {
|
|
585
|
-
state.start = state.index + 1, state.consumed = '', state.output = '', tokens.pop(), prev = bos;
|
|
586
|
-
continue;
|
|
587
|
-
}
|
|
588
|
-
push({
|
|
589
|
-
type: 'slash',
|
|
590
|
-
value,
|
|
591
|
-
output: SLASH_LITERAL
|
|
592
|
-
});
|
|
593
|
-
continue;
|
|
594
|
-
}
|
|
595
|
-
if ('.' === value) {
|
|
596
|
-
if (state.braces > 0 && 'dot' === prev.type) {
|
|
597
|
-
'.' === prev.value && (prev.output = DOT_LITERAL);
|
|
598
|
-
let brace = braces[braces.length - 1];
|
|
599
|
-
prev.type = 'dots', prev.output += value, prev.value += value, brace.dots = !0;
|
|
600
|
-
continue;
|
|
601
|
-
}
|
|
602
|
-
if (state.braces + state.parens === 0 && 'bos' !== prev.type && 'slash' !== prev.type) {
|
|
603
|
-
push({
|
|
604
|
-
type: 'text',
|
|
605
|
-
value,
|
|
606
|
-
output: DOT_LITERAL
|
|
607
|
-
});
|
|
608
|
-
continue;
|
|
609
|
-
}
|
|
610
|
-
push({
|
|
611
|
-
type: 'dot',
|
|
612
|
-
value,
|
|
613
|
-
output: DOT_LITERAL
|
|
614
|
-
});
|
|
615
|
-
continue;
|
|
616
|
-
}
|
|
617
|
-
if ('?' === value) {
|
|
618
|
-
if (!(prev && '(' === prev.value) && !0 !== opts.noextglob && '(' === peek() && '?' !== peek(2)) {
|
|
619
|
-
extglobOpen('qmark', value);
|
|
620
|
-
continue;
|
|
621
|
-
}
|
|
622
|
-
if (prev && 'paren' === prev.type) {
|
|
623
|
-
let next = peek(), output = value;
|
|
624
|
-
('(' !== prev.value || /[!=<:]/.test(next)) && ('<' !== next || /<([!=]|\w+>)/.test(remaining())) || (output = `\\${value}`), push({
|
|
625
|
-
type: 'text',
|
|
626
|
-
value,
|
|
627
|
-
output
|
|
628
|
-
});
|
|
629
|
-
continue;
|
|
630
|
-
}
|
|
631
|
-
if (!0 !== opts.dot && ('slash' === prev.type || 'bos' === prev.type)) {
|
|
632
|
-
push({
|
|
633
|
-
type: 'qmark',
|
|
634
|
-
value,
|
|
635
|
-
output: QMARK_NO_DOT
|
|
636
|
-
});
|
|
637
|
-
continue;
|
|
638
|
-
}
|
|
639
|
-
push({
|
|
640
|
-
type: 'qmark',
|
|
641
|
-
value,
|
|
642
|
-
output: QMARK
|
|
643
|
-
});
|
|
644
|
-
continue;
|
|
645
|
-
}
|
|
646
|
-
if ('!' === value) {
|
|
647
|
-
if (!0 !== opts.noextglob && '(' === peek() && ('?' !== peek(2) || !/[!=<:]/.test(peek(3)))) {
|
|
648
|
-
extglobOpen('negate', value);
|
|
649
|
-
continue;
|
|
650
|
-
}
|
|
651
|
-
if (!0 !== opts.nonegate && 0 === state.index) {
|
|
652
|
-
negate();
|
|
653
|
-
continue;
|
|
654
|
-
}
|
|
655
|
-
}
|
|
656
|
-
if ('+' === value) {
|
|
657
|
-
if (!0 !== opts.noextglob && '(' === peek() && '?' !== peek(2)) {
|
|
658
|
-
extglobOpen('plus', value);
|
|
659
|
-
continue;
|
|
660
|
-
}
|
|
661
|
-
if (prev && '(' === prev.value || !1 === opts.regex) {
|
|
662
|
-
push({
|
|
663
|
-
type: 'plus',
|
|
664
|
-
value,
|
|
665
|
-
output: PLUS_LITERAL
|
|
666
|
-
});
|
|
667
|
-
continue;
|
|
668
|
-
}
|
|
669
|
-
if (prev && ('bracket' === prev.type || 'paren' === prev.type || 'brace' === prev.type) || state.parens > 0) {
|
|
670
|
-
push({
|
|
671
|
-
type: 'plus',
|
|
672
|
-
value
|
|
673
|
-
});
|
|
674
|
-
continue;
|
|
675
|
-
}
|
|
676
|
-
push({
|
|
677
|
-
type: 'plus',
|
|
678
|
-
value: PLUS_LITERAL
|
|
679
|
-
});
|
|
680
|
-
continue;
|
|
681
|
-
}
|
|
682
|
-
if ('@' === value) {
|
|
683
|
-
if (!0 !== opts.noextglob && '(' === peek() && '?' !== peek(2)) {
|
|
684
|
-
push({
|
|
685
|
-
type: 'at',
|
|
686
|
-
extglob: !0,
|
|
687
|
-
value,
|
|
688
|
-
output: ''
|
|
689
|
-
});
|
|
690
|
-
continue;
|
|
691
|
-
}
|
|
692
|
-
push({
|
|
693
|
-
type: 'text',
|
|
694
|
-
value
|
|
695
|
-
});
|
|
696
|
-
continue;
|
|
697
|
-
}
|
|
698
|
-
if ('*' !== value) {
|
|
699
|
-
('$' === value || '^' === value) && (value = `\\${value}`);
|
|
700
|
-
let match = REGEX_NON_SPECIAL_CHARS.exec(remaining());
|
|
701
|
-
match && (value += match[0], state.index += match[0].length), push({
|
|
702
|
-
type: 'text',
|
|
703
|
-
value
|
|
704
|
-
});
|
|
705
|
-
continue;
|
|
706
|
-
}
|
|
707
|
-
if (prev && ('globstar' === prev.type || !0 === prev.star)) {
|
|
708
|
-
prev.type = 'star', prev.star = !0, prev.value += value, prev.output = star, state.backtrack = !0, state.globstar = !0, consume(value);
|
|
709
|
-
continue;
|
|
710
|
-
}
|
|
711
|
-
let rest = remaining();
|
|
712
|
-
if (!0 !== opts.noextglob && /^\([^?]/.test(rest)) {
|
|
713
|
-
extglobOpen('star', value);
|
|
714
|
-
continue;
|
|
715
|
-
}
|
|
716
|
-
if ('star' === prev.type) {
|
|
717
|
-
if (!0 === opts.noglobstar) {
|
|
718
|
-
consume(value);
|
|
719
|
-
continue;
|
|
720
|
-
}
|
|
721
|
-
let prior = prev.prev, before = prior.prev, isStart = 'slash' === prior.type || 'bos' === prior.type, afterStar = before && ('star' === before.type || 'globstar' === before.type);
|
|
722
|
-
if (!0 === opts.bash && (!isStart || rest[0] && '/' !== rest[0])) {
|
|
723
|
-
push({
|
|
724
|
-
type: 'star',
|
|
725
|
-
value,
|
|
726
|
-
output: ''
|
|
727
|
-
});
|
|
728
|
-
continue;
|
|
729
|
-
}
|
|
730
|
-
let isBrace = state.braces > 0 && ('comma' === prior.type || 'brace' === prior.type), isExtglob = extglobs.length && ('pipe' === prior.type || 'paren' === prior.type);
|
|
731
|
-
if (!isStart && 'paren' !== prior.type && !isBrace && !isExtglob) {
|
|
732
|
-
push({
|
|
733
|
-
type: 'star',
|
|
734
|
-
value,
|
|
735
|
-
output: ''
|
|
736
|
-
});
|
|
737
|
-
continue;
|
|
738
|
-
}
|
|
739
|
-
for(; '/**' === rest.slice(0, 3);){
|
|
740
|
-
let after = input[state.index + 4];
|
|
741
|
-
if (after && '/' !== after) break;
|
|
742
|
-
rest = rest.slice(3), consume('/**', 3);
|
|
743
|
-
}
|
|
744
|
-
if ('bos' === prior.type && eos()) {
|
|
745
|
-
prev.type = 'globstar', prev.value += value, prev.output = globstar(opts), state.output = prev.output, state.globstar = !0, consume(value);
|
|
746
|
-
continue;
|
|
747
|
-
}
|
|
748
|
-
if ('slash' === prior.type && 'bos' !== prior.prev.type && !afterStar && eos()) {
|
|
749
|
-
state.output = state.output.slice(0, -(prior.output + prev.output).length), prior.output = `(?:${prior.output}`, prev.type = 'globstar', prev.output = globstar(opts) + (opts.strictSlashes ? ')' : '|$)'), prev.value += value, state.globstar = !0, state.output += prior.output + prev.output, consume(value);
|
|
750
|
-
continue;
|
|
751
|
-
}
|
|
752
|
-
if ('slash' === prior.type && 'bos' !== prior.prev.type && '/' === rest[0]) {
|
|
753
|
-
let end = void 0 !== rest[1] ? '|$' : '';
|
|
754
|
-
state.output = state.output.slice(0, -(prior.output + prev.output).length), prior.output = `(?:${prior.output}`, prev.type = 'globstar', prev.output = `${globstar(opts)}${SLASH_LITERAL}|${SLASH_LITERAL}${end})`, prev.value += value, state.output += prior.output + prev.output, state.globstar = !0, consume(value + advance()), push({
|
|
755
|
-
type: 'slash',
|
|
756
|
-
value: '/',
|
|
757
|
-
output: ''
|
|
758
|
-
});
|
|
759
|
-
continue;
|
|
760
|
-
}
|
|
761
|
-
if ('bos' === prior.type && '/' === rest[0]) {
|
|
762
|
-
prev.type = 'globstar', prev.value += value, prev.output = `(?:^|${SLASH_LITERAL}|${globstar(opts)}${SLASH_LITERAL})`, state.output = prev.output, state.globstar = !0, consume(value + advance()), push({
|
|
763
|
-
type: 'slash',
|
|
764
|
-
value: '/',
|
|
765
|
-
output: ''
|
|
766
|
-
});
|
|
767
|
-
continue;
|
|
768
|
-
}
|
|
769
|
-
state.output = state.output.slice(0, -prev.output.length), prev.type = 'globstar', prev.output = globstar(opts), prev.value += value, state.output += prev.output, state.globstar = !0, consume(value);
|
|
770
|
-
continue;
|
|
771
|
-
}
|
|
772
|
-
let token = {
|
|
773
|
-
type: 'star',
|
|
774
|
-
value,
|
|
775
|
-
output: star
|
|
776
|
-
};
|
|
777
|
-
if (!0 === opts.bash) {
|
|
778
|
-
token.output = '.*?', ('bos' === prev.type || 'slash' === prev.type) && (token.output = nodot + token.output), push(token);
|
|
779
|
-
continue;
|
|
780
|
-
}
|
|
781
|
-
if (prev && ('bracket' === prev.type || 'paren' === prev.type) && !0 === opts.regex) {
|
|
782
|
-
token.output = value, push(token);
|
|
783
|
-
continue;
|
|
784
|
-
}
|
|
785
|
-
(state.index === state.start || 'slash' === prev.type || 'dot' === prev.type) && ('dot' === prev.type ? (state.output += NO_DOT_SLASH, prev.output += NO_DOT_SLASH) : !0 === opts.dot ? (state.output += NO_DOTS_SLASH, prev.output += NO_DOTS_SLASH) : (state.output += nodot, prev.output += nodot), '*' !== peek() && (state.output += ONE_CHAR, prev.output += ONE_CHAR)), push(token);
|
|
786
|
-
}
|
|
787
|
-
for(; state.brackets > 0;){
|
|
788
|
-
if (!0 === opts.strictBrackets) throw SyntaxError(syntaxError('closing', ']'));
|
|
789
|
-
state.output = utils.escapeLast(state.output, '['), decrement('brackets');
|
|
790
|
-
}
|
|
791
|
-
for(; state.parens > 0;){
|
|
792
|
-
if (!0 === opts.strictBrackets) throw SyntaxError(syntaxError('closing', ')'));
|
|
793
|
-
state.output = utils.escapeLast(state.output, '('), decrement('parens');
|
|
794
|
-
}
|
|
795
|
-
for(; state.braces > 0;){
|
|
796
|
-
if (!0 === opts.strictBrackets) throw SyntaxError(syntaxError('closing', '}'));
|
|
797
|
-
state.output = utils.escapeLast(state.output, '{'), decrement('braces');
|
|
798
|
-
}
|
|
799
|
-
if (!0 !== opts.strictSlashes && ('star' === prev.type || 'bracket' === prev.type) && push({
|
|
800
|
-
type: 'maybe_slash',
|
|
801
|
-
value: '',
|
|
802
|
-
output: `${SLASH_LITERAL}?`
|
|
803
|
-
}), !0 === state.backtrack) for (let token of (state.output = '', state.tokens))state.output += null != token.output ? token.output : token.value, token.suffix && (state.output += token.suffix);
|
|
804
|
-
return state;
|
|
805
|
-
};
|
|
806
|
-
parse.fastpaths = (input, options)=>{
|
|
807
|
-
let opts = {
|
|
808
|
-
...options
|
|
809
|
-
}, max = 'number' == typeof opts.maxLength ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH, len = input.length;
|
|
810
|
-
if (len > max) throw SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
|
|
811
|
-
input = REPLACEMENTS[input] || input;
|
|
812
|
-
let { DOT_LITERAL, SLASH_LITERAL, ONE_CHAR, DOTS_SLASH, NO_DOT, NO_DOTS, NO_DOTS_SLASH, STAR, START_ANCHOR } = constants.globChars(opts.windows), nodot = opts.dot ? NO_DOTS : NO_DOT, slashDot = opts.dot ? NO_DOTS_SLASH : NO_DOT, capture = opts.capture ? '' : '?:', star = !0 === opts.bash ? '.*?' : STAR;
|
|
813
|
-
opts.capture && (star = `(${star})`);
|
|
814
|
-
let globstar = (opts)=>!0 === opts.noglobstar ? star : `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`, create = (str)=>{
|
|
815
|
-
switch(str){
|
|
816
|
-
case '*':
|
|
817
|
-
return `${nodot}${ONE_CHAR}${star}`;
|
|
818
|
-
case '.*':
|
|
819
|
-
return `${DOT_LITERAL}${ONE_CHAR}${star}`;
|
|
820
|
-
case '*.*':
|
|
821
|
-
return `${nodot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;
|
|
822
|
-
case '*/*':
|
|
823
|
-
return `${nodot}${star}${SLASH_LITERAL}${ONE_CHAR}${slashDot}${star}`;
|
|
824
|
-
case '**':
|
|
825
|
-
return nodot + globstar(opts);
|
|
826
|
-
case '**/*':
|
|
827
|
-
return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${ONE_CHAR}${star}`;
|
|
828
|
-
case '**/*.*':
|
|
829
|
-
return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;
|
|
830
|
-
case '**/.*':
|
|
831
|
-
return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${DOT_LITERAL}${ONE_CHAR}${star}`;
|
|
832
|
-
default:
|
|
833
|
-
{
|
|
834
|
-
let match = /^(.*?)\.(\w+)$/.exec(str);
|
|
835
|
-
if (!match) return;
|
|
836
|
-
let source = create(match[1]);
|
|
837
|
-
if (!source) return;
|
|
838
|
-
return source + DOT_LITERAL + match[2];
|
|
839
|
-
}
|
|
840
|
-
}
|
|
841
|
-
}, source = create(utils.removePrefix(input, {
|
|
842
|
-
negated: !1,
|
|
843
|
-
prefix: ''
|
|
844
|
-
}));
|
|
845
|
-
return source && !0 !== opts.strictSlashes && (source += `${SLASH_LITERAL}?`), source;
|
|
846
|
-
}, module.exports = parse;
|
|
847
|
-
},
|
|
848
|
-
"../../node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/lib/picomatch.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
849
|
-
let scan = __webpack_require__("../../node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/lib/scan.js"), parse = __webpack_require__("../../node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/lib/parse.js"), utils = __webpack_require__("../../node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/lib/utils.js"), constants = __webpack_require__("../../node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/lib/constants.js"), picomatch = (glob, options, returnState = !1)=>{
|
|
850
|
-
if (Array.isArray(glob)) {
|
|
851
|
-
let fns = glob.map((input)=>picomatch(input, options, returnState));
|
|
852
|
-
return (str)=>{
|
|
853
|
-
for (let isMatch of fns){
|
|
854
|
-
let state = isMatch(str);
|
|
855
|
-
if (state) return state;
|
|
856
|
-
}
|
|
857
|
-
return !1;
|
|
858
|
-
};
|
|
859
|
-
}
|
|
860
|
-
let isState = glob && 'object' == typeof glob && !Array.isArray(glob) && glob.tokens && glob.input;
|
|
861
|
-
if ('' === glob || 'string' != typeof glob && !isState) throw TypeError('Expected pattern to be a non-empty string');
|
|
862
|
-
let opts = options || {}, posix = opts.windows, regex = isState ? picomatch.compileRe(glob, options) : picomatch.makeRe(glob, options, !1, !0), state = regex.state;
|
|
863
|
-
delete regex.state;
|
|
864
|
-
let isIgnored = ()=>!1;
|
|
865
|
-
if (opts.ignore) {
|
|
866
|
-
let ignoreOpts = {
|
|
867
|
-
...options,
|
|
868
|
-
ignore: null,
|
|
869
|
-
onMatch: null,
|
|
870
|
-
onResult: null
|
|
871
|
-
};
|
|
872
|
-
isIgnored = picomatch(opts.ignore, ignoreOpts, returnState);
|
|
873
|
-
}
|
|
874
|
-
let matcher = (input, returnObject = !1)=>{
|
|
875
|
-
let { isMatch, match, output } = picomatch.test(input, regex, options, {
|
|
876
|
-
glob,
|
|
877
|
-
posix
|
|
878
|
-
}), result = {
|
|
879
|
-
glob,
|
|
880
|
-
state,
|
|
881
|
-
regex,
|
|
882
|
-
posix,
|
|
883
|
-
input,
|
|
884
|
-
output,
|
|
885
|
-
match,
|
|
886
|
-
isMatch
|
|
887
|
-
};
|
|
888
|
-
return ('function' == typeof opts.onResult && opts.onResult(result), !1 === isMatch) ? (result.isMatch = !1, !!returnObject && result) : isIgnored(input) ? ('function' == typeof opts.onIgnore && opts.onIgnore(result), result.isMatch = !1, !!returnObject && result) : ('function' == typeof opts.onMatch && opts.onMatch(result), !returnObject || result);
|
|
889
|
-
};
|
|
890
|
-
return returnState && (matcher.state = state), matcher;
|
|
891
|
-
};
|
|
892
|
-
picomatch.test = (input, regex, options, { glob, posix } = {})=>{
|
|
893
|
-
if ('string' != typeof input) throw TypeError('Expected input to be a string');
|
|
894
|
-
if ('' === input) return {
|
|
895
|
-
isMatch: !1,
|
|
896
|
-
output: ''
|
|
897
|
-
};
|
|
898
|
-
let opts = options || {}, format = opts.format || (posix ? utils.toPosixSlashes : null), match = input === glob, output = match && format ? format(input) : input;
|
|
899
|
-
return !1 === match && (match = (output = format ? format(input) : input) === glob), (!1 === match || !0 === opts.capture) && (match = !0 === opts.matchBase || !0 === opts.basename ? picomatch.matchBase(input, regex, options, posix) : regex.exec(output)), {
|
|
900
|
-
isMatch: !!match,
|
|
901
|
-
match,
|
|
902
|
-
output
|
|
903
|
-
};
|
|
904
|
-
}, picomatch.matchBase = (input, glob, options)=>(glob instanceof RegExp ? glob : picomatch.makeRe(glob, options)).test(utils.basename(input)), picomatch.isMatch = (str, patterns, options)=>picomatch(patterns, options)(str), picomatch.parse = (pattern, options)=>Array.isArray(pattern) ? pattern.map((p)=>picomatch.parse(p, options)) : parse(pattern, {
|
|
905
|
-
...options,
|
|
906
|
-
fastpaths: !1
|
|
907
|
-
}), picomatch.scan = (input, options)=>scan(input, options), picomatch.compileRe = (state, options, returnOutput = !1, returnState = !1)=>{
|
|
908
|
-
if (!0 === returnOutput) return state.output;
|
|
909
|
-
let opts = options || {}, prepend = opts.contains ? '' : '^', append = opts.contains ? '' : '$', source = `${prepend}(?:${state.output})${append}`;
|
|
910
|
-
state && !0 === state.negated && (source = `^(?!${source}).*$`);
|
|
911
|
-
let regex = picomatch.toRegex(source, options);
|
|
912
|
-
return !0 === returnState && (regex.state = state), regex;
|
|
913
|
-
}, picomatch.makeRe = (input, options = {}, returnOutput = !1, returnState = !1)=>{
|
|
914
|
-
if (!input || 'string' != typeof input) throw TypeError('Expected a non-empty string');
|
|
915
|
-
let parsed = {
|
|
916
|
-
negated: !1,
|
|
917
|
-
fastpaths: !0
|
|
918
|
-
};
|
|
919
|
-
return !1 !== options.fastpaths && ('.' === input[0] || '*' === input[0]) && (parsed.output = parse.fastpaths(input, options)), parsed.output || (parsed = parse(input, options)), picomatch.compileRe(parsed, options, returnOutput, returnState);
|
|
920
|
-
}, picomatch.toRegex = (source, options)=>{
|
|
921
|
-
try {
|
|
922
|
-
let opts = options || {};
|
|
923
|
-
return new RegExp(source, opts.flags || (opts.nocase ? 'i' : ''));
|
|
924
|
-
} catch (err) {
|
|
925
|
-
if (options && !0 === options.debug) throw err;
|
|
926
|
-
return /$^/;
|
|
927
|
-
}
|
|
928
|
-
}, picomatch.constants = constants, module.exports = picomatch;
|
|
929
|
-
},
|
|
930
|
-
"../../node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/lib/scan.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
931
|
-
let utils = __webpack_require__("../../node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/lib/utils.js"), { 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 } = __webpack_require__("../../node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/lib/constants.js"), isPathSeparator = (code)=>code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH, depth = (token)=>{
|
|
932
|
-
!0 !== token.isPrefix && (token.depth = token.isGlobstar ? 1 / 0 : 1);
|
|
933
|
-
};
|
|
934
|
-
module.exports = (input, options)=>{
|
|
935
|
-
let prev, code, opts = options || {}, length = input.length - 1, scanToEnd = !0 === opts.parts || !0 === opts.scanToEnd, slashes = [], tokens = [], parts = [], str = input, index = -1, start = 0, lastIndex = 0, isBrace = !1, isBracket = !1, isGlob = !1, isExtglob = !1, isGlobstar = !1, braceEscaped = !1, backslashes = !1, negated = !1, negatedExtglob = !1, finished = !1, braces = 0, token = {
|
|
936
|
-
value: '',
|
|
937
|
-
depth: 0,
|
|
938
|
-
isGlob: !1
|
|
939
|
-
}, eos = ()=>index >= length, peek = ()=>str.charCodeAt(index + 1), advance = ()=>(prev = code, str.charCodeAt(++index));
|
|
940
|
-
for(; index < length;){
|
|
941
|
-
let next;
|
|
942
|
-
if ((code = advance()) === CHAR_BACKWARD_SLASH) {
|
|
943
|
-
backslashes = token.backslashes = !0, (code = advance()) === CHAR_LEFT_CURLY_BRACE && (braceEscaped = !0);
|
|
944
|
-
continue;
|
|
945
|
-
}
|
|
946
|
-
if (!0 === braceEscaped || code === CHAR_LEFT_CURLY_BRACE) {
|
|
947
|
-
for(braces++; !0 !== eos() && (code = advance());){
|
|
948
|
-
if (code === CHAR_BACKWARD_SLASH) {
|
|
949
|
-
backslashes = token.backslashes = !0, advance();
|
|
950
|
-
continue;
|
|
951
|
-
}
|
|
952
|
-
if (code === CHAR_LEFT_CURLY_BRACE) {
|
|
953
|
-
braces++;
|
|
954
|
-
continue;
|
|
955
|
-
}
|
|
956
|
-
if (!0 !== braceEscaped && code === CHAR_DOT && (code = advance()) === CHAR_DOT || !0 !== braceEscaped && code === CHAR_COMMA) {
|
|
957
|
-
if (isBrace = token.isBrace = !0, isGlob = token.isGlob = !0, finished = !0, !0 === scanToEnd) continue;
|
|
958
|
-
break;
|
|
959
|
-
}
|
|
960
|
-
if (code === CHAR_RIGHT_CURLY_BRACE && 0 == --braces) {
|
|
961
|
-
braceEscaped = !1, isBrace = token.isBrace = !0, finished = !0;
|
|
962
|
-
break;
|
|
963
|
-
}
|
|
964
|
-
}
|
|
965
|
-
if (!0 === scanToEnd) continue;
|
|
966
|
-
break;
|
|
967
|
-
}
|
|
968
|
-
if (code === CHAR_FORWARD_SLASH) {
|
|
969
|
-
if (slashes.push(index), tokens.push(token), token = {
|
|
970
|
-
value: '',
|
|
971
|
-
depth: 0,
|
|
972
|
-
isGlob: !1
|
|
973
|
-
}, !0 === finished) continue;
|
|
974
|
-
if (prev === CHAR_DOT && index === start + 1) {
|
|
975
|
-
start += 2;
|
|
976
|
-
continue;
|
|
977
|
-
}
|
|
978
|
-
lastIndex = index + 1;
|
|
979
|
-
continue;
|
|
980
|
-
}
|
|
981
|
-
if (!0 !== opts.noext && !0 == (code === CHAR_PLUS || code === CHAR_AT || code === CHAR_ASTERISK || code === CHAR_QUESTION_MARK || code === CHAR_EXCLAMATION_MARK) && peek() === CHAR_LEFT_PARENTHESES) {
|
|
982
|
-
if (isGlob = token.isGlob = !0, isExtglob = token.isExtglob = !0, finished = !0, code === CHAR_EXCLAMATION_MARK && index === start && (negatedExtglob = !0), !0 === scanToEnd) {
|
|
983
|
-
for(; !0 !== eos() && (code = advance());){
|
|
984
|
-
if (code === CHAR_BACKWARD_SLASH) {
|
|
985
|
-
backslashes = token.backslashes = !0, code = advance();
|
|
986
|
-
continue;
|
|
987
|
-
}
|
|
988
|
-
if (code === CHAR_RIGHT_PARENTHESES) {
|
|
989
|
-
isGlob = token.isGlob = !0, finished = !0;
|
|
990
|
-
break;
|
|
991
|
-
}
|
|
992
|
-
}
|
|
993
|
-
continue;
|
|
994
|
-
}
|
|
995
|
-
break;
|
|
996
|
-
}
|
|
997
|
-
if (code === CHAR_ASTERISK) {
|
|
998
|
-
if (prev === CHAR_ASTERISK && (isGlobstar = token.isGlobstar = !0), isGlob = token.isGlob = !0, finished = !0, !0 === scanToEnd) continue;
|
|
999
|
-
break;
|
|
1000
|
-
}
|
|
1001
|
-
if (code === CHAR_QUESTION_MARK) {
|
|
1002
|
-
if (isGlob = token.isGlob = !0, finished = !0, !0 === scanToEnd) continue;
|
|
1003
|
-
break;
|
|
1004
|
-
}
|
|
1005
|
-
if (code === CHAR_LEFT_SQUARE_BRACKET) {
|
|
1006
|
-
for(; !0 !== eos() && (next = advance());){
|
|
1007
|
-
if (next === CHAR_BACKWARD_SLASH) {
|
|
1008
|
-
backslashes = token.backslashes = !0, advance();
|
|
1009
|
-
continue;
|
|
1010
|
-
}
|
|
1011
|
-
if (next === CHAR_RIGHT_SQUARE_BRACKET) {
|
|
1012
|
-
isBracket = token.isBracket = !0, isGlob = token.isGlob = !0, finished = !0;
|
|
1013
|
-
break;
|
|
1014
|
-
}
|
|
1015
|
-
}
|
|
1016
|
-
if (!0 === scanToEnd) continue;
|
|
1017
|
-
break;
|
|
1018
|
-
}
|
|
1019
|
-
if (!0 !== opts.nonegate && code === CHAR_EXCLAMATION_MARK && index === start) {
|
|
1020
|
-
negated = token.negated = !0, start++;
|
|
1021
|
-
continue;
|
|
1022
|
-
}
|
|
1023
|
-
if (!0 !== opts.noparen && code === CHAR_LEFT_PARENTHESES) {
|
|
1024
|
-
if (isGlob = token.isGlob = !0, !0 === scanToEnd) {
|
|
1025
|
-
for(; !0 !== eos() && (code = advance());){
|
|
1026
|
-
if (code === CHAR_LEFT_PARENTHESES) {
|
|
1027
|
-
backslashes = token.backslashes = !0, code = advance();
|
|
1028
|
-
continue;
|
|
1029
|
-
}
|
|
1030
|
-
if (code === CHAR_RIGHT_PARENTHESES) {
|
|
1031
|
-
finished = !0;
|
|
1032
|
-
break;
|
|
1033
|
-
}
|
|
1034
|
-
}
|
|
1035
|
-
continue;
|
|
1036
|
-
}
|
|
1037
|
-
break;
|
|
1038
|
-
}
|
|
1039
|
-
if (!0 === isGlob) {
|
|
1040
|
-
if (finished = !0, !0 === scanToEnd) continue;
|
|
1041
|
-
break;
|
|
1042
|
-
}
|
|
1043
|
-
}
|
|
1044
|
-
!0 === opts.noext && (isExtglob = !1, isGlob = !1);
|
|
1045
|
-
let base = str, prefix = '', glob = '';
|
|
1046
|
-
start > 0 && (prefix = str.slice(0, start), str = str.slice(start), lastIndex -= start), base && !0 === isGlob && lastIndex > 0 ? (base = str.slice(0, lastIndex), glob = str.slice(lastIndex)) : !0 === isGlob ? (base = '', glob = str) : base = str, base && '' !== base && '/' !== base && base !== str && isPathSeparator(base.charCodeAt(base.length - 1)) && (base = base.slice(0, -1)), !0 === opts.unescape && (glob && (glob = utils.removeBackslashes(glob)), base && !0 === backslashes && (base = utils.removeBackslashes(base)));
|
|
1047
|
-
let state = {
|
|
1048
|
-
prefix,
|
|
1049
|
-
input,
|
|
1050
|
-
start,
|
|
1051
|
-
base,
|
|
1052
|
-
glob,
|
|
1053
|
-
isBrace,
|
|
1054
|
-
isBracket,
|
|
1055
|
-
isGlob,
|
|
1056
|
-
isExtglob,
|
|
1057
|
-
isGlobstar,
|
|
1058
|
-
negated,
|
|
1059
|
-
negatedExtglob
|
|
1060
|
-
};
|
|
1061
|
-
if (!0 === opts.tokens && (state.maxDepth = 0, isPathSeparator(code) || tokens.push(token), state.tokens = tokens), !0 === opts.parts || !0 === opts.tokens) {
|
|
1062
|
-
let prevIndex;
|
|
1063
|
-
for(let idx = 0; idx < slashes.length; idx++){
|
|
1064
|
-
let n = prevIndex ? prevIndex + 1 : start, i = slashes[idx], value = input.slice(n, i);
|
|
1065
|
-
opts.tokens && (0 === idx && 0 !== start ? (tokens[idx].isPrefix = !0, tokens[idx].value = prefix) : tokens[idx].value = value, depth(tokens[idx]), state.maxDepth += tokens[idx].depth), (0 !== idx || '' !== value) && parts.push(value), prevIndex = i;
|
|
1066
|
-
}
|
|
1067
|
-
if (prevIndex && prevIndex + 1 < input.length) {
|
|
1068
|
-
let value = input.slice(prevIndex + 1);
|
|
1069
|
-
parts.push(value), opts.tokens && (tokens[tokens.length - 1].value = value, depth(tokens[tokens.length - 1]), state.maxDepth += tokens[tokens.length - 1].depth);
|
|
1070
|
-
}
|
|
1071
|
-
state.slashes = slashes, state.parts = parts;
|
|
1072
|
-
}
|
|
1073
|
-
return state;
|
|
1074
|
-
};
|
|
1075
|
-
},
|
|
1076
|
-
"../../node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/lib/utils.js" (__unused_rspack_module, exports, __webpack_require__) {
|
|
1077
|
-
let { REGEX_BACKSLASH, REGEX_REMOVE_BACKSLASH, REGEX_SPECIAL_CHARS, REGEX_SPECIAL_CHARS_GLOBAL } = __webpack_require__("../../node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/lib/constants.js");
|
|
1078
|
-
exports.isObject = (val)=>null !== val && 'object' == typeof val && !Array.isArray(val), exports.hasRegexChars = (str)=>REGEX_SPECIAL_CHARS.test(str), exports.isRegexChar = (str)=>1 === str.length && exports.hasRegexChars(str), exports.escapeRegex = (str)=>str.replace(REGEX_SPECIAL_CHARS_GLOBAL, '\\$1'), exports.toPosixSlashes = (str)=>str.replace(REGEX_BACKSLASH, '/'), exports.isWindows = ()=>{
|
|
1079
|
-
if ("u" > typeof navigator && navigator.platform) {
|
|
1080
|
-
let platform = navigator.platform.toLowerCase();
|
|
1081
|
-
return 'win32' === platform || 'windows' === platform;
|
|
1082
|
-
}
|
|
1083
|
-
return "u" > typeof process && !!process.platform && 'win32' === process.platform;
|
|
1084
|
-
}, exports.removeBackslashes = (str)=>str.replace(REGEX_REMOVE_BACKSLASH, (match)=>'\\' === match ? '' : match), exports.escapeLast = (input, char, lastIdx)=>{
|
|
1085
|
-
let idx = input.lastIndexOf(char, lastIdx);
|
|
1086
|
-
return -1 === idx ? input : '\\' === input[idx - 1] ? exports.escapeLast(input, char, idx - 1) : `${input.slice(0, idx)}\\${input.slice(idx)}`;
|
|
1087
|
-
}, exports.removePrefix = (input, state = {})=>{
|
|
1088
|
-
let output = input;
|
|
1089
|
-
return output.startsWith('./') && (output = output.slice(2), state.prefix = './'), output;
|
|
1090
|
-
}, exports.wrapOutput = (input, state = {}, options = {})=>{
|
|
1091
|
-
let prepend = options.contains ? '' : '^', append = options.contains ? '' : '$', output = `${prepend}(?:${input})${append}`;
|
|
1092
|
-
return !0 === state.negated && (output = `(?:^(?!${output}).*$)`), output;
|
|
1093
|
-
}, exports.basename = (path, { windows } = {})=>{
|
|
1094
|
-
let segs = path.split(windows ? /[\\/]/ : '/'), last = segs[segs.length - 1];
|
|
1095
|
-
return '' === last ? segs[segs.length - 2] : last;
|
|
1096
|
-
};
|
|
1097
|
-
}
|
|
1098
|
-
});
|
|
1099
|
-
var __require = createRequire(import.meta.url);
|
|
1100
|
-
function cleanPath(path) {
|
|
1101
|
-
let normalized = normalize(path);
|
|
1102
|
-
return normalized.length > 1 && normalized[normalized.length - 1] === sep && (normalized = normalized.substring(0, normalized.length - 1)), normalized;
|
|
1103
|
-
}
|
|
1104
|
-
let SLASHES_REGEX = /[\\/]/g;
|
|
1105
|
-
function convertSlashes(path, separator) {
|
|
1106
|
-
return path.replace(SLASHES_REGEX, separator);
|
|
1107
|
-
}
|
|
1108
|
-
let WINDOWS_ROOT_DIR_REGEX = /^[a-z]:[\\/]$/i;
|
|
1109
|
-
function isRootDirectory(path) {
|
|
1110
|
-
return "/" === path || WINDOWS_ROOT_DIR_REGEX.test(path);
|
|
1111
|
-
}
|
|
1112
|
-
function normalizePath(path, options) {
|
|
1113
|
-
let { resolvePaths, normalizePath: normalizePath$1, pathSeparator } = options, pathNeedsCleaning = "win32" === process.platform && path.includes("/") || path.startsWith(".");
|
|
1114
|
-
return (resolvePaths && (path = resolve(path)), (normalizePath$1 || pathNeedsCleaning) && (path = cleanPath(path)), "." === path) ? "" : convertSlashes(path[path.length - 1] !== pathSeparator ? path + pathSeparator : path, pathSeparator);
|
|
1115
|
-
}
|
|
1116
|
-
function joinPathWithBasePath(filename, directoryPath) {
|
|
1117
|
-
return directoryPath + filename;
|
|
1118
|
-
}
|
|
1119
|
-
function joinPathWithRelativePath(root, options) {
|
|
1120
|
-
return function(filename, directoryPath) {
|
|
1121
|
-
return directoryPath.startsWith(root) ? directoryPath.slice(root.length) + filename : convertSlashes(external_path_relative(root, directoryPath), options.pathSeparator) + options.pathSeparator + filename;
|
|
1122
|
-
};
|
|
1123
|
-
}
|
|
1124
|
-
function joinPath(filename) {
|
|
1125
|
-
return filename;
|
|
1126
|
-
}
|
|
1127
|
-
function joinDirectoryPath(filename, directoryPath, separator) {
|
|
1128
|
-
return directoryPath + filename + separator;
|
|
1129
|
-
}
|
|
1130
|
-
function build$7(root, options) {
|
|
1131
|
-
let { relativePaths, includeBasePath } = options;
|
|
1132
|
-
return relativePaths && root ? joinPathWithRelativePath(root, options) : includeBasePath ? joinPathWithBasePath : joinPath;
|
|
1133
|
-
}
|
|
1134
|
-
function pushDirectoryWithRelativePath(root) {
|
|
1135
|
-
return function(directoryPath, paths) {
|
|
1136
|
-
paths.push(directoryPath.substring(root.length) || ".");
|
|
1137
|
-
};
|
|
1138
|
-
}
|
|
1139
|
-
function pushDirectoryFilterWithRelativePath(root) {
|
|
1140
|
-
return function(directoryPath, paths, filters) {
|
|
1141
|
-
let relativePath = directoryPath.substring(root.length) || ".";
|
|
1142
|
-
filters.every((filter)=>filter(relativePath, !0)) && paths.push(relativePath);
|
|
1143
|
-
};
|
|
1144
|
-
}
|
|
1145
|
-
let pushDirectory = (directoryPath, paths)=>{
|
|
1146
|
-
paths.push(directoryPath || ".");
|
|
1147
|
-
}, pushDirectoryFilter = (directoryPath, paths, filters)=>{
|
|
1148
|
-
let path = directoryPath || ".";
|
|
1149
|
-
filters.every((filter)=>filter(path, !0)) && paths.push(path);
|
|
1150
|
-
}, empty$2 = ()=>{};
|
|
1151
|
-
function build$6(root, options) {
|
|
1152
|
-
let { includeDirs, filters, relativePaths } = options;
|
|
1153
|
-
return includeDirs ? relativePaths ? filters && filters.length ? pushDirectoryFilterWithRelativePath(root) : pushDirectoryWithRelativePath(root) : filters && filters.length ? pushDirectoryFilter : pushDirectory : empty$2;
|
|
1154
|
-
}
|
|
1155
|
-
let pushFileFilterAndCount = (filename, _paths, counts, filters)=>{
|
|
1156
|
-
filters.every((filter)=>filter(filename, !1)) && counts.files++;
|
|
1157
|
-
}, pushFileFilter = (filename, paths, _counts, filters)=>{
|
|
1158
|
-
filters.every((filter)=>filter(filename, !1)) && paths.push(filename);
|
|
1159
|
-
}, pushFileCount = (_filename, _paths, counts, _filters)=>{
|
|
1160
|
-
counts.files++;
|
|
1161
|
-
}, pushFile = (filename, paths)=>{
|
|
1162
|
-
paths.push(filename);
|
|
1163
|
-
}, empty$1 = ()=>{};
|
|
1164
|
-
function build$5(options) {
|
|
1165
|
-
let { excludeFiles, filters, onlyCounts } = options;
|
|
1166
|
-
return excludeFiles ? empty$1 : filters && filters.length ? onlyCounts ? pushFileFilterAndCount : pushFileFilter : onlyCounts ? pushFileCount : pushFile;
|
|
1167
|
-
}
|
|
1168
|
-
let getArray = (paths)=>paths, getArrayGroup = ()=>[
|
|
1169
|
-
""
|
|
1170
|
-
].slice(0, 0);
|
|
1171
|
-
function build$4(options) {
|
|
1172
|
-
return options.group ? getArrayGroup : getArray;
|
|
1173
|
-
}
|
|
1174
|
-
let groupFiles = (groups, directory, files)=>{
|
|
1175
|
-
groups.push({
|
|
1176
|
-
directory,
|
|
1177
|
-
files,
|
|
1178
|
-
dir: directory
|
|
1179
|
-
});
|
|
1180
|
-
}, empty = ()=>{};
|
|
1181
|
-
function build$3(options) {
|
|
1182
|
-
return options.group ? groupFiles : empty;
|
|
1183
|
-
}
|
|
1184
|
-
let resolveSymlinksAsync = function(path, state, callback$1) {
|
|
1185
|
-
let { queue, fs, options: { suppressErrors } } = state;
|
|
1186
|
-
queue.enqueue(), fs.realpath(path, (error, resolvedPath)=>{
|
|
1187
|
-
if (error) return queue.dequeue(suppressErrors ? null : error, state);
|
|
1188
|
-
fs.stat(resolvedPath, (error$1, stat)=>error$1 ? queue.dequeue(suppressErrors ? null : error$1, state) : stat.isDirectory() && isRecursive(path, resolvedPath, state) ? queue.dequeue(null, state) : void (callback$1(stat, resolvedPath), queue.dequeue(null, state)));
|
|
1189
|
-
});
|
|
1190
|
-
}, resolveSymlinks = function(path, state, callback$1) {
|
|
1191
|
-
let { queue, fs, options: { suppressErrors } } = state;
|
|
1192
|
-
queue.enqueue();
|
|
1193
|
-
try {
|
|
1194
|
-
let resolvedPath = fs.realpathSync(path), stat = fs.statSync(resolvedPath);
|
|
1195
|
-
if (stat.isDirectory() && isRecursive(path, resolvedPath, state)) return;
|
|
1196
|
-
callback$1(stat, resolvedPath);
|
|
1197
|
-
} catch (e) {
|
|
1198
|
-
if (!suppressErrors) throw e;
|
|
1199
|
-
}
|
|
1200
|
-
};
|
|
1201
|
-
function build$2(options, isSynchronous) {
|
|
1202
|
-
return !options.resolveSymlinks || options.excludeSymlinks ? null : isSynchronous ? resolveSymlinks : resolveSymlinksAsync;
|
|
1203
|
-
}
|
|
1204
|
-
function isRecursive(path, resolved, state) {
|
|
1205
|
-
if (state.options.useRealPaths) return isRecursiveUsingRealPaths(resolved, state);
|
|
1206
|
-
let parent = dirname(path), depth = 1;
|
|
1207
|
-
for(; parent !== state.root && depth < 2;){
|
|
1208
|
-
let resolvedPath = state.symlinks.get(parent);
|
|
1209
|
-
resolvedPath && (resolvedPath === resolved || resolvedPath.startsWith(resolved) || resolved.startsWith(resolvedPath)) ? depth++ : parent = dirname(parent);
|
|
1210
|
-
}
|
|
1211
|
-
return state.symlinks.set(path, resolved), depth > 1;
|
|
1212
|
-
}
|
|
1213
|
-
function isRecursiveUsingRealPaths(resolved, state) {
|
|
1214
|
-
return state.visited.includes(resolved + state.options.pathSeparator);
|
|
1215
|
-
}
|
|
1216
|
-
let onlyCountsSync = (state)=>state.counts, groupsSync = (state)=>state.groups, defaultSync = (state)=>state.paths, limitFilesSync = (state)=>state.paths.slice(0, state.options.maxFiles), onlyCountsAsync = (state, error, callback$1)=>(report(error, callback$1, state.counts, state.options.suppressErrors), null), defaultAsync = (state, error, callback$1)=>(report(error, callback$1, state.paths, state.options.suppressErrors), null), limitFilesAsync = (state, error, callback$1)=>(report(error, callback$1, state.paths.slice(0, state.options.maxFiles), state.options.suppressErrors), null), groupsAsync = (state, error, callback$1)=>(report(error, callback$1, state.groups, state.options.suppressErrors), null);
|
|
1217
|
-
function report(error, callback$1, output, suppressErrors) {
|
|
1218
|
-
callback$1(error && !suppressErrors ? error : null, output);
|
|
1219
|
-
}
|
|
1220
|
-
function build$1(options, isSynchronous) {
|
|
1221
|
-
let { onlyCounts, group, maxFiles } = options;
|
|
1222
|
-
return onlyCounts ? isSynchronous ? onlyCountsSync : onlyCountsAsync : group ? isSynchronous ? groupsSync : groupsAsync : maxFiles ? isSynchronous ? limitFilesSync : limitFilesAsync : isSynchronous ? defaultSync : defaultAsync;
|
|
1223
|
-
}
|
|
1224
|
-
let readdirOpts = {
|
|
1225
|
-
withFileTypes: !0
|
|
1226
|
-
}, walkAsync = (state, crawlPath, directoryPath, currentDepth, callback$1)=>{
|
|
1227
|
-
if (state.queue.enqueue(), currentDepth < 0) return state.queue.dequeue(null, state);
|
|
1228
|
-
let { fs } = state;
|
|
1229
|
-
state.visited.push(crawlPath), state.counts.directories++, fs.readdir(crawlPath || ".", readdirOpts, (error, entries = [])=>{
|
|
1230
|
-
callback$1(entries, directoryPath, currentDepth), state.queue.dequeue(state.options.suppressErrors ? null : error, state);
|
|
1231
|
-
});
|
|
1232
|
-
}, walkSync = (state, crawlPath, directoryPath, currentDepth, callback$1)=>{
|
|
1233
|
-
let { fs } = state;
|
|
1234
|
-
if (currentDepth < 0) return;
|
|
1235
|
-
state.visited.push(crawlPath), state.counts.directories++;
|
|
1236
|
-
let entries = [];
|
|
1237
|
-
try {
|
|
1238
|
-
entries = fs.readdirSync(crawlPath || ".", readdirOpts);
|
|
1239
|
-
} catch (e) {
|
|
1240
|
-
if (!state.options.suppressErrors) throw e;
|
|
1241
|
-
}
|
|
1242
|
-
callback$1(entries, directoryPath, currentDepth);
|
|
1243
|
-
};
|
|
1244
|
-
function build(isSynchronous) {
|
|
1245
|
-
return isSynchronous ? walkSync : walkAsync;
|
|
1246
|
-
}
|
|
1247
|
-
var Queue = class {
|
|
1248
|
-
count = 0;
|
|
1249
|
-
constructor(onQueueEmpty){
|
|
1250
|
-
this.onQueueEmpty = onQueueEmpty;
|
|
1251
|
-
}
|
|
1252
|
-
enqueue() {
|
|
1253
|
-
return this.count++, this.count;
|
|
1254
|
-
}
|
|
1255
|
-
dequeue(error, output) {
|
|
1256
|
-
this.onQueueEmpty && (--this.count <= 0 || error) && (this.onQueueEmpty(error, output), error && (output.controller.abort(), this.onQueueEmpty = void 0));
|
|
1257
|
-
}
|
|
1258
|
-
}, Counter = class {
|
|
1259
|
-
_files = 0;
|
|
1260
|
-
_directories = 0;
|
|
1261
|
-
set files(num) {
|
|
1262
|
-
this._files = num;
|
|
1263
|
-
}
|
|
1264
|
-
get files() {
|
|
1265
|
-
return this._files;
|
|
1266
|
-
}
|
|
1267
|
-
set directories(num) {
|
|
1268
|
-
this._directories = num;
|
|
1269
|
-
}
|
|
1270
|
-
get directories() {
|
|
1271
|
-
return this._directories;
|
|
1272
|
-
}
|
|
1273
|
-
get dirs() {
|
|
1274
|
-
return this._directories;
|
|
1275
|
-
}
|
|
1276
|
-
}, Aborter = class {
|
|
1277
|
-
aborted = !1;
|
|
1278
|
-
abort() {
|
|
1279
|
-
this.aborted = !0;
|
|
1280
|
-
}
|
|
1281
|
-
}, Walker = class {
|
|
1282
|
-
root;
|
|
1283
|
-
isSynchronous;
|
|
1284
|
-
state;
|
|
1285
|
-
joinPath;
|
|
1286
|
-
pushDirectory;
|
|
1287
|
-
pushFile;
|
|
1288
|
-
getArray;
|
|
1289
|
-
groupFiles;
|
|
1290
|
-
resolveSymlink;
|
|
1291
|
-
walkDirectory;
|
|
1292
|
-
callbackInvoker;
|
|
1293
|
-
constructor(root, options, callback$1){
|
|
1294
|
-
this.isSynchronous = !callback$1, this.callbackInvoker = build$1(options, this.isSynchronous), this.root = normalizePath(root, options), this.state = {
|
|
1295
|
-
root: isRootDirectory(this.root) ? this.root : this.root.slice(0, -1),
|
|
1296
|
-
paths: [
|
|
1297
|
-
""
|
|
1298
|
-
].slice(0, 0),
|
|
1299
|
-
groups: [],
|
|
1300
|
-
counts: new Counter(),
|
|
1301
|
-
options,
|
|
1302
|
-
queue: new Queue((error, state)=>this.callbackInvoker(state, error, callback$1)),
|
|
1303
|
-
symlinks: new Map(),
|
|
1304
|
-
visited: [
|
|
1305
|
-
""
|
|
1306
|
-
].slice(0, 0),
|
|
1307
|
-
controller: new Aborter(),
|
|
1308
|
-
fs: options.fs || __rspack_external_fs
|
|
1309
|
-
}, this.joinPath = build$7(this.root, options), this.pushDirectory = build$6(this.root, options), this.pushFile = build$5(options), this.getArray = build$4(options), this.groupFiles = build$3(options), this.resolveSymlink = build$2(options, this.isSynchronous), this.walkDirectory = build(this.isSynchronous);
|
|
1310
|
-
}
|
|
1311
|
-
start() {
|
|
1312
|
-
return this.pushDirectory(this.root, this.state.paths, this.state.options.filters), this.walkDirectory(this.state, this.root, this.root, this.state.options.maxDepth, this.walk), this.isSynchronous ? this.callbackInvoker(this.state, null) : null;
|
|
1313
|
-
}
|
|
1314
|
-
walk = (entries, directoryPath, depth)=>{
|
|
1315
|
-
let { paths, options: { filters, resolveSymlinks: resolveSymlinks$1, excludeSymlinks, exclude, maxFiles, signal, useRealPaths, pathSeparator }, controller } = this.state;
|
|
1316
|
-
if (controller.aborted || signal && signal.aborted || maxFiles && paths.length > maxFiles) return;
|
|
1317
|
-
let files = this.getArray(this.state.paths);
|
|
1318
|
-
for(let i = 0; i < entries.length; ++i){
|
|
1319
|
-
let entry = entries[i];
|
|
1320
|
-
if (entry.isFile() || entry.isSymbolicLink() && !resolveSymlinks$1 && !excludeSymlinks) {
|
|
1321
|
-
let filename = this.joinPath(entry.name, directoryPath);
|
|
1322
|
-
this.pushFile(filename, files, this.state.counts, filters);
|
|
1323
|
-
} else if (entry.isDirectory()) {
|
|
1324
|
-
let path = joinDirectoryPath(entry.name, directoryPath, this.state.options.pathSeparator);
|
|
1325
|
-
if (exclude && exclude(entry.name, path)) continue;
|
|
1326
|
-
this.pushDirectory(path, paths, filters), this.walkDirectory(this.state, path, path, depth - 1, this.walk);
|
|
1327
|
-
} else if (this.resolveSymlink && entry.isSymbolicLink()) {
|
|
1328
|
-
let path = directoryPath + entry.name;
|
|
1329
|
-
this.resolveSymlink(path, this.state, (stat, resolvedPath)=>{
|
|
1330
|
-
if (stat.isDirectory()) resolvedPath = normalizePath(resolvedPath, this.state.options), exclude && exclude(entry.name, useRealPaths ? resolvedPath : path + pathSeparator) || this.walkDirectory(this.state, resolvedPath, useRealPaths ? resolvedPath : path + pathSeparator, depth - 1, this.walk);
|
|
1331
|
-
else {
|
|
1332
|
-
let filename = basename(resolvedPath = useRealPaths ? resolvedPath : path), directoryPath$1 = normalizePath(dirname(resolvedPath), this.state.options);
|
|
1333
|
-
resolvedPath = this.joinPath(filename, directoryPath$1), this.pushFile(resolvedPath, files, this.state.counts, filters);
|
|
1334
|
-
}
|
|
1335
|
-
});
|
|
1336
|
-
}
|
|
1337
|
-
}
|
|
1338
|
-
this.groupFiles(this.state.groups, directoryPath, files);
|
|
1339
|
-
};
|
|
1340
|
-
};
|
|
1341
|
-
function promise(root, options) {
|
|
1342
|
-
return new Promise((resolve$1, reject)=>{
|
|
1343
|
-
callback(root, options, (err, output)=>{
|
|
1344
|
-
if (err) return reject(err);
|
|
1345
|
-
resolve$1(output);
|
|
1346
|
-
});
|
|
1347
|
-
});
|
|
1348
|
-
}
|
|
1349
|
-
function callback(root, options, callback$1) {
|
|
1350
|
-
new Walker(root, options, callback$1).start();
|
|
1351
|
-
}
|
|
1352
|
-
function sync(root, options) {
|
|
1353
|
-
return new Walker(root, options).start();
|
|
1354
|
-
}
|
|
1355
|
-
var APIBuilder = class {
|
|
1356
|
-
constructor(root, options){
|
|
1357
|
-
this.root = root, this.options = options;
|
|
1358
|
-
}
|
|
1359
|
-
withPromise() {
|
|
1360
|
-
return promise(this.root, this.options);
|
|
1361
|
-
}
|
|
1362
|
-
withCallback(cb) {
|
|
1363
|
-
callback(this.root, this.options, cb);
|
|
1364
|
-
}
|
|
1365
|
-
sync() {
|
|
1366
|
-
return sync(this.root, this.options);
|
|
1367
|
-
}
|
|
1368
|
-
};
|
|
1369
|
-
let pm = null;
|
|
1370
|
-
try {
|
|
1371
|
-
__require.resolve("picomatch"), pm = __require("picomatch");
|
|
1372
|
-
} catch {}
|
|
1373
|
-
var Builder = class {
|
|
1374
|
-
globCache = {};
|
|
1375
|
-
options = {
|
|
1376
|
-
maxDepth: 1 / 0,
|
|
1377
|
-
suppressErrors: !0,
|
|
1378
|
-
pathSeparator: sep,
|
|
1379
|
-
filters: []
|
|
1380
|
-
};
|
|
1381
|
-
globFunction;
|
|
1382
|
-
constructor(options){
|
|
1383
|
-
this.options = {
|
|
1384
|
-
...this.options,
|
|
1385
|
-
...options
|
|
1386
|
-
}, this.globFunction = this.options.globFunction;
|
|
1387
|
-
}
|
|
1388
|
-
group() {
|
|
1389
|
-
return this.options.group = !0, this;
|
|
1390
|
-
}
|
|
1391
|
-
withPathSeparator(separator) {
|
|
1392
|
-
return this.options.pathSeparator = separator, this;
|
|
1393
|
-
}
|
|
1394
|
-
withBasePath() {
|
|
1395
|
-
return this.options.includeBasePath = !0, this;
|
|
1396
|
-
}
|
|
1397
|
-
withRelativePaths() {
|
|
1398
|
-
return this.options.relativePaths = !0, this;
|
|
1399
|
-
}
|
|
1400
|
-
withDirs() {
|
|
1401
|
-
return this.options.includeDirs = !0, this;
|
|
1402
|
-
}
|
|
1403
|
-
withMaxDepth(depth) {
|
|
1404
|
-
return this.options.maxDepth = depth, this;
|
|
1405
|
-
}
|
|
1406
|
-
withMaxFiles(limit) {
|
|
1407
|
-
return this.options.maxFiles = limit, this;
|
|
1408
|
-
}
|
|
1409
|
-
withFullPaths() {
|
|
1410
|
-
return this.options.resolvePaths = !0, this.options.includeBasePath = !0, this;
|
|
1411
|
-
}
|
|
1412
|
-
withErrors() {
|
|
1413
|
-
return this.options.suppressErrors = !1, this;
|
|
1414
|
-
}
|
|
1415
|
-
withSymlinks({ resolvePaths = !0 } = {}) {
|
|
1416
|
-
return this.options.resolveSymlinks = !0, this.options.useRealPaths = resolvePaths, this.withFullPaths();
|
|
1417
|
-
}
|
|
1418
|
-
withAbortSignal(signal) {
|
|
1419
|
-
return this.options.signal = signal, this;
|
|
1420
|
-
}
|
|
1421
|
-
normalize() {
|
|
1422
|
-
return this.options.normalizePath = !0, this;
|
|
1423
|
-
}
|
|
1424
|
-
filter(predicate) {
|
|
1425
|
-
return this.options.filters.push(predicate), this;
|
|
1426
|
-
}
|
|
1427
|
-
onlyDirs() {
|
|
1428
|
-
return this.options.excludeFiles = !0, this.options.includeDirs = !0, this;
|
|
1429
|
-
}
|
|
1430
|
-
exclude(predicate) {
|
|
1431
|
-
return this.options.exclude = predicate, this;
|
|
1432
|
-
}
|
|
1433
|
-
onlyCounts() {
|
|
1434
|
-
return this.options.onlyCounts = !0, this;
|
|
1435
|
-
}
|
|
1436
|
-
crawl(root) {
|
|
1437
|
-
return new APIBuilder(root || ".", this.options);
|
|
1438
|
-
}
|
|
1439
|
-
withGlobFunction(fn) {
|
|
1440
|
-
return this.globFunction = fn, this;
|
|
1441
|
-
}
|
|
1442
|
-
crawlWithOptions(root, options) {
|
|
1443
|
-
return this.options = {
|
|
1444
|
-
...this.options,
|
|
1445
|
-
...options
|
|
1446
|
-
}, new APIBuilder(root || ".", this.options);
|
|
1447
|
-
}
|
|
1448
|
-
glob(...patterns) {
|
|
1449
|
-
return this.globFunction ? this.globWithOptions(patterns) : this.globWithOptions(patterns, {
|
|
1450
|
-
dot: !0
|
|
1451
|
-
});
|
|
1452
|
-
}
|
|
1453
|
-
globWithOptions(patterns, ...options) {
|
|
1454
|
-
let globFn = this.globFunction || pm;
|
|
1455
|
-
if (!globFn) throw Error("Please specify a glob function to use glob matching.");
|
|
1456
|
-
var isMatch = this.globCache[patterns.join("\0")];
|
|
1457
|
-
return isMatch || (isMatch = globFn(patterns, ...options), this.globCache[patterns.join("\0")] = isMatch), this.options.filters.push((path)=>isMatch(path)), this;
|
|
1458
|
-
}
|
|
1459
|
-
};
|
|
1460
|
-
let picomatch = __webpack_require__("../../node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/index.js"), isReadonlyArray = Array.isArray, BACKSLASHES = /\\/g, DRIVE_RELATIVE_PATH = /^[A-Za-z]:$/, isWin = "win32" === process.platform, ONLY_PARENT_DIRECTORIES = /^(\/?\.\.)+$/;
|
|
1461
|
-
function getPartialMatcher(patterns, options = {}) {
|
|
1462
|
-
let i, j, patternsCount = patterns.length, patternsParts = Array(patternsCount), matchers = Array(patternsCount);
|
|
1463
|
-
for(i = 0; i < patternsCount; i++){
|
|
1464
|
-
let parts = splitPattern(patterns[i]);
|
|
1465
|
-
patternsParts[i] = parts;
|
|
1466
|
-
let partsCount = parts.length, partMatchers = Array(partsCount);
|
|
1467
|
-
for(j = 0; j < partsCount; j++)partMatchers[j] = picomatch(parts[j], options);
|
|
1468
|
-
matchers[i] = partMatchers;
|
|
1469
|
-
}
|
|
1470
|
-
return (input)=>{
|
|
1471
|
-
let inputParts = input.split("/");
|
|
1472
|
-
if (".." === inputParts[0] && ONLY_PARENT_DIRECTORIES.test(input)) return !0;
|
|
1473
|
-
for(i = 0; i < patternsCount; i++){
|
|
1474
|
-
let patternParts = patternsParts[i], matcher = matchers[i], inputPatternCount = inputParts.length, minParts = Math.min(inputPatternCount, patternParts.length);
|
|
1475
|
-
for(j = 0; j < minParts;){
|
|
1476
|
-
let part = patternParts[j];
|
|
1477
|
-
if (part.includes("/")) return !0;
|
|
1478
|
-
if (!matcher[j](inputParts[j])) break;
|
|
1479
|
-
if (!options.noglobstar && "**" === part) return !0;
|
|
1480
|
-
j++;
|
|
1481
|
-
}
|
|
1482
|
-
if (j === inputPatternCount) return !0;
|
|
1483
|
-
}
|
|
1484
|
-
return !1;
|
|
1485
|
-
};
|
|
1486
|
-
}
|
|
1487
|
-
let WIN32_ROOT_DIR = /^[A-Z]:\/$/i, isRoot = isWin ? (p)=>WIN32_ROOT_DIR.test(p) : (p)=>"/" === p;
|
|
1488
|
-
function buildFormat(cwd, root, absolute) {
|
|
1489
|
-
if (cwd === root || root.startsWith(`${cwd}/`)) {
|
|
1490
|
-
if (absolute) {
|
|
1491
|
-
let start = cwd.length + +!isRoot(cwd);
|
|
1492
|
-
return (p, isDir)=>p.slice(start, isDir ? -1 : void 0) || ".";
|
|
1493
|
-
}
|
|
1494
|
-
let prefix = root.slice(cwd.length + 1);
|
|
1495
|
-
return prefix ? (p, isDir)=>{
|
|
1496
|
-
if ("." === p) return prefix;
|
|
1497
|
-
let result = `${prefix}/${p}`;
|
|
1498
|
-
return isDir ? result.slice(0, -1) : result;
|
|
1499
|
-
} : (p, isDir)=>isDir && "." !== p ? p.slice(0, -1) : p;
|
|
1500
|
-
}
|
|
1501
|
-
return absolute ? (p)=>posix.relative(cwd, p) || "." : (p)=>posix.relative(cwd, `${root}/${p}`) || ".";
|
|
1502
|
-
}
|
|
1503
|
-
function buildRelative(cwd, root) {
|
|
1504
|
-
if (root.startsWith(`${cwd}/`)) {
|
|
1505
|
-
let prefix = root.slice(cwd.length + 1);
|
|
1506
|
-
return (p)=>`${prefix}/${p}`;
|
|
1507
|
-
}
|
|
1508
|
-
return (p)=>{
|
|
1509
|
-
let result = posix.relative(cwd, `${root}/${p}`);
|
|
1510
|
-
return "/" === p[p.length - 1] && "" !== result ? `${result}/` : result || ".";
|
|
1511
|
-
};
|
|
1512
|
-
}
|
|
1513
|
-
function ensureNonDriveRelativePath(path) {
|
|
1514
|
-
return path.replace(DRIVE_RELATIVE_PATH, (match)=>`${match}/`);
|
|
1515
|
-
}
|
|
1516
|
-
let splitPatternOptions = {
|
|
1517
|
-
parts: !0
|
|
1518
|
-
};
|
|
1519
|
-
function splitPattern(path) {
|
|
1520
|
-
var _result$parts;
|
|
1521
|
-
let result = picomatch.scan(path, splitPatternOptions);
|
|
1522
|
-
return (null == (_result$parts = result.parts) ? void 0 : _result$parts.length) ? result.parts : [
|
|
1523
|
-
path
|
|
1524
|
-
];
|
|
1525
|
-
}
|
|
1526
|
-
let POSIX_UNESCAPED_GLOB_SYMBOLS = /(?<!\\)([()[\]{}*?|]|^!|[!+@](?=\()|\\(?![()[\]{}!*+?@|]))/g, WIN32_UNESCAPED_GLOB_SYMBOLS = /(?<!\\)([()[\]{}]|^!|[!+@](?=\())/g, escapePath = isWin ? (path)=>path.replace(WIN32_UNESCAPED_GLOB_SYMBOLS, "\\$&") : (path)=>path.replace(POSIX_UNESCAPED_GLOB_SYMBOLS, "\\$&");
|
|
1527
|
-
function isDynamicPattern(pattern, options) {
|
|
1528
|
-
if ((null == options ? void 0 : options.caseSensitiveMatch) === !1) return !0;
|
|
1529
|
-
let scan = picomatch.scan(pattern);
|
|
1530
|
-
return scan.isGlob || scan.negated;
|
|
1531
|
-
}
|
|
1532
|
-
function log(...tasks) {
|
|
1533
|
-
console.log(`[tinyglobby ${new Date().toLocaleTimeString("es")}]`, ...tasks);
|
|
1534
|
-
}
|
|
1535
|
-
function ensureStringArray(value) {
|
|
1536
|
-
return "string" == typeof value ? [
|
|
1537
|
-
value
|
|
1538
|
-
] : null != value ? value : [];
|
|
1539
|
-
}
|
|
1540
|
-
let PARENT_DIRECTORY = /^(\/?\.\.)+/, ESCAPING_BACKSLASHES = /\\(?=[()[\]{}!*+?@|])/g;
|
|
1541
|
-
function normalizePattern(pattern, opts, props, isIgnore) {
|
|
1542
|
-
var _PARENT_DIRECTORY$exe;
|
|
1543
|
-
let cwd = opts.cwd, result = pattern;
|
|
1544
|
-
"/" === pattern[pattern.length - 1] && (result = pattern.slice(0, -1)), "*" !== result[result.length - 1] && opts.expandDirectories && (result += "/**");
|
|
1545
|
-
let escapedCwd = escapePath(cwd);
|
|
1546
|
-
result = isAbsolute(result.replace(ESCAPING_BACKSLASHES, "")) ? posix.relative(escapedCwd, result) : posix.normalize(result);
|
|
1547
|
-
let parentDir = null == (_PARENT_DIRECTORY$exe = PARENT_DIRECTORY.exec(result)) ? void 0 : _PARENT_DIRECTORY$exe[0], parts = splitPattern(result);
|
|
1548
|
-
if (parentDir) {
|
|
1549
|
-
let n = (parentDir.length + 1) / 3, i = 0, cwdParts = escapedCwd.split("/");
|
|
1550
|
-
for(; i < n && parts[i + n] === cwdParts[cwdParts.length + i - n];)result = result.slice(0, (n - i - 1) * 3) + result.slice((n - i) * 3 + parts[i + n].length + 1) || ".", i++;
|
|
1551
|
-
let potentialRoot = posix.join(cwd, parentDir.slice(3 * i));
|
|
1552
|
-
"." !== potentialRoot[0] && props.root.length > potentialRoot.length && (props.root = ensureNonDriveRelativePath(potentialRoot), props.depthOffset = -n + i);
|
|
1553
|
-
}
|
|
1554
|
-
if (!isIgnore && props.depthOffset >= 0) {
|
|
1555
|
-
null != props.commonPath || (props.commonPath = parts);
|
|
1556
|
-
let newCommonPath = [], length = Math.min(props.commonPath.length, parts.length);
|
|
1557
|
-
for(let i = 0; i < length; i++){
|
|
1558
|
-
let part = parts[i];
|
|
1559
|
-
if ("**" === part && !parts[i + 1]) {
|
|
1560
|
-
newCommonPath.pop();
|
|
1561
|
-
break;
|
|
1562
|
-
}
|
|
1563
|
-
if (i === parts.length - 1 || part !== props.commonPath[i] || isDynamicPattern(part)) break;
|
|
1564
|
-
newCommonPath.push(part);
|
|
1565
|
-
}
|
|
1566
|
-
props.depthOffset = newCommonPath.length, props.commonPath = newCommonPath, props.root = ensureNonDriveRelativePath(newCommonPath.length > 0 ? posix.join(cwd, ...newCommonPath) : cwd);
|
|
1567
|
-
}
|
|
1568
|
-
return result;
|
|
1569
|
-
}
|
|
1570
|
-
function processPatterns(options, patterns, props) {
|
|
1571
|
-
let matchPatterns = [], ignorePatterns = [];
|
|
1572
|
-
for (let pattern of options.ignore)pattern && ("!" !== pattern[0] || "(" === pattern[1]) && ignorePatterns.push(normalizePattern(pattern, options, props, !0));
|
|
1573
|
-
for (let pattern of patterns)pattern && ("!" !== pattern[0] || "(" === pattern[1] ? matchPatterns.push(normalizePattern(pattern, options, props, !1)) : ("!" !== pattern[1] || "(" === pattern[2]) && ignorePatterns.push(normalizePattern(pattern.slice(1), options, props, !0)));
|
|
1574
|
-
return {
|
|
1575
|
-
match: matchPatterns,
|
|
1576
|
-
ignore: ignorePatterns
|
|
1577
|
-
};
|
|
1578
|
-
}
|
|
1579
|
-
function buildCrawler(options, patterns) {
|
|
1580
|
-
let maxDepth, cwd = options.cwd, props = {
|
|
1581
|
-
root: cwd,
|
|
1582
|
-
depthOffset: 0
|
|
1583
|
-
}, processed = processPatterns(options, patterns, props);
|
|
1584
|
-
options.debug && log("internal processing patterns:", processed);
|
|
1585
|
-
let { absolute, caseSensitiveMatch, debug, dot, followSymbolicLinks, onlyDirectories } = options, root = props.root.replace(BACKSLASHES, ""), matchOptions = {
|
|
1586
|
-
dot,
|
|
1587
|
-
nobrace: !1 === options.braceExpansion,
|
|
1588
|
-
nocase: !caseSensitiveMatch,
|
|
1589
|
-
noextglob: !1 === options.extglob,
|
|
1590
|
-
noglobstar: !1 === options.globstar,
|
|
1591
|
-
posix: !0
|
|
1592
|
-
}, matcher = picomatch(processed.match, matchOptions), ignore = picomatch(processed.ignore, matchOptions), partialMatcher = getPartialMatcher(processed.match, matchOptions), format = buildFormat(cwd, root, absolute), excludeFormatter = absolute ? format : buildFormat(cwd, root, !0), excludePredicate = (_, p)=>{
|
|
1593
|
-
let relativePath = excludeFormatter(p, !0);
|
|
1594
|
-
return "." !== relativePath && !partialMatcher(relativePath) || ignore(relativePath);
|
|
1595
|
-
};
|
|
1596
|
-
void 0 !== options.deep && (maxDepth = Math.round(options.deep - props.depthOffset));
|
|
1597
|
-
let crawler = new Builder({
|
|
1598
|
-
filters: [
|
|
1599
|
-
debug ? (p, isDirectory)=>{
|
|
1600
|
-
let path = format(p, isDirectory), matches = matcher(path) && !ignore(path);
|
|
1601
|
-
return matches && log(`matched ${path}`), matches;
|
|
1602
|
-
} : (p, isDirectory)=>{
|
|
1603
|
-
let path = format(p, isDirectory);
|
|
1604
|
-
return matcher(path) && !ignore(path);
|
|
1605
|
-
}
|
|
1606
|
-
],
|
|
1607
|
-
exclude: debug ? (_, p)=>{
|
|
1608
|
-
let skipped = excludePredicate(_, p);
|
|
1609
|
-
return log(`${skipped ? "skipped" : "crawling"} ${p}`), skipped;
|
|
1610
|
-
} : excludePredicate,
|
|
1611
|
-
fs: options.fs,
|
|
1612
|
-
pathSeparator: "/",
|
|
1613
|
-
relativePaths: !absolute,
|
|
1614
|
-
resolvePaths: absolute,
|
|
1615
|
-
includeBasePath: absolute,
|
|
1616
|
-
resolveSymlinks: followSymbolicLinks,
|
|
1617
|
-
excludeSymlinks: !followSymbolicLinks,
|
|
1618
|
-
excludeFiles: onlyDirectories,
|
|
1619
|
-
includeDirs: onlyDirectories || !options.onlyFiles,
|
|
1620
|
-
maxDepth,
|
|
1621
|
-
signal: options.signal
|
|
1622
|
-
}).crawl(root);
|
|
1623
|
-
return options.debug && log("internal properties:", {
|
|
1624
|
-
...props,
|
|
1625
|
-
root
|
|
1626
|
-
}), [
|
|
1627
|
-
crawler,
|
|
1628
|
-
cwd !== root && !absolute && buildRelative(cwd, root)
|
|
1629
|
-
];
|
|
1630
|
-
}
|
|
1631
|
-
function formatPaths(paths, mapper) {
|
|
1632
|
-
if (mapper) for(let i = paths.length - 1; i >= 0; i--)paths[i] = mapper(paths[i]);
|
|
1633
|
-
return paths;
|
|
1634
|
-
}
|
|
1635
|
-
let defaultOptions = {
|
|
1636
|
-
caseSensitiveMatch: !0,
|
|
1637
|
-
debug: !!process.env.TINYGLOBBY_DEBUG,
|
|
1638
|
-
expandDirectories: !0,
|
|
1639
|
-
followSymbolicLinks: !0,
|
|
1640
|
-
onlyFiles: !0
|
|
1641
|
-
};
|
|
1642
|
-
function getOptions(options) {
|
|
1643
|
-
let opts = Object.assign({}, options);
|
|
1644
|
-
for(let key in defaultOptions)void 0 === opts[key] && Object.assign(opts, {
|
|
1645
|
-
[key]: defaultOptions[key]
|
|
1646
|
-
});
|
|
1647
|
-
return opts.cwd = (opts.cwd instanceof URL ? fileURLToPath(opts.cwd) : resolve(opts.cwd || process.cwd())).replace(BACKSLASHES, "/"), opts.ignore = ensureStringArray(opts.ignore), opts.fs && (opts.fs = {
|
|
1648
|
-
readdir: opts.fs.readdir || readdir,
|
|
1649
|
-
readdirSync: opts.fs.readdirSync || readdirSync,
|
|
1650
|
-
realpath: opts.fs.realpath || realpath,
|
|
1651
|
-
realpathSync: opts.fs.realpathSync || realpathSync,
|
|
1652
|
-
stat: opts.fs.stat || external_fs_stat,
|
|
1653
|
-
statSync: opts.fs.statSync || statSync
|
|
1654
|
-
}), opts.debug && log("globbing with options:", opts), opts;
|
|
1655
|
-
}
|
|
1656
|
-
function getCrawler(globInput, inputOptions = {}) {
|
|
1657
|
-
var _ref;
|
|
1658
|
-
if (globInput && (null == inputOptions ? void 0 : inputOptions.patterns)) throw Error("Cannot pass patterns as both an argument and an option");
|
|
1659
|
-
let isModern = isReadonlyArray(globInput) || "string" == typeof globInput, patterns = ensureStringArray(null != (_ref = isModern ? globInput : globInput.patterns) ? _ref : "**/*"), options = getOptions(isModern ? inputOptions : globInput);
|
|
1660
|
-
return patterns.length > 0 ? buildCrawler(options, patterns) : [];
|
|
1661
|
-
}
|
|
1662
|
-
async function glob(globInput, options) {
|
|
1663
|
-
let [crawler, relative] = getCrawler(globInput, options);
|
|
1664
|
-
return crawler ? formatPaths(await crawler.withPromise(), relative) : [];
|
|
1665
|
-
}
|
|
1666
|
-
function globSync(globInput, options) {
|
|
1667
|
-
let [crawler, relative] = getCrawler(globInput, options);
|
|
1668
|
-
return crawler ? formatPaths(crawler.sync(), relative) : [];
|
|
1669
|
-
}
|
|
1670
|
-
export { glob, globSync };
|
|
1
|
+
import*as t from"fs";import{readdir as e,readdirSync as o,realpath as n,realpathSync as s,stat as i,statSync as r}from"fs";import{basename as u,dirname as l,isAbsolute as a,normalize as p,posix as c,relative as h,resolve as f,sep as g}from"path";import{fileURLToPath as d}from"url";import{createRequire as m}from"module";import{__webpack_require__ as y}from"./rslib-runtime.js";y.add({"../../node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/index.js"(t,e,o){let n=o("../../node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/lib/picomatch.js"),s=o("../../node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/lib/utils.js");function i(t,e,o=!1){return e&&(null===e.windows||void 0===e.windows)&&(e={...e,windows:s.isWindows()}),n(t,e,o)}Object.assign(i,n),t.exports=i},"../../node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/lib/constants.js"(t){let e="[^\\\\/]",o="[^/]",n="(?:\\/|$)",s="(?:^|\\/)",i=`\\.{1,2}${n}`,r=`(?!${s}${i})`,u=`(?!\\.{0,1}${n})`,l=`(?!${i})`,a=`${o}*?`,p={DOT_LITERAL:"\\.",PLUS_LITERAL:"\\+",QMARK_LITERAL:"\\?",SLASH_LITERAL:"\\/",ONE_CHAR:"(?=.)",QMARK:o,END_ANCHOR:n,DOTS_SLASH:i,NO_DOT:"(?!\\.)",NO_DOTS:r,NO_DOT_SLASH:u,NO_DOTS_SLASH:l,QMARK_NO_DOT:"[^.\\/]",STAR:a,START_ANCHOR:s,SEP:"/"},c={...p,SLASH_LITERAL:"[\\\\/]",QMARK:e,STAR:`${e}*?`,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={DEFAULT_MAX_EXTGLOB_RECURSION:0,MAX_LENGTH:65536,POSIX_REGEX_SOURCE:{__proto__:null,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:t=>({"!":{type:"negate",open:"(?:(?!(?:",close:`))${t.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}),globChars:t=>!0===t?c:p}},"../../node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/lib/parse.js"(t,e,o){let n=o("../../node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/lib/constants.js"),s=o("../../node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/lib/utils.js"),{MAX_LENGTH:i,POSIX_REGEX_SOURCE:r,REGEX_NON_SPECIAL_CHARS:u,REGEX_SPECIAL_CHARS_BACKREF:l,REPLACEMENTS:a}=n,p=(t,e)=>{if("function"==typeof e.expandRange)return e.expandRange(...t,e);t.sort();let o=`[${t.join("-")}]`;try{new RegExp(o)}catch(e){return t.map(t=>s.escapeRegex(t)).join("..")}return o},c=(t,e)=>`Missing ${t}: "${e}" - use "\\\\${e}" to match literal characters`,h=t=>{let e=[],o=0,n=0,s=0,i="",r=!1;for(let u of t){if(!0===r){i+=u,r=!1;continue}if("\\"===u){i+=u,r=!0;continue}if('"'===u){s=+(1!==s),i+=u;continue}if(0===s){if("["===u)o++;else if("]"===u&&o>0)o--;else if(0===o){if("("===u)n++;else if(")"===u&&n>0)n--;else if("|"===u&&0===n){e.push(i),i="";continue}}}i+=u}return e.push(i),e},f=t=>{let e=t.trim(),o=!0;for(;!0===o;)o=!1,/^@\([^\\()[\]{}|]+\)$/.test(e)&&(e=e.slice(2,-1),o=!0);if((t=>{let e=!1;for(let o of t){if(!0===e){e=!1;continue}if("\\"===o){e=!0;continue}if(/[?*+@!()[\]{}]/.test(o))return!1}return!0})(e))return e.replace(/\\(.)/g,"$1")},g=(t,e=!0)=>{if("+"!==t[0]&&"*"!==t[0]||"("!==t[1])return;let o=0,n=0,s=0,i=!1;for(let r=1;r<t.length;r++){let u=t[r];if(!0===i){i=!1;continue}if("\\"===u){i=!0;continue}if('"'===u){s=+(1!==s);continue}if(1!==s){if("["===u){o++;continue}if("]"===u&&o>0){o--;continue}if(!(o>0)){if("("===u){n++;continue}if(")"===u&&0==--n){if(!0===e&&r!==t.length-1)return;return{type:t[0],body:t.slice(2,r),end:r}}}}}},d=t=>{let e=0,o=[];for(;e<t.length;){let n=g(t.slice(e),!1);if(!n||"*"!==n.type)return;let s=h(n.body).map(t=>t.trim());if(1!==s.length)return;let i=f(s[0]);if(!i||1!==i.length)return;o.push(i),e+=n.end+1}if(o.length<1)return;let n=1===o.length?s.escapeRegex(o[0]):`[${o.map(t=>s.escapeRegex(t)).join("")}]`;return`${n}*`},m=t=>{let e=0,o=t.trim(),n=g(o);for(;n;)e++,n=g(o=n.body.trim());return e},y=(t,e)=>{let o;if("string"!=typeof t)throw TypeError("Expected a string");t=a[t]||t;let g={...e},b="number"==typeof g.maxLength?Math.min(i,g.maxLength):i,_=t.length;if(_>b)throw SyntaxError(`Input length: ${_}, exceeds maximum allowed length: ${b}`);let x={type:"bos",value:"",output:g.prepend||""},A=[x],R=g.capture?"":"?:",$=n.globChars(g.windows),E=n.extglobChars($),{DOT_LITERAL:v,PLUS_LITERAL:k,SLASH_LITERAL:S,ONE_CHAR:C,DOTS_SLASH:w,NO_DOT:H,NO_DOT_SLASH:L,NO_DOTS_SLASH:O,QMARK:T,QMARK_NO_DOT:P,STAR:D,START_ANCHOR:I}=$,B=t=>`(${R}(?:(?!${I}${t.dot?w:v}).)*?)`,F=g.dot?"":H,N=g.dot?T:P,M=!0===g.bash?B(g):D;g.capture&&(M=`(${M})`),"boolean"==typeof g.noext&&(g.noextglob=g.noext);let j={input:t,index:-1,start:0,dot:!0===g.dot,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:A};_=(t=s.removePrefix(t,j)).length;let G=[],U=[],q=[],W=x,K=()=>j.index===_-1,Q=j.peek=(e=1)=>t[j.index+e],X=j.advance=()=>t[++j.index]||"",z=()=>t.slice(j.index+1),Z=(t="",e=0)=>{j.consumed+=t,j.index+=e},Y=t=>{j.output+=null!=t.output?t.output:t.value,Z(t.value)},V=()=>{let t=1;for(;"!"===Q()&&("("!==Q(2)||"?"===Q(3));)X(),j.start++,t++;return t%2!=0&&(j.negated=!0,j.start++,!0)},J=t=>{j[t]++,q.push(t)},tt=t=>{j[t]--,q.pop()},te=t=>{if("globstar"===W.type){let e=j.braces>0&&("comma"===t.type||"brace"===t.type),o=!0===t.extglob||G.length&&("pipe"===t.type||"paren"===t.type);"slash"===t.type||"paren"===t.type||e||o||(j.output=j.output.slice(0,-W.output.length),W.type="star",W.value="*",W.output=M,j.output+=W.output)}if(G.length&&"paren"!==t.type&&(G[G.length-1].inner+=t.value),(t.value||t.output)&&Y(t),W&&"text"===W.type&&"text"===t.type){W.output=(W.output||W.value)+t.value,W.value+=t.value;return}t.prev=W,A.push(t),W=t},to=(t,e)=>{let o={...E[e],conditions:1,inner:""};o.prev=W,o.parens=j.parens,o.output=j.output,o.startIndex=j.index,o.tokensIndex=A.length;let n=(g.capture?"(":"")+o.open;J("parens"),te({type:t,value:e,output:j.output?"":C}),te({type:"paren",extglob:!0,value:X(),output:n}),G.push(o)},tn=i=>{let r,u=t.slice(i.startIndex,j.index+1),l=((t,e)=>{if(!1===e.maxExtglobRecursion)return{risky:!1};let o="number"==typeof e.maxExtglobRecursion?e.maxExtglobRecursion:n.DEFAULT_MAX_EXTGLOB_RECURSION,s=h(t).map(t=>t.trim());if(s.length>1&&(s.some(t=>""===t)||s.some(t=>/^[*?]+$/.test(t))||(t=>{let e=t.map(f).filter(Boolean);for(let t=0;t<e.length;t++)for(let o=t+1;o<e.length;o++){let n=e[t],s=e[o],i=n[0];if(i&&n===i.repeat(n.length)&&s===i.repeat(s.length)&&(n===s||n.startsWith(s)||s.startsWith(n)))return!0}return!1})(s)))return{risky:!0};for(let t of s){let e=d(t);if(e)return{risky:!0,safeOutput:e};if(m(t)>o)return{risky:!0}}return{risky:!1}})(t.slice(i.startIndex+2,j.index),g);if(("plus"===i.type||"star"===i.type)&&l.risky){let t=l.safeOutput?(i.output?"":C)+(g.capture?`(${l.safeOutput})`:l.safeOutput):void 0,e=A[i.tokensIndex];e.type="text",e.value=u,e.output=t||s.escapeRegex(u);for(let t=i.tokensIndex+1;t<A.length;t++)A[t].value="",A[t].output="",delete A[t].suffix;j.output=i.output+e.output,j.backtrack=!0,te({type:"paren",extglob:!0,value:o,output:""}),tt("parens");return}let a=i.close+(g.capture?")":"");if("negate"===i.type){let t=M;if(i.inner&&i.inner.length>1&&i.inner.includes("/")&&(t=B(g)),(t!==M||K()||/^\)+$/.test(z()))&&(a=i.close=`)$))${t}`),i.inner.includes("*")&&(r=z())&&/^\.[^\\/.]+$/.test(r)){let o=y(r,{...e,fastpaths:!1}).output;a=i.close=`)${o})${t})`}"bos"===i.prev.type&&(j.negatedExtglob=!0)}te({type:"paren",extglob:!0,value:o,output:a}),tt("parens")};if(!1!==g.fastpaths&&!/(^[*!]|[/()[\]{}"])/.test(t)){let o=!1,n=t.replace(l,(t,e,n,s,i,r)=>"\\"===s?(o=!0,t):"?"===s?e?e+s+(i?T.repeat(i.length):""):0===r?N+(i?T.repeat(i.length):""):T.repeat(n.length):"."===s?v.repeat(n.length):"*"===s?e?e+s+(i?M:""):M:e?t:`\\${t}`);return(!0===o&&(n=!0===g.unescape?n.replace(/\\/g,""):n.replace(/\\+/g,t=>t.length%2==0?"\\\\":t?"\\":"")),n===t&&!0===g.contains)?j.output=t:j.output=s.wrapOutput(n,j,e),j}for(;!K();){if("\0"===(o=X()))continue;if("\\"===o){let t=Q();if("/"===t&&!0!==g.bash||"."===t||";"===t)continue;if(!t){te({type:"text",value:o+="\\"});continue}let e=/^\\+/.exec(z()),n=0;if(e&&e[0].length>2&&(n=e[0].length,j.index+=n,n%2!=0&&(o+="\\")),!0===g.unescape?o=X():o+=X(),0===j.brackets){te({type:"text",value:o});continue}}if(j.brackets>0&&("]"!==o||"["===W.value||"[^"===W.value)){if(!1!==g.posix&&":"===o){let t=W.value.slice(1);if(t.includes("[")&&(W.posix=!0,t.includes(":"))){let t=W.value.lastIndexOf("["),e=W.value.slice(0,t),o=r[W.value.slice(t+2)];if(o){W.value=e+o,j.backtrack=!0,X(),x.output||1!==A.indexOf(W)||(x.output=C);continue}}}("["===o&&":"!==Q()||"-"===o&&"]"===Q())&&(o=`\\${o}`),"]"===o&&("["===W.value||"[^"===W.value)&&(o=`\\${o}`),!0===g.posix&&"!"===o&&"["===W.value&&(o="^"),W.value+=o,Y({value:o});continue}if(1===j.quotes&&'"'!==o){o=s.escapeRegex(o),W.value+=o,Y({value:o});continue}if('"'===o){j.quotes=+(1!==j.quotes),!0===g.keepQuotes&&te({type:"text",value:o});continue}if("("===o){J("parens"),te({type:"paren",value:o});continue}if(")"===o){if(0===j.parens&&!0===g.strictBrackets)throw SyntaxError(c("opening","("));let t=G[G.length-1];if(t&&j.parens===t.parens+1){tn(G.pop());continue}te({type:"paren",value:o,output:j.parens?")":"\\)"}),tt("parens");continue}if("["===o){if(!0!==g.nobracket&&z().includes("]"))J("brackets");else{if(!0!==g.nobracket&&!0===g.strictBrackets)throw SyntaxError(c("closing","]"));o=`\\${o}`}te({type:"bracket",value:o});continue}if("]"===o){if(!0===g.nobracket||W&&"bracket"===W.type&&1===W.value.length){te({type:"text",value:o,output:`\\${o}`});continue}if(0===j.brackets){if(!0===g.strictBrackets)throw SyntaxError(c("opening","["));te({type:"text",value:o,output:`\\${o}`});continue}tt("brackets");let t=W.value.slice(1);if(!0===W.posix||"^"!==t[0]||t.includes("/")||(o=`/${o}`),W.value+=o,Y({value:o}),!1===g.literalBrackets||s.hasRegexChars(t))continue;let e=s.escapeRegex(W.value);if(j.output=j.output.slice(0,-W.value.length),!0===g.literalBrackets){j.output+=e,W.value=e;continue}W.value=`(${R}${e}|${W.value})`,j.output+=W.value;continue}if("{"===o&&!0!==g.nobrace){J("braces");let t={type:"brace",value:o,output:"(",outputIndex:j.output.length,tokensIndex:j.tokens.length};U.push(t),te(t);continue}if("}"===o){let t=U[U.length-1];if(!0===g.nobrace||!t){te({type:"text",value:o,output:o});continue}let e=")";if(!0===t.dots){let t=A.slice(),o=[];for(let e=t.length-1;e>=0&&(A.pop(),"brace"!==t[e].type);e--)"dots"!==t[e].type&&o.unshift(t[e].value);e=p(o,g),j.backtrack=!0}if(!0!==t.comma&&!0!==t.dots){let n=j.output.slice(0,t.outputIndex),s=j.tokens.slice(t.tokensIndex);for(let i of(t.value=t.output="\\{",o=e="\\}",j.output=n,s))j.output+=i.output||i.value}te({type:"brace",value:o,output:e}),tt("braces"),U.pop();continue}if("|"===o){G.length>0&&G[G.length-1].conditions++,te({type:"text",value:o});continue}if(","===o){let t=o,e=U[U.length-1];e&&"braces"===q[q.length-1]&&(e.comma=!0,t="|"),te({type:"comma",value:o,output:t});continue}if("/"===o){if("dot"===W.type&&j.index===j.start+1){j.start=j.index+1,j.consumed="",j.output="",A.pop(),W=x;continue}te({type:"slash",value:o,output:S});continue}if("."===o){if(j.braces>0&&"dot"===W.type){"."===W.value&&(W.output=v);let t=U[U.length-1];W.type="dots",W.output+=o,W.value+=o,t.dots=!0;continue}if(j.braces+j.parens===0&&"bos"!==W.type&&"slash"!==W.type){te({type:"text",value:o,output:v});continue}te({type:"dot",value:o,output:v});continue}if("?"===o){if(!(W&&"("===W.value)&&!0!==g.noextglob&&"("===Q()&&"?"!==Q(2)){to("qmark",o);continue}if(W&&"paren"===W.type){let t=Q(),e=o;("("!==W.value||/[!=<:]/.test(t))&&("<"!==t||/<([!=]|\w+>)/.test(z()))||(e=`\\${o}`),te({type:"text",value:o,output:e});continue}if(!0!==g.dot&&("slash"===W.type||"bos"===W.type)){te({type:"qmark",value:o,output:P});continue}te({type:"qmark",value:o,output:T});continue}if("!"===o){if(!0!==g.noextglob&&"("===Q()&&("?"!==Q(2)||!/[!=<:]/.test(Q(3)))){to("negate",o);continue}if(!0!==g.nonegate&&0===j.index){V();continue}}if("+"===o){if(!0!==g.noextglob&&"("===Q()&&"?"!==Q(2)){to("plus",o);continue}if(W&&"("===W.value||!1===g.regex){te({type:"plus",value:o,output:k});continue}if(W&&("bracket"===W.type||"paren"===W.type||"brace"===W.type)||j.parens>0){te({type:"plus",value:o});continue}te({type:"plus",value:k});continue}if("@"===o){if(!0!==g.noextglob&&"("===Q()&&"?"!==Q(2)){te({type:"at",extglob:!0,value:o,output:""});continue}te({type:"text",value:o});continue}if("*"!==o){("$"===o||"^"===o)&&(o=`\\${o}`);let t=u.exec(z());t&&(o+=t[0],j.index+=t[0].length),te({type:"text",value:o});continue}if(W&&("globstar"===W.type||!0===W.star)){W.type="star",W.star=!0,W.value+=o,W.output=M,j.backtrack=!0,j.globstar=!0,Z(o);continue}let e=z();if(!0!==g.noextglob&&/^\([^?]/.test(e)){to("star",o);continue}if("star"===W.type){if(!0===g.noglobstar){Z(o);continue}let n=W.prev,s=n.prev,i="slash"===n.type||"bos"===n.type,r=s&&("star"===s.type||"globstar"===s.type);if(!0===g.bash&&(!i||e[0]&&"/"!==e[0])){te({type:"star",value:o,output:""});continue}let u=j.braces>0&&("comma"===n.type||"brace"===n.type),l=G.length&&("pipe"===n.type||"paren"===n.type);if(!i&&"paren"!==n.type&&!u&&!l){te({type:"star",value:o,output:""});continue}for(;"/**"===e.slice(0,3);){let o=t[j.index+4];if(o&&"/"!==o)break;e=e.slice(3),Z("/**",3)}if("bos"===n.type&&K()){W.type="globstar",W.value+=o,W.output=B(g),j.output=W.output,j.globstar=!0,Z(o);continue}if("slash"===n.type&&"bos"!==n.prev.type&&!r&&K()){j.output=j.output.slice(0,-(n.output+W.output).length),n.output=`(?:${n.output}`,W.type="globstar",W.output=B(g)+(g.strictSlashes?")":"|$)"),W.value+=o,j.globstar=!0,j.output+=n.output+W.output,Z(o);continue}if("slash"===n.type&&"bos"!==n.prev.type&&"/"===e[0]){let t=void 0!==e[1]?"|$":"";j.output=j.output.slice(0,-(n.output+W.output).length),n.output=`(?:${n.output}`,W.type="globstar",W.output=`${B(g)}${S}|${S}${t})`,W.value+=o,j.output+=n.output+W.output,j.globstar=!0,Z(o+X()),te({type:"slash",value:"/",output:""});continue}if("bos"===n.type&&"/"===e[0]){W.type="globstar",W.value+=o,W.output=`(?:^|${S}|${B(g)}${S})`,j.output=W.output,j.globstar=!0,Z(o+X()),te({type:"slash",value:"/",output:""});continue}j.output=j.output.slice(0,-W.output.length),W.type="globstar",W.output=B(g),W.value+=o,j.output+=W.output,j.globstar=!0,Z(o);continue}let n={type:"star",value:o,output:M};if(!0===g.bash){n.output=".*?",("bos"===W.type||"slash"===W.type)&&(n.output=F+n.output),te(n);continue}if(W&&("bracket"===W.type||"paren"===W.type)&&!0===g.regex){n.output=o,te(n);continue}(j.index===j.start||"slash"===W.type||"dot"===W.type)&&("dot"===W.type?(j.output+=L,W.output+=L):!0===g.dot?(j.output+=O,W.output+=O):(j.output+=F,W.output+=F),"*"!==Q()&&(j.output+=C,W.output+=C)),te(n)}for(;j.brackets>0;){if(!0===g.strictBrackets)throw SyntaxError(c("closing","]"));j.output=s.escapeLast(j.output,"["),tt("brackets")}for(;j.parens>0;){if(!0===g.strictBrackets)throw SyntaxError(c("closing",")"));j.output=s.escapeLast(j.output,"("),tt("parens")}for(;j.braces>0;){if(!0===g.strictBrackets)throw SyntaxError(c("closing","}"));j.output=s.escapeLast(j.output,"{"),tt("braces")}if(!0!==g.strictSlashes&&("star"===W.type||"bracket"===W.type)&&te({type:"maybe_slash",value:"",output:`${S}?`}),!0===j.backtrack)for(let t of(j.output="",j.tokens))j.output+=null!=t.output?t.output:t.value,t.suffix&&(j.output+=t.suffix);return j};y.fastpaths=(t,e)=>{let o={...e},r="number"==typeof o.maxLength?Math.min(i,o.maxLength):i,u=t.length;if(u>r)throw SyntaxError(`Input length: ${u}, exceeds maximum allowed length: ${r}`);t=a[t]||t;let{DOT_LITERAL:l,SLASH_LITERAL:p,ONE_CHAR:c,DOTS_SLASH:h,NO_DOT:f,NO_DOTS:g,NO_DOTS_SLASH:d,STAR:m,START_ANCHOR:y}=n.globChars(o.windows),b=o.dot?g:f,_=o.dot?d:f,x=o.capture?"":"?:",A=!0===o.bash?".*?":m;o.capture&&(A=`(${A})`);let R=t=>!0===t.noglobstar?A:`(${x}(?:(?!${y}${t.dot?h:l}).)*?)`,$=t=>{switch(t){case"*":return`${b}${c}${A}`;case".*":return`${l}${c}${A}`;case"*.*":return`${b}${A}${l}${c}${A}`;case"*/*":return`${b}${A}${p}${c}${_}${A}`;case"**":return b+R(o);case"**/*":return`(?:${b}${R(o)}${p})?${_}${c}${A}`;case"**/*.*":return`(?:${b}${R(o)}${p})?${_}${A}${l}${c}${A}`;case"**/.*":return`(?:${b}${R(o)}${p})?${l}${c}${A}`;default:{let e=/^(.*?)\.(\w+)$/.exec(t);if(!e)return;let o=$(e[1]);if(!o)return;return o+l+e[2]}}},E=$(s.removePrefix(t,{negated:!1,prefix:""}));return E&&!0!==o.strictSlashes&&(E+=`${p}?`),E},t.exports=y},"../../node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/lib/picomatch.js"(t,e,o){let n=o("../../node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/lib/scan.js"),s=o("../../node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/lib/parse.js"),i=o("../../node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/lib/utils.js"),r=o("../../node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/lib/constants.js"),u=(t,e,o=!1)=>{if(Array.isArray(t)){let n=t.map(t=>u(t,e,o));return t=>{for(let e of n){let o=e(t);if(o)return o}return!1}}let n=t&&"object"==typeof t&&!Array.isArray(t)&&t.tokens&&t.input;if(""===t||"string"!=typeof t&&!n)throw TypeError("Expected pattern to be a non-empty string");let s=e||{},i=s.windows,r=n?u.compileRe(t,e):u.makeRe(t,e,!1,!0),l=r.state;delete r.state;let a=()=>!1;if(s.ignore){let t={...e,ignore:null,onMatch:null,onResult:null};a=u(s.ignore,t,o)}let p=(o,n=!1)=>{let{isMatch:p,match:c,output:h}=u.test(o,r,e,{glob:t,posix:i}),f={glob:t,state:l,regex:r,posix:i,input:o,output:h,match:c,isMatch:p};return("function"==typeof s.onResult&&s.onResult(f),!1===p)?(f.isMatch=!1,!!n&&f):a(o)?("function"==typeof s.onIgnore&&s.onIgnore(f),f.isMatch=!1,!!n&&f):("function"==typeof s.onMatch&&s.onMatch(f),!n||f)};return o&&(p.state=l),p};u.test=(t,e,o,{glob:n,posix:s}={})=>{if("string"!=typeof t)throw TypeError("Expected input to be a string");if(""===t)return{isMatch:!1,output:""};let r=o||{},l=r.format||(s?i.toPosixSlashes:null),a=t===n,p=a&&l?l(t):t;return!1===a&&(a=(p=l?l(t):t)===n),(!1===a||!0===r.capture)&&(a=!0===r.matchBase||!0===r.basename?u.matchBase(t,e,o,s):e.exec(p)),{isMatch:!!a,match:a,output:p}},u.matchBase=(t,e,o)=>(e instanceof RegExp?e:u.makeRe(e,o)).test(i.basename(t)),u.isMatch=(t,e,o)=>u(e,o)(t),u.parse=(t,e)=>Array.isArray(t)?t.map(t=>u.parse(t,e)):s(t,{...e,fastpaths:!1}),u.scan=(t,e)=>n(t,e),u.compileRe=(t,e,o=!1,n=!1)=>{if(!0===o)return t.output;let s=e||{},i=s.contains?"":"^",r=s.contains?"":"$",l=`${i}(?:${t.output})${r}`;t&&!0===t.negated&&(l=`^(?!${l}).*$`);let a=u.toRegex(l,e);return!0===n&&(a.state=t),a},u.makeRe=(t,e={},o=!1,n=!1)=>{if(!t||"string"!=typeof t)throw TypeError("Expected a non-empty string");let i={negated:!1,fastpaths:!0};return!1!==e.fastpaths&&("."===t[0]||"*"===t[0])&&(i.output=s.fastpaths(t,e)),i.output||(i=s(t,e)),u.compileRe(i,e,o,n)},u.toRegex=(t,e)=>{try{let o=e||{};return new RegExp(t,o.flags||(o.nocase?"i":""))}catch(t){if(e&&!0===e.debug)throw t;return/$^/}},u.constants=r,t.exports=u},"../../node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/lib/scan.js"(t,e,o){let n=o("../../node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/lib/utils.js"),{CHAR_ASTERISK:s,CHAR_AT:i,CHAR_BACKWARD_SLASH:r,CHAR_COMMA:u,CHAR_DOT:l,CHAR_EXCLAMATION_MARK:a,CHAR_FORWARD_SLASH:p,CHAR_LEFT_CURLY_BRACE:c,CHAR_LEFT_PARENTHESES:h,CHAR_LEFT_SQUARE_BRACKET:f,CHAR_PLUS:g,CHAR_QUESTION_MARK:d,CHAR_RIGHT_CURLY_BRACE:m,CHAR_RIGHT_PARENTHESES:y,CHAR_RIGHT_SQUARE_BRACKET:b}=o("../../node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/lib/constants.js"),_=t=>t===p||t===r,x=t=>{!0!==t.isPrefix&&(t.depth=t.isGlobstar?1/0:1)};t.exports=(t,e)=>{let o,A,R=e||{},$=t.length-1,E=!0===R.parts||!0===R.scanToEnd,v=[],k=[],S=[],C=t,w=-1,H=0,L=0,O=!1,T=!1,P=!1,D=!1,I=!1,B=!1,F=!1,N=!1,M=!1,j=!1,G=0,U={value:"",depth:0,isGlob:!1},q=()=>w>=$,W=()=>C.charCodeAt(w+1),K=()=>(o=A,C.charCodeAt(++w));for(;w<$;){let t;if((A=K())===r){F=U.backslashes=!0,(A=K())===c&&(B=!0);continue}if(!0===B||A===c){for(G++;!0!==q()&&(A=K());){if(A===r){F=U.backslashes=!0,K();continue}if(A===c){G++;continue}if(!0!==B&&A===l&&(A=K())===l||!0!==B&&A===u){if(O=U.isBrace=!0,P=U.isGlob=!0,j=!0,!0===E)continue;break}if(A===m&&0==--G){B=!1,O=U.isBrace=!0,j=!0;break}}if(!0===E)continue;break}if(A===p){if(v.push(w),k.push(U),U={value:"",depth:0,isGlob:!1},!0===j)continue;if(o===l&&w===H+1){H+=2;continue}L=w+1;continue}if(!0!==R.noext&&!0==(A===g||A===i||A===s||A===d||A===a)&&W()===h){if(P=U.isGlob=!0,D=U.isExtglob=!0,j=!0,A===a&&w===H&&(M=!0),!0===E){for(;!0!==q()&&(A=K());){if(A===r){F=U.backslashes=!0,A=K();continue}if(A===y){P=U.isGlob=!0,j=!0;break}}continue}break}if(A===s){if(o===s&&(I=U.isGlobstar=!0),P=U.isGlob=!0,j=!0,!0===E)continue;break}if(A===d){if(P=U.isGlob=!0,j=!0,!0===E)continue;break}if(A===f){for(;!0!==q()&&(t=K());){if(t===r){F=U.backslashes=!0,K();continue}if(t===b){T=U.isBracket=!0,P=U.isGlob=!0,j=!0;break}}if(!0===E)continue;break}if(!0!==R.nonegate&&A===a&&w===H){N=U.negated=!0,H++;continue}if(!0!==R.noparen&&A===h){if(P=U.isGlob=!0,!0===E){for(;!0!==q()&&(A=K());){if(A===h){F=U.backslashes=!0,A=K();continue}if(A===y){j=!0;break}}continue}break}if(!0===P){if(j=!0,!0===E)continue;break}}!0===R.noext&&(D=!1,P=!1);let Q=C,X="",z="";H>0&&(X=C.slice(0,H),C=C.slice(H),L-=H),Q&&!0===P&&L>0?(Q=C.slice(0,L),z=C.slice(L)):!0===P?(Q="",z=C):Q=C,Q&&""!==Q&&"/"!==Q&&Q!==C&&_(Q.charCodeAt(Q.length-1))&&(Q=Q.slice(0,-1)),!0===R.unescape&&(z&&(z=n.removeBackslashes(z)),Q&&!0===F&&(Q=n.removeBackslashes(Q)));let Z={prefix:X,input:t,start:H,base:Q,glob:z,isBrace:O,isBracket:T,isGlob:P,isExtglob:D,isGlobstar:I,negated:N,negatedExtglob:M};if(!0===R.tokens&&(Z.maxDepth=0,_(A)||k.push(U),Z.tokens=k),!0===R.parts||!0===R.tokens){let e;for(let o=0;o<v.length;o++){let n=e?e+1:H,s=v[o],i=t.slice(n,s);R.tokens&&(0===o&&0!==H?(k[o].isPrefix=!0,k[o].value=X):k[o].value=i,x(k[o]),Z.maxDepth+=k[o].depth),(0!==o||""!==i)&&S.push(i),e=s}if(e&&e+1<t.length){let o=t.slice(e+1);S.push(o),R.tokens&&(k[k.length-1].value=o,x(k[k.length-1]),Z.maxDepth+=k[k.length-1].depth)}Z.slashes=v,Z.parts=S}return Z}},"../../node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/lib/utils.js"(t,e,o){let{REGEX_BACKSLASH:n,REGEX_REMOVE_BACKSLASH:s,REGEX_SPECIAL_CHARS:i,REGEX_SPECIAL_CHARS_GLOBAL:r}=o("../../node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/lib/constants.js");e.isObject=t=>null!==t&&"object"==typeof t&&!Array.isArray(t),e.hasRegexChars=t=>i.test(t),e.isRegexChar=t=>1===t.length&&e.hasRegexChars(t),e.escapeRegex=t=>t.replace(r,"\\$1"),e.toPosixSlashes=t=>t.replace(n,"/"),e.isWindows=()=>{if("u">typeof navigator&&navigator.platform){let t=navigator.platform.toLowerCase();return"win32"===t||"windows"===t}return"u">typeof process&&!!process.platform&&"win32"===process.platform},e.removeBackslashes=t=>t.replace(s,t=>"\\"===t?"":t),e.escapeLast=(t,o,n)=>{let s=t.lastIndexOf(o,n);return -1===s?t:"\\"===t[s-1]?e.escapeLast(t,o,s-1):`${t.slice(0,s)}\\${t.slice(s)}`},e.removePrefix=(t,e={})=>{let o=t;return o.startsWith("./")&&(o=o.slice(2),e.prefix="./"),o},e.wrapOutput=(t,e={},o={})=>{let n=o.contains?"":"^",s=o.contains?"":"$",i=`${n}(?:${t})${s}`;return!0===e.negated&&(i=`(?:^(?!${i}).*$)`),i},e.basename=(t,{windows:e}={})=>{let o=t.split(e?/[\\/]/:"/"),n=o[o.length-1];return""===n?o[o.length-2]:n}}});var b=m(import.meta.url);let _=/[\\/]/g;function x(t,e){return t.replace(_,e)}let A=/^[a-z]:[\\/]$/i;function R(t,e){let o,{resolvePaths:n,normalizePath:s,pathSeparator:i}=e,r="win32"===process.platform&&t.includes("/")||t.startsWith(".");return n&&(t=f(t)),((s||r)&&((o=p(t)).length>1&&o[o.length-1]===g&&(o=o.substring(0,o.length-1)),t=o),"."===t)?"":x(t[t.length-1]!==i?t+i:t,i)}function $(t,e){return e+t}function E(t){return t}let v=(t,e)=>{e.push(t||".")},k=(t,e,o)=>{let n=t||".";o.every(t=>t(n,!0))&&e.push(n)},S=()=>{},C=(t,e,o,n)=>{n.every(e=>e(t,!1))&&o.files++},w=(t,e,o,n)=>{n.every(e=>e(t,!1))&&e.push(t)},H=(t,e,o,n)=>{o.files++},L=(t,e)=>{e.push(t)},O=()=>{},T=t=>t,P=()=>[""].slice(0,0),D=(t,e,o)=>{t.push({directory:e,files:o,dir:e})},I=()=>{},B=function(t,e,o){let{queue:n,fs:s,options:{suppressErrors:i}}=e;n.enqueue(),s.realpath(t,(r,u)=>{if(r)return n.dequeue(i?null:r,e);s.stat(u,(s,r)=>s?n.dequeue(i?null:s,e):r.isDirectory()&&N(t,u,e)?n.dequeue(null,e):void(o(r,u),n.dequeue(null,e)))})},F=function(t,e,o){let{queue:n,fs:s,options:{suppressErrors:i}}=e;n.enqueue();try{let n=s.realpathSync(t),i=s.statSync(n);if(i.isDirectory()&&N(t,n,e))return;o(i,n)}catch(t){if(!i)throw t}};function N(t,e,o){if(o.options.useRealPaths){var n,s;return n=e,(s=o).visited.includes(n+s.options.pathSeparator)}let i=l(t),r=1;for(;i!==o.root&&r<2;){let t=o.symlinks.get(i);t&&(t===e||t.startsWith(e)||e.startsWith(t))?r++:i=l(i)}return o.symlinks.set(t,e),r>1}let M=t=>t.counts,j=t=>t.groups,G=t=>t.paths,U=t=>t.paths.slice(0,t.options.maxFiles),q=(t,e,o)=>(X(e,o,t.counts,t.options.suppressErrors),null),W=(t,e,o)=>(X(e,o,t.paths,t.options.suppressErrors),null),K=(t,e,o)=>(X(e,o,t.paths.slice(0,t.options.maxFiles),t.options.suppressErrors),null),Q=(t,e,o)=>(X(e,o,t.groups,t.options.suppressErrors),null);function X(t,e,o,n){e(t&&!n?t:null,o)}let z={withFileTypes:!0},Z=(t,e,o,n,s)=>{if(t.queue.enqueue(),n<0)return t.queue.dequeue(null,t);let{fs:i}=t;t.visited.push(e),t.counts.directories++,i.readdir(e||".",z,(e,i=[])=>{s(i,o,n),t.queue.dequeue(t.options.suppressErrors?null:e,t)})},Y=(t,e,o,n,s)=>{let{fs:i}=t;if(n<0)return;t.visited.push(e),t.counts.directories++;let r=[];try{r=i.readdirSync(e||".",z)}catch(e){if(!t.options.suppressErrors)throw e}s(r,o,n)};var V=class{count=0;constructor(t){this.onQueueEmpty=t}enqueue(){return this.count++,this.count}dequeue(t,e){this.onQueueEmpty&&(--this.count<=0||t)&&(this.onQueueEmpty(t,e),t&&(e.controller.abort(),this.onQueueEmpty=void 0))}},J=class{_files=0;_directories=0;set files(t){this._files=t}get files(){return this._files}set directories(t){this._directories=t}get directories(){return this._directories}get dirs(){return this._directories}},tt=class{aborted=!1;abort(){this.aborted=!0}},te=class{root;isSynchronous;state;joinPath;pushDirectory;pushFile;getArray;groupFiles;resolveSymlink;walkDirectory;callbackInvoker;constructor(e,o,n){var s,i;this.isSynchronous=!n,this.callbackInvoker=function(t,e){let{onlyCounts:o,group:n,maxFiles:s}=t;return o?e?M:q:n?e?j:Q:s?e?U:K:e?G:W}(o,this.isSynchronous),this.root=R(e,o),this.state={root:"/"===(s=this.root)||A.test(s)?this.root:this.root.slice(0,-1),paths:[""].slice(0,0),groups:[],counts:new J,options:o,queue:new V((t,e)=>this.callbackInvoker(e,t,n)),symlinks:new Map,visited:[""].slice(0,0),controller:new tt,fs:o.fs||t},this.joinPath=function(t,e){let{relativePaths:o,includeBasePath:n}=e;return o&&t?function(o,n){return n.startsWith(t)?n.slice(t.length)+o:x(h(t,n),e.pathSeparator)+e.pathSeparator+o}:n?$:E}(this.root,o),this.pushDirectory=function(t,e){let{includeDirs:o,filters:n,relativePaths:s}=e;if(!o)return S;if(s)return n&&n.length?function(e,o,n){let s=e.substring(t.length)||".";n.every(t=>t(s,!0))&&o.push(s)}:function(e,o){o.push(e.substring(t.length)||".")};return n&&n.length?k:v}(this.root,o),this.pushFile=function(t){let{excludeFiles:e,filters:o,onlyCounts:n}=t;return e?O:o&&o.length?n?C:w:n?H:L}(o),this.getArray=o.group?P:T,this.groupFiles=o.group?D:I,this.resolveSymlink=(i=this.isSynchronous,!o.resolveSymlinks||o.excludeSymlinks?null:i?F:B),this.walkDirectory=this.isSynchronous?Y:Z}start(){return this.pushDirectory(this.root,this.state.paths,this.state.options.filters),this.walkDirectory(this.state,this.root,this.root,this.state.options.maxDepth,this.walk),this.isSynchronous?this.callbackInvoker(this.state,null):null}walk=(t,e,o)=>{let{paths:n,options:{filters:s,resolveSymlinks:i,excludeSymlinks:r,exclude:a,maxFiles:p,signal:c,useRealPaths:h,pathSeparator:f},controller:g}=this.state;if(g.aborted||c&&c.aborted||p&&n.length>p)return;let d=this.getArray(this.state.paths);for(let p=0;p<t.length;++p){let c=t[p];if(c.isFile()||c.isSymbolicLink()&&!i&&!r){let t=this.joinPath(c.name,e);this.pushFile(t,d,this.state.counts,s)}else if(c.isDirectory()){let t=e+c.name+this.state.options.pathSeparator;if(a&&a(c.name,t))continue;this.pushDirectory(t,n,s),this.walkDirectory(this.state,t,t,o-1,this.walk)}else if(this.resolveSymlink&&c.isSymbolicLink()){let t=e+c.name;this.resolveSymlink(t,this.state,(e,n)=>{if(e.isDirectory())n=R(n,this.state.options),a&&a(c.name,h?n:t+f)||this.walkDirectory(this.state,n,h?n:t+f,o-1,this.walk);else{let e=u(n=h?n:t),o=R(l(n),this.state.options);n=this.joinPath(e,o),this.pushFile(n,d,this.state.counts,s)}})}}this.groupFiles(this.state.groups,e,d)}};function to(t,e,o){new te(t,e,o).start()}var tn=class{constructor(t,e){this.root=t,this.options=e}withPromise(){var t,e;return t=this.root,e=this.options,new Promise((o,n)=>{to(t,e,(t,e)=>{if(t)return n(t);o(e)})})}withCallback(t){to(this.root,this.options,t)}sync(){return new te(this.root,this.options).start()}};let ts=null;try{b.resolve("picomatch"),ts=b("picomatch")}catch{}var ti=class{globCache={};options={maxDepth:1/0,suppressErrors:!0,pathSeparator:g,filters:[]};globFunction;constructor(t){this.options={...this.options,...t},this.globFunction=this.options.globFunction}group(){return this.options.group=!0,this}withPathSeparator(t){return this.options.pathSeparator=t,this}withBasePath(){return this.options.includeBasePath=!0,this}withRelativePaths(){return this.options.relativePaths=!0,this}withDirs(){return this.options.includeDirs=!0,this}withMaxDepth(t){return this.options.maxDepth=t,this}withMaxFiles(t){return this.options.maxFiles=t,this}withFullPaths(){return this.options.resolvePaths=!0,this.options.includeBasePath=!0,this}withErrors(){return this.options.suppressErrors=!1,this}withSymlinks({resolvePaths:t=!0}={}){return this.options.resolveSymlinks=!0,this.options.useRealPaths=t,this.withFullPaths()}withAbortSignal(t){return this.options.signal=t,this}normalize(){return this.options.normalizePath=!0,this}filter(t){return this.options.filters.push(t),this}onlyDirs(){return this.options.excludeFiles=!0,this.options.includeDirs=!0,this}exclude(t){return this.options.exclude=t,this}onlyCounts(){return this.options.onlyCounts=!0,this}crawl(t){return new tn(t||".",this.options)}withGlobFunction(t){return this.globFunction=t,this}crawlWithOptions(t,e){return this.options={...this.options,...e},new tn(t||".",this.options)}glob(...t){return this.globFunction?this.globWithOptions(t):this.globWithOptions(t,{dot:!0})}globWithOptions(t,...e){let o=this.globFunction||ts;if(!o)throw Error("Please specify a glob function to use glob matching.");var n=this.globCache[t.join("\0")];return n||(n=o(t,...e),this.globCache[t.join("\0")]=n),this.options.filters.push(t=>n(t)),this}};let tr=y("../../node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/index.js"),tu=Array.isArray,tl=/\\/g,ta=/^[A-Za-z]:$/,tp="win32"===process.platform,tc=/^(\/?\.\.)+$/,th=/^[A-Z]:\/$/i,tf=tp?t=>th.test(t):t=>"/"===t;function tg(t,e,o){if(t===e||e.startsWith(`${t}/`)){if(o){let e=t.length+ +!tf(t);return(t,o)=>t.slice(e,o?-1:void 0)||"."}let n=e.slice(t.length+1);return n?(t,e)=>{if("."===t)return n;let o=`${n}/${t}`;return e?o.slice(0,-1):o}:(t,e)=>e&&"."!==t?t.slice(0,-1):t}return o?e=>c.relative(t,e)||".":o=>c.relative(t,`${e}/${o}`)||"."}function td(t){return t.replace(ta,t=>`${t}/`)}let tm={parts:!0};function ty(t){var e;let o=tr.scan(t,tm);return(null==(e=o.parts)?void 0:e.length)?o.parts:[t]}let tb=/(?<!\\)([()[\]{}*?|]|^!|[!+@](?=\()|\\(?![()[\]{}!*+?@|]))/g,t_=/(?<!\\)([()[\]{}]|^!|[!+@](?=\())/g,tx=tp?t=>t.replace(t_,"\\$&"):t=>t.replace(tb,"\\$&");function tA(...t){console.log(`[tinyglobby ${new Date().toLocaleTimeString("es")}]`,...t)}function tR(t){return"string"==typeof t?[t]:null!=t?t:[]}let t$=/^(\/?\.\.)+/,tE=/\\(?=[()[\]{}!*+?@|])/g;function tv(t,e,o,n){var s;let i=e.cwd,r=t;"/"===t[t.length-1]&&(r=t.slice(0,-1)),"*"!==r[r.length-1]&&e.expandDirectories&&(r+="/**");let u=tx(i);r=a(r.replace(tE,""))?c.relative(u,r):c.normalize(r);let l=null==(s=t$.exec(r))?void 0:s[0],p=ty(r);if(l){let t=(l.length+1)/3,e=0,n=u.split("/");for(;e<t&&p[e+t]===n[n.length+e-t];)r=r.slice(0,(t-e-1)*3)+r.slice((t-e)*3+p[e+t].length+1)||".",e++;let s=c.join(i,l.slice(3*e));"."!==s[0]&&o.root.length>s.length&&(o.root=td(s),o.depthOffset=-t+e)}if(!n&&o.depthOffset>=0){null!=o.commonPath||(o.commonPath=p);let t=[],e=Math.min(o.commonPath.length,p.length);for(let n=0;n<e;n++){let e=p[n];if("**"===e&&!p[n+1]){t.pop();break}if(n===p.length-1||e!==o.commonPath[n]||function(t){let e=tr.scan(t);return e.isGlob||e.negated}(e))break;t.push(e)}o.depthOffset=t.length,o.commonPath=t,o.root=td(t.length>0?c.join(i,...t):i)}return r}function tk(t,e){if(e)for(let o=t.length-1;o>=0;o--)t[o]=e(t[o]);return t}let tS={caseSensitiveMatch:!0,debug:!!process.env.TINYGLOBBY_DEBUG,expandDirectories:!0,followSymbolicLinks:!0,onlyFiles:!0};function tC(t,u={}){var l;if(t&&(null==u?void 0:u.patterns))throw Error("Cannot pass patterns as both an argument and an option");let a=tu(t)||"string"==typeof t,p=tR(null!=(l=a?t:t.patterns)?l:"**/*"),h=function(t){let u=Object.assign({},t);for(let t in tS)void 0===u[t]&&Object.assign(u,{[t]:tS[t]});return u.cwd=(u.cwd instanceof URL?d(u.cwd):f(u.cwd||process.cwd())).replace(tl,"/"),u.ignore=tR(u.ignore),u.fs&&(u.fs={readdir:u.fs.readdir||e,readdirSync:u.fs.readdirSync||o,realpath:u.fs.realpath||n,realpathSync:u.fs.realpathSync||s,stat:u.fs.stat||i,statSync:u.fs.statSync||r}),u.debug&&tA("globbing with options:",u),u}(a?u:t);return p.length>0?function(t,e){let o,n=t.cwd,s={root:n,depthOffset:0},i=function(t,e,o){let n=[],s=[];for(let e of t.ignore)e&&("!"!==e[0]||"("===e[1])&&s.push(tv(e,t,o,!0));for(let i of e)i&&("!"!==i[0]||"("===i[1]?n.push(tv(i,t,o,!1)):("!"!==i[1]||"("===i[2])&&s.push(tv(i.slice(1),t,o,!0)));return{match:n,ignore:s}}(t,e,s);t.debug&&tA("internal processing patterns:",i);let{absolute:r,caseSensitiveMatch:u,debug:l,dot:a,followSymbolicLinks:p,onlyDirectories:h}=t,f=s.root.replace(tl,""),g={dot:a,nobrace:!1===t.braceExpansion,nocase:!u,noextglob:!1===t.extglob,noglobstar:!1===t.globstar,posix:!0},d=tr(i.match,g),m=tr(i.ignore,g),y=function(t,e={}){let o,n,s=t.length,i=Array(s),r=Array(s);for(o=0;o<s;o++){let s=ty(t[o]);i[o]=s;let u=s.length,l=Array(u);for(n=0;n<u;n++)l[n]=tr(s[n],e);r[o]=l}return t=>{let u=t.split("/");if(".."===u[0]&&tc.test(t))return!0;for(o=0;o<s;o++){let t=i[o],s=r[o],l=u.length,a=Math.min(l,t.length);for(n=0;n<a;){let o=t[n];if(o.includes("/"))return!0;if(!s[n](u[n]))break;if(!e.noglobstar&&"**"===o)return!0;n++}if(n===l)return!0}return!1}}(i.match,g),b=tg(n,f,r),_=r?b:tg(n,f,!0),x=(t,e)=>{let o=_(e,!0);return"."!==o&&!y(o)||m(o)};void 0!==t.deep&&(o=Math.round(t.deep-s.depthOffset));let A=new ti({filters:[l?(t,e)=>{let o=b(t,e),n=d(o)&&!m(o);return n&&tA(`matched ${o}`),n}:(t,e)=>{let o=b(t,e);return d(o)&&!m(o)}],exclude:l?(t,e)=>{let o=x(t,e);return tA(`${o?"skipped":"crawling"} ${e}`),o}:x,fs:t.fs,pathSeparator:"/",relativePaths:!r,resolvePaths:r,includeBasePath:r,resolveSymlinks:p,excludeSymlinks:!p,excludeFiles:h,includeDirs:h||!t.onlyFiles,maxDepth:o,signal:t.signal}).crawl(f);return t.debug&&tA("internal properties:",{...s,root:f}),[A,n!==f&&!r&&function(t,e){if(e.startsWith(`${t}/`)){let o=e.slice(t.length+1);return t=>`${o}/${t}`}return o=>{let n=c.relative(t,`${e}/${o}`);return"/"===o[o.length-1]&&""!==n?`${n}/`:n||"."}}(n,f)]}(h,p):[]}async function tw(t,e){let[o,n]=tC(t,e);return o?tk(await o.withPromise(),n):[]}function tH(t,e){let[o,n]=tC(t,e);return o?tk(o.sync(),n):[]}export{tw as glob,tH as globSync};
|