create-expo 5.1.6 → 5.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/build/{810.index.js → 393.index.js} +3428 -27
- package/build/536.index.js +11 -10
- package/build/Template.d.ts +1 -1
- package/build/index.js +3 -3
- package/package.json +5 -6
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
exports.id =
|
|
2
|
-
exports.ids = [
|
|
1
|
+
exports.id = 393;
|
|
2
|
+
exports.ids = [393];
|
|
3
3
|
exports.modules = {
|
|
4
4
|
|
|
5
5
|
/***/ 2671:
|
|
@@ -4971,6 +4971,2516 @@ exports.wrapOutput = (input, state = {}, options = {}) => {
|
|
|
4971
4971
|
};
|
|
4972
4972
|
|
|
4973
4973
|
|
|
4974
|
+
/***/ }),
|
|
4975
|
+
|
|
4976
|
+
/***/ 9528:
|
|
4977
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
4978
|
+
|
|
4979
|
+
"use strict";
|
|
4980
|
+
|
|
4981
|
+
|
|
4982
|
+
const pico = __webpack_require__(1890);
|
|
4983
|
+
const utils = __webpack_require__(4717);
|
|
4984
|
+
|
|
4985
|
+
function picomatch(glob, options, returnState = false) {
|
|
4986
|
+
// default to os.platform()
|
|
4987
|
+
if (options && (options.windows === null || options.windows === undefined)) {
|
|
4988
|
+
// don't mutate the original options object
|
|
4989
|
+
options = { ...options, windows: utils.isWindows() };
|
|
4990
|
+
}
|
|
4991
|
+
|
|
4992
|
+
return pico(glob, options, returnState);
|
|
4993
|
+
}
|
|
4994
|
+
|
|
4995
|
+
Object.assign(picomatch, pico);
|
|
4996
|
+
module.exports = picomatch;
|
|
4997
|
+
|
|
4998
|
+
|
|
4999
|
+
/***/ }),
|
|
5000
|
+
|
|
5001
|
+
/***/ 553:
|
|
5002
|
+
/***/ ((module) => {
|
|
5003
|
+
|
|
5004
|
+
"use strict";
|
|
5005
|
+
|
|
5006
|
+
|
|
5007
|
+
const WIN_SLASH = '\\\\/';
|
|
5008
|
+
const WIN_NO_SLASH = `[^${WIN_SLASH}]`;
|
|
5009
|
+
|
|
5010
|
+
const DEFAULT_MAX_EXTGLOB_RECURSION = 0;
|
|
5011
|
+
|
|
5012
|
+
/**
|
|
5013
|
+
* Posix glob regex
|
|
5014
|
+
*/
|
|
5015
|
+
|
|
5016
|
+
const DOT_LITERAL = '\\.';
|
|
5017
|
+
const PLUS_LITERAL = '\\+';
|
|
5018
|
+
const QMARK_LITERAL = '\\?';
|
|
5019
|
+
const SLASH_LITERAL = '\\/';
|
|
5020
|
+
const ONE_CHAR = '(?=.)';
|
|
5021
|
+
const QMARK = '[^/]';
|
|
5022
|
+
const END_ANCHOR = `(?:${SLASH_LITERAL}|$)`;
|
|
5023
|
+
const START_ANCHOR = `(?:^|${SLASH_LITERAL})`;
|
|
5024
|
+
const DOTS_SLASH = `${DOT_LITERAL}{1,2}${END_ANCHOR}`;
|
|
5025
|
+
const NO_DOT = `(?!${DOT_LITERAL})`;
|
|
5026
|
+
const NO_DOTS = `(?!${START_ANCHOR}${DOTS_SLASH})`;
|
|
5027
|
+
const NO_DOT_SLASH = `(?!${DOT_LITERAL}{0,1}${END_ANCHOR})`;
|
|
5028
|
+
const NO_DOTS_SLASH = `(?!${DOTS_SLASH})`;
|
|
5029
|
+
const QMARK_NO_DOT = `[^.${SLASH_LITERAL}]`;
|
|
5030
|
+
const STAR = `${QMARK}*?`;
|
|
5031
|
+
const SEP = '/';
|
|
5032
|
+
|
|
5033
|
+
const POSIX_CHARS = {
|
|
5034
|
+
DOT_LITERAL,
|
|
5035
|
+
PLUS_LITERAL,
|
|
5036
|
+
QMARK_LITERAL,
|
|
5037
|
+
SLASH_LITERAL,
|
|
5038
|
+
ONE_CHAR,
|
|
5039
|
+
QMARK,
|
|
5040
|
+
END_ANCHOR,
|
|
5041
|
+
DOTS_SLASH,
|
|
5042
|
+
NO_DOT,
|
|
5043
|
+
NO_DOTS,
|
|
5044
|
+
NO_DOT_SLASH,
|
|
5045
|
+
NO_DOTS_SLASH,
|
|
5046
|
+
QMARK_NO_DOT,
|
|
5047
|
+
STAR,
|
|
5048
|
+
START_ANCHOR,
|
|
5049
|
+
SEP
|
|
5050
|
+
};
|
|
5051
|
+
|
|
5052
|
+
/**
|
|
5053
|
+
* Windows glob regex
|
|
5054
|
+
*/
|
|
5055
|
+
|
|
5056
|
+
const WINDOWS_CHARS = {
|
|
5057
|
+
...POSIX_CHARS,
|
|
5058
|
+
|
|
5059
|
+
SLASH_LITERAL: `[${WIN_SLASH}]`,
|
|
5060
|
+
QMARK: WIN_NO_SLASH,
|
|
5061
|
+
STAR: `${WIN_NO_SLASH}*?`,
|
|
5062
|
+
DOTS_SLASH: `${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$)`,
|
|
5063
|
+
NO_DOT: `(?!${DOT_LITERAL})`,
|
|
5064
|
+
NO_DOTS: `(?!(?:^|[${WIN_SLASH}])${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,
|
|
5065
|
+
NO_DOT_SLASH: `(?!${DOT_LITERAL}{0,1}(?:[${WIN_SLASH}]|$))`,
|
|
5066
|
+
NO_DOTS_SLASH: `(?!${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,
|
|
5067
|
+
QMARK_NO_DOT: `[^.${WIN_SLASH}]`,
|
|
5068
|
+
START_ANCHOR: `(?:^|[${WIN_SLASH}])`,
|
|
5069
|
+
END_ANCHOR: `(?:[${WIN_SLASH}]|$)`,
|
|
5070
|
+
SEP: '\\'
|
|
5071
|
+
};
|
|
5072
|
+
|
|
5073
|
+
/**
|
|
5074
|
+
* POSIX Bracket Regex
|
|
5075
|
+
*/
|
|
5076
|
+
|
|
5077
|
+
const POSIX_REGEX_SOURCE = {
|
|
5078
|
+
__proto__: null,
|
|
5079
|
+
alnum: 'a-zA-Z0-9',
|
|
5080
|
+
alpha: 'a-zA-Z',
|
|
5081
|
+
ascii: '\\x00-\\x7F',
|
|
5082
|
+
blank: ' \\t',
|
|
5083
|
+
cntrl: '\\x00-\\x1F\\x7F',
|
|
5084
|
+
digit: '0-9',
|
|
5085
|
+
graph: '\\x21-\\x7E',
|
|
5086
|
+
lower: 'a-z',
|
|
5087
|
+
print: '\\x20-\\x7E ',
|
|
5088
|
+
punct: '\\-!"#$%&\'()\\*+,./:;<=>?@[\\]^_`{|}~',
|
|
5089
|
+
space: ' \\t\\r\\n\\v\\f',
|
|
5090
|
+
upper: 'A-Z',
|
|
5091
|
+
word: 'A-Za-z0-9_',
|
|
5092
|
+
xdigit: 'A-Fa-f0-9'
|
|
5093
|
+
};
|
|
5094
|
+
|
|
5095
|
+
module.exports = {
|
|
5096
|
+
DEFAULT_MAX_EXTGLOB_RECURSION,
|
|
5097
|
+
MAX_LENGTH: 1024 * 64,
|
|
5098
|
+
POSIX_REGEX_SOURCE,
|
|
5099
|
+
|
|
5100
|
+
// regular expressions
|
|
5101
|
+
REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g,
|
|
5102
|
+
REGEX_NON_SPECIAL_CHARS: /^[^@![\].,$*+?^{}()|\\/]+/,
|
|
5103
|
+
REGEX_SPECIAL_CHARS: /[-*+?.^${}(|)[\]]/,
|
|
5104
|
+
REGEX_SPECIAL_CHARS_BACKREF: /(\\?)((\W)(\3*))/g,
|
|
5105
|
+
REGEX_SPECIAL_CHARS_GLOBAL: /([-*+?.^${}(|)[\]])/g,
|
|
5106
|
+
REGEX_REMOVE_BACKSLASH: /(?:\[.*?[^\\]\]|\\(?=.))/g,
|
|
5107
|
+
|
|
5108
|
+
// Replace globs with equivalent patterns to reduce parsing time.
|
|
5109
|
+
REPLACEMENTS: {
|
|
5110
|
+
__proto__: null,
|
|
5111
|
+
'***': '*',
|
|
5112
|
+
'**/**': '**',
|
|
5113
|
+
'**/**/**': '**'
|
|
5114
|
+
},
|
|
5115
|
+
|
|
5116
|
+
// Digits
|
|
5117
|
+
CHAR_0: 48, /* 0 */
|
|
5118
|
+
CHAR_9: 57, /* 9 */
|
|
5119
|
+
|
|
5120
|
+
// Alphabet chars.
|
|
5121
|
+
CHAR_UPPERCASE_A: 65, /* A */
|
|
5122
|
+
CHAR_LOWERCASE_A: 97, /* a */
|
|
5123
|
+
CHAR_UPPERCASE_Z: 90, /* Z */
|
|
5124
|
+
CHAR_LOWERCASE_Z: 122, /* z */
|
|
5125
|
+
|
|
5126
|
+
CHAR_LEFT_PARENTHESES: 40, /* ( */
|
|
5127
|
+
CHAR_RIGHT_PARENTHESES: 41, /* ) */
|
|
5128
|
+
|
|
5129
|
+
CHAR_ASTERISK: 42, /* * */
|
|
5130
|
+
|
|
5131
|
+
// Non-alphabetic chars.
|
|
5132
|
+
CHAR_AMPERSAND: 38, /* & */
|
|
5133
|
+
CHAR_AT: 64, /* @ */
|
|
5134
|
+
CHAR_BACKWARD_SLASH: 92, /* \ */
|
|
5135
|
+
CHAR_CARRIAGE_RETURN: 13, /* \r */
|
|
5136
|
+
CHAR_CIRCUMFLEX_ACCENT: 94, /* ^ */
|
|
5137
|
+
CHAR_COLON: 58, /* : */
|
|
5138
|
+
CHAR_COMMA: 44, /* , */
|
|
5139
|
+
CHAR_DOT: 46, /* . */
|
|
5140
|
+
CHAR_DOUBLE_QUOTE: 34, /* " */
|
|
5141
|
+
CHAR_EQUAL: 61, /* = */
|
|
5142
|
+
CHAR_EXCLAMATION_MARK: 33, /* ! */
|
|
5143
|
+
CHAR_FORM_FEED: 12, /* \f */
|
|
5144
|
+
CHAR_FORWARD_SLASH: 47, /* / */
|
|
5145
|
+
CHAR_GRAVE_ACCENT: 96, /* ` */
|
|
5146
|
+
CHAR_HASH: 35, /* # */
|
|
5147
|
+
CHAR_HYPHEN_MINUS: 45, /* - */
|
|
5148
|
+
CHAR_LEFT_ANGLE_BRACKET: 60, /* < */
|
|
5149
|
+
CHAR_LEFT_CURLY_BRACE: 123, /* { */
|
|
5150
|
+
CHAR_LEFT_SQUARE_BRACKET: 91, /* [ */
|
|
5151
|
+
CHAR_LINE_FEED: 10, /* \n */
|
|
5152
|
+
CHAR_NO_BREAK_SPACE: 160, /* \u00A0 */
|
|
5153
|
+
CHAR_PERCENT: 37, /* % */
|
|
5154
|
+
CHAR_PLUS: 43, /* + */
|
|
5155
|
+
CHAR_QUESTION_MARK: 63, /* ? */
|
|
5156
|
+
CHAR_RIGHT_ANGLE_BRACKET: 62, /* > */
|
|
5157
|
+
CHAR_RIGHT_CURLY_BRACE: 125, /* } */
|
|
5158
|
+
CHAR_RIGHT_SQUARE_BRACKET: 93, /* ] */
|
|
5159
|
+
CHAR_SEMICOLON: 59, /* ; */
|
|
5160
|
+
CHAR_SINGLE_QUOTE: 39, /* ' */
|
|
5161
|
+
CHAR_SPACE: 32, /* */
|
|
5162
|
+
CHAR_TAB: 9, /* \t */
|
|
5163
|
+
CHAR_UNDERSCORE: 95, /* _ */
|
|
5164
|
+
CHAR_VERTICAL_LINE: 124, /* | */
|
|
5165
|
+
CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279, /* \uFEFF */
|
|
5166
|
+
|
|
5167
|
+
/**
|
|
5168
|
+
* Create EXTGLOB_CHARS
|
|
5169
|
+
*/
|
|
5170
|
+
|
|
5171
|
+
extglobChars(chars) {
|
|
5172
|
+
return {
|
|
5173
|
+
'!': { type: 'negate', open: '(?:(?!(?:', close: `))${chars.STAR})` },
|
|
5174
|
+
'?': { type: 'qmark', open: '(?:', close: ')?' },
|
|
5175
|
+
'+': { type: 'plus', open: '(?:', close: ')+' },
|
|
5176
|
+
'*': { type: 'star', open: '(?:', close: ')*' },
|
|
5177
|
+
'@': { type: 'at', open: '(?:', close: ')' }
|
|
5178
|
+
};
|
|
5179
|
+
},
|
|
5180
|
+
|
|
5181
|
+
/**
|
|
5182
|
+
* Create GLOB_CHARS
|
|
5183
|
+
*/
|
|
5184
|
+
|
|
5185
|
+
globChars(win32) {
|
|
5186
|
+
return win32 === true ? WINDOWS_CHARS : POSIX_CHARS;
|
|
5187
|
+
}
|
|
5188
|
+
};
|
|
5189
|
+
|
|
5190
|
+
|
|
5191
|
+
/***/ }),
|
|
5192
|
+
|
|
5193
|
+
/***/ 5767:
|
|
5194
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
5195
|
+
|
|
5196
|
+
"use strict";
|
|
5197
|
+
|
|
5198
|
+
|
|
5199
|
+
const constants = __webpack_require__(553);
|
|
5200
|
+
const utils = __webpack_require__(4717);
|
|
5201
|
+
|
|
5202
|
+
/**
|
|
5203
|
+
* Constants
|
|
5204
|
+
*/
|
|
5205
|
+
|
|
5206
|
+
const {
|
|
5207
|
+
MAX_LENGTH,
|
|
5208
|
+
POSIX_REGEX_SOURCE,
|
|
5209
|
+
REGEX_NON_SPECIAL_CHARS,
|
|
5210
|
+
REGEX_SPECIAL_CHARS_BACKREF,
|
|
5211
|
+
REPLACEMENTS
|
|
5212
|
+
} = constants;
|
|
5213
|
+
|
|
5214
|
+
/**
|
|
5215
|
+
* Helpers
|
|
5216
|
+
*/
|
|
5217
|
+
|
|
5218
|
+
const expandRange = (args, options) => {
|
|
5219
|
+
if (typeof options.expandRange === 'function') {
|
|
5220
|
+
return options.expandRange(...args, options);
|
|
5221
|
+
}
|
|
5222
|
+
|
|
5223
|
+
args.sort();
|
|
5224
|
+
const value = `[${args.join('-')}]`;
|
|
5225
|
+
|
|
5226
|
+
try {
|
|
5227
|
+
/* eslint-disable-next-line no-new */
|
|
5228
|
+
new RegExp(value);
|
|
5229
|
+
} catch (ex) {
|
|
5230
|
+
return args.map(v => utils.escapeRegex(v)).join('..');
|
|
5231
|
+
}
|
|
5232
|
+
|
|
5233
|
+
return value;
|
|
5234
|
+
};
|
|
5235
|
+
|
|
5236
|
+
/**
|
|
5237
|
+
* Create the message for a syntax error
|
|
5238
|
+
*/
|
|
5239
|
+
|
|
5240
|
+
const syntaxError = (type, char) => {
|
|
5241
|
+
return `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`;
|
|
5242
|
+
};
|
|
5243
|
+
|
|
5244
|
+
const splitTopLevel = input => {
|
|
5245
|
+
const parts = [];
|
|
5246
|
+
let bracket = 0;
|
|
5247
|
+
let paren = 0;
|
|
5248
|
+
let quote = 0;
|
|
5249
|
+
let value = '';
|
|
5250
|
+
let escaped = false;
|
|
5251
|
+
|
|
5252
|
+
for (const ch of input) {
|
|
5253
|
+
if (escaped === true) {
|
|
5254
|
+
value += ch;
|
|
5255
|
+
escaped = false;
|
|
5256
|
+
continue;
|
|
5257
|
+
}
|
|
5258
|
+
|
|
5259
|
+
if (ch === '\\') {
|
|
5260
|
+
value += ch;
|
|
5261
|
+
escaped = true;
|
|
5262
|
+
continue;
|
|
5263
|
+
}
|
|
5264
|
+
|
|
5265
|
+
if (ch === '"') {
|
|
5266
|
+
quote = quote === 1 ? 0 : 1;
|
|
5267
|
+
value += ch;
|
|
5268
|
+
continue;
|
|
5269
|
+
}
|
|
5270
|
+
|
|
5271
|
+
if (quote === 0) {
|
|
5272
|
+
if (ch === '[') {
|
|
5273
|
+
bracket++;
|
|
5274
|
+
} else if (ch === ']' && bracket > 0) {
|
|
5275
|
+
bracket--;
|
|
5276
|
+
} else if (bracket === 0) {
|
|
5277
|
+
if (ch === '(') {
|
|
5278
|
+
paren++;
|
|
5279
|
+
} else if (ch === ')' && paren > 0) {
|
|
5280
|
+
paren--;
|
|
5281
|
+
} else if (ch === '|' && paren === 0) {
|
|
5282
|
+
parts.push(value);
|
|
5283
|
+
value = '';
|
|
5284
|
+
continue;
|
|
5285
|
+
}
|
|
5286
|
+
}
|
|
5287
|
+
}
|
|
5288
|
+
|
|
5289
|
+
value += ch;
|
|
5290
|
+
}
|
|
5291
|
+
|
|
5292
|
+
parts.push(value);
|
|
5293
|
+
return parts;
|
|
5294
|
+
};
|
|
5295
|
+
|
|
5296
|
+
const isPlainBranch = branch => {
|
|
5297
|
+
let escaped = false;
|
|
5298
|
+
|
|
5299
|
+
for (const ch of branch) {
|
|
5300
|
+
if (escaped === true) {
|
|
5301
|
+
escaped = false;
|
|
5302
|
+
continue;
|
|
5303
|
+
}
|
|
5304
|
+
|
|
5305
|
+
if (ch === '\\') {
|
|
5306
|
+
escaped = true;
|
|
5307
|
+
continue;
|
|
5308
|
+
}
|
|
5309
|
+
|
|
5310
|
+
if (/[?*+@!()[\]{}]/.test(ch)) {
|
|
5311
|
+
return false;
|
|
5312
|
+
}
|
|
5313
|
+
}
|
|
5314
|
+
|
|
5315
|
+
return true;
|
|
5316
|
+
};
|
|
5317
|
+
|
|
5318
|
+
const normalizeSimpleBranch = branch => {
|
|
5319
|
+
let value = branch.trim();
|
|
5320
|
+
let changed = true;
|
|
5321
|
+
|
|
5322
|
+
while (changed === true) {
|
|
5323
|
+
changed = false;
|
|
5324
|
+
|
|
5325
|
+
if (/^@\([^\\()[\]{}|]+\)$/.test(value)) {
|
|
5326
|
+
value = value.slice(2, -1);
|
|
5327
|
+
changed = true;
|
|
5328
|
+
}
|
|
5329
|
+
}
|
|
5330
|
+
|
|
5331
|
+
if (!isPlainBranch(value)) {
|
|
5332
|
+
return;
|
|
5333
|
+
}
|
|
5334
|
+
|
|
5335
|
+
return value.replace(/\\(.)/g, '$1');
|
|
5336
|
+
};
|
|
5337
|
+
|
|
5338
|
+
const hasRepeatedCharPrefixOverlap = branches => {
|
|
5339
|
+
const values = branches.map(normalizeSimpleBranch).filter(Boolean);
|
|
5340
|
+
|
|
5341
|
+
for (let i = 0; i < values.length; i++) {
|
|
5342
|
+
for (let j = i + 1; j < values.length; j++) {
|
|
5343
|
+
const a = values[i];
|
|
5344
|
+
const b = values[j];
|
|
5345
|
+
const char = a[0];
|
|
5346
|
+
|
|
5347
|
+
if (!char || a !== char.repeat(a.length) || b !== char.repeat(b.length)) {
|
|
5348
|
+
continue;
|
|
5349
|
+
}
|
|
5350
|
+
|
|
5351
|
+
if (a === b || a.startsWith(b) || b.startsWith(a)) {
|
|
5352
|
+
return true;
|
|
5353
|
+
}
|
|
5354
|
+
}
|
|
5355
|
+
}
|
|
5356
|
+
|
|
5357
|
+
return false;
|
|
5358
|
+
};
|
|
5359
|
+
|
|
5360
|
+
const parseRepeatedExtglob = (pattern, requireEnd = true) => {
|
|
5361
|
+
if ((pattern[0] !== '+' && pattern[0] !== '*') || pattern[1] !== '(') {
|
|
5362
|
+
return;
|
|
5363
|
+
}
|
|
5364
|
+
|
|
5365
|
+
let bracket = 0;
|
|
5366
|
+
let paren = 0;
|
|
5367
|
+
let quote = 0;
|
|
5368
|
+
let escaped = false;
|
|
5369
|
+
|
|
5370
|
+
for (let i = 1; i < pattern.length; i++) {
|
|
5371
|
+
const ch = pattern[i];
|
|
5372
|
+
|
|
5373
|
+
if (escaped === true) {
|
|
5374
|
+
escaped = false;
|
|
5375
|
+
continue;
|
|
5376
|
+
}
|
|
5377
|
+
|
|
5378
|
+
if (ch === '\\') {
|
|
5379
|
+
escaped = true;
|
|
5380
|
+
continue;
|
|
5381
|
+
}
|
|
5382
|
+
|
|
5383
|
+
if (ch === '"') {
|
|
5384
|
+
quote = quote === 1 ? 0 : 1;
|
|
5385
|
+
continue;
|
|
5386
|
+
}
|
|
5387
|
+
|
|
5388
|
+
if (quote === 1) {
|
|
5389
|
+
continue;
|
|
5390
|
+
}
|
|
5391
|
+
|
|
5392
|
+
if (ch === '[') {
|
|
5393
|
+
bracket++;
|
|
5394
|
+
continue;
|
|
5395
|
+
}
|
|
5396
|
+
|
|
5397
|
+
if (ch === ']' && bracket > 0) {
|
|
5398
|
+
bracket--;
|
|
5399
|
+
continue;
|
|
5400
|
+
}
|
|
5401
|
+
|
|
5402
|
+
if (bracket > 0) {
|
|
5403
|
+
continue;
|
|
5404
|
+
}
|
|
5405
|
+
|
|
5406
|
+
if (ch === '(') {
|
|
5407
|
+
paren++;
|
|
5408
|
+
continue;
|
|
5409
|
+
}
|
|
5410
|
+
|
|
5411
|
+
if (ch === ')') {
|
|
5412
|
+
paren--;
|
|
5413
|
+
|
|
5414
|
+
if (paren === 0) {
|
|
5415
|
+
if (requireEnd === true && i !== pattern.length - 1) {
|
|
5416
|
+
return;
|
|
5417
|
+
}
|
|
5418
|
+
|
|
5419
|
+
return {
|
|
5420
|
+
type: pattern[0],
|
|
5421
|
+
body: pattern.slice(2, i),
|
|
5422
|
+
end: i
|
|
5423
|
+
};
|
|
5424
|
+
}
|
|
5425
|
+
}
|
|
5426
|
+
}
|
|
5427
|
+
};
|
|
5428
|
+
|
|
5429
|
+
const buildCharClassStar = chars => {
|
|
5430
|
+
const source = chars.length === 1
|
|
5431
|
+
? utils.escapeRegex(chars[0])
|
|
5432
|
+
: `[${chars.map(ch => utils.escapeRegex(ch)).join('')}]`;
|
|
5433
|
+
|
|
5434
|
+
return `${source}*`;
|
|
5435
|
+
};
|
|
5436
|
+
|
|
5437
|
+
const getStarExtglobSequenceChars = pattern => {
|
|
5438
|
+
let index = 0;
|
|
5439
|
+
const chars = [];
|
|
5440
|
+
|
|
5441
|
+
while (index < pattern.length) {
|
|
5442
|
+
const match = parseRepeatedExtglob(pattern.slice(index), false);
|
|
5443
|
+
|
|
5444
|
+
if (!match || match.type !== '*') {
|
|
5445
|
+
return;
|
|
5446
|
+
}
|
|
5447
|
+
|
|
5448
|
+
const branches = splitTopLevel(match.body).map(branch => branch.trim());
|
|
5449
|
+
if (branches.length !== 1) {
|
|
5450
|
+
return;
|
|
5451
|
+
}
|
|
5452
|
+
|
|
5453
|
+
const branch = normalizeSimpleBranch(branches[0]);
|
|
5454
|
+
if (!branch || branch.length !== 1) {
|
|
5455
|
+
return;
|
|
5456
|
+
}
|
|
5457
|
+
|
|
5458
|
+
chars.push(branch);
|
|
5459
|
+
index += match.end + 1;
|
|
5460
|
+
}
|
|
5461
|
+
|
|
5462
|
+
if (chars.length < 1) {
|
|
5463
|
+
return;
|
|
5464
|
+
}
|
|
5465
|
+
|
|
5466
|
+
return chars;
|
|
5467
|
+
};
|
|
5468
|
+
|
|
5469
|
+
const repeatedExtglobRecursion = pattern => {
|
|
5470
|
+
let depth = 0;
|
|
5471
|
+
let value = pattern.trim();
|
|
5472
|
+
let match = parseRepeatedExtglob(value);
|
|
5473
|
+
|
|
5474
|
+
while (match) {
|
|
5475
|
+
depth++;
|
|
5476
|
+
value = match.body.trim();
|
|
5477
|
+
match = parseRepeatedExtglob(value);
|
|
5478
|
+
}
|
|
5479
|
+
|
|
5480
|
+
return depth;
|
|
5481
|
+
};
|
|
5482
|
+
|
|
5483
|
+
const analyzeRepeatedExtglob = (body, options) => {
|
|
5484
|
+
if (options.maxExtglobRecursion === false) {
|
|
5485
|
+
return { risky: false };
|
|
5486
|
+
}
|
|
5487
|
+
|
|
5488
|
+
const max =
|
|
5489
|
+
typeof options.maxExtglobRecursion === 'number'
|
|
5490
|
+
? options.maxExtglobRecursion
|
|
5491
|
+
: constants.DEFAULT_MAX_EXTGLOB_RECURSION;
|
|
5492
|
+
|
|
5493
|
+
const branches = splitTopLevel(body).map(branch => branch.trim());
|
|
5494
|
+
|
|
5495
|
+
if (branches.length > 1) {
|
|
5496
|
+
if (
|
|
5497
|
+
branches.some(branch => branch === '') ||
|
|
5498
|
+
branches.some(branch => /^[*?]+$/.test(branch)) ||
|
|
5499
|
+
hasRepeatedCharPrefixOverlap(branches)
|
|
5500
|
+
) {
|
|
5501
|
+
return { risky: true };
|
|
5502
|
+
}
|
|
5503
|
+
}
|
|
5504
|
+
|
|
5505
|
+
// A repeated extglob is "risky" (prone to catastrophic backtracking) when a
|
|
5506
|
+
// branch is itself a `*(...)` sequence, since that nests an unbounded quantifier
|
|
5507
|
+
// inside the outer `+(...)`/`*(...)`. When *every* branch reduces to single
|
|
5508
|
+
// characters we can emit one flat, ReDoS-safe character class that preserves the
|
|
5509
|
+
// meaning of ALL branches (e.g. `+(*(a)|*(b))` -> `[ab]*`), rather than dropping
|
|
5510
|
+
// every branch but the first.
|
|
5511
|
+
const safeChars = [];
|
|
5512
|
+
let sawStarSequence = false;
|
|
5513
|
+
let combinable = true;
|
|
5514
|
+
|
|
5515
|
+
for (const branch of branches) {
|
|
5516
|
+
const chars = getStarExtglobSequenceChars(branch);
|
|
5517
|
+
if (chars) {
|
|
5518
|
+
sawStarSequence = true;
|
|
5519
|
+
safeChars.push(...chars);
|
|
5520
|
+
continue;
|
|
5521
|
+
}
|
|
5522
|
+
|
|
5523
|
+
const literal = normalizeSimpleBranch(branch);
|
|
5524
|
+
if (literal && literal.length === 1) {
|
|
5525
|
+
safeChars.push(literal);
|
|
5526
|
+
continue;
|
|
5527
|
+
}
|
|
5528
|
+
|
|
5529
|
+
combinable = false;
|
|
5530
|
+
|
|
5531
|
+
if (repeatedExtglobRecursion(branch) > max) {
|
|
5532
|
+
return { risky: true };
|
|
5533
|
+
}
|
|
5534
|
+
}
|
|
5535
|
+
|
|
5536
|
+
if (sawStarSequence) {
|
|
5537
|
+
return combinable
|
|
5538
|
+
? { risky: true, safeOutput: buildCharClassStar([...new Set(safeChars)]) }
|
|
5539
|
+
: { risky: true };
|
|
5540
|
+
}
|
|
5541
|
+
|
|
5542
|
+
return { risky: false };
|
|
5543
|
+
};
|
|
5544
|
+
|
|
5545
|
+
/**
|
|
5546
|
+
* Parse the given input string.
|
|
5547
|
+
* @param {String} input
|
|
5548
|
+
* @param {Object} options
|
|
5549
|
+
* @return {Object}
|
|
5550
|
+
*/
|
|
5551
|
+
|
|
5552
|
+
const parse = (input, options) => {
|
|
5553
|
+
if (typeof input !== 'string') {
|
|
5554
|
+
throw new TypeError('Expected a string');
|
|
5555
|
+
}
|
|
5556
|
+
|
|
5557
|
+
input = REPLACEMENTS[input] || input;
|
|
5558
|
+
|
|
5559
|
+
const opts = { ...options };
|
|
5560
|
+
const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
|
|
5561
|
+
|
|
5562
|
+
let len = input.length;
|
|
5563
|
+
if (len > max) {
|
|
5564
|
+
throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
|
|
5565
|
+
}
|
|
5566
|
+
|
|
5567
|
+
const bos = { type: 'bos', value: '', output: opts.prepend || '' };
|
|
5568
|
+
const tokens = [bos];
|
|
5569
|
+
|
|
5570
|
+
const capture = opts.capture ? '' : '?:';
|
|
5571
|
+
|
|
5572
|
+
// create constants based on platform, for windows or posix
|
|
5573
|
+
const PLATFORM_CHARS = constants.globChars(opts.windows);
|
|
5574
|
+
const EXTGLOB_CHARS = constants.extglobChars(PLATFORM_CHARS);
|
|
5575
|
+
|
|
5576
|
+
const {
|
|
5577
|
+
DOT_LITERAL,
|
|
5578
|
+
PLUS_LITERAL,
|
|
5579
|
+
SLASH_LITERAL,
|
|
5580
|
+
ONE_CHAR,
|
|
5581
|
+
DOTS_SLASH,
|
|
5582
|
+
NO_DOT,
|
|
5583
|
+
NO_DOT_SLASH,
|
|
5584
|
+
NO_DOTS_SLASH,
|
|
5585
|
+
QMARK,
|
|
5586
|
+
QMARK_NO_DOT,
|
|
5587
|
+
STAR,
|
|
5588
|
+
START_ANCHOR
|
|
5589
|
+
} = PLATFORM_CHARS;
|
|
5590
|
+
|
|
5591
|
+
const globstar = opts => {
|
|
5592
|
+
return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
|
|
5593
|
+
};
|
|
5594
|
+
|
|
5595
|
+
const nodot = opts.dot ? '' : NO_DOT;
|
|
5596
|
+
const qmarkNoDot = opts.dot ? QMARK : QMARK_NO_DOT;
|
|
5597
|
+
let star = opts.bash === true ? globstar(opts) : STAR;
|
|
5598
|
+
|
|
5599
|
+
if (opts.capture) {
|
|
5600
|
+
star = `(${star})`;
|
|
5601
|
+
}
|
|
5602
|
+
|
|
5603
|
+
// minimatch options support
|
|
5604
|
+
if (typeof opts.noext === 'boolean') {
|
|
5605
|
+
opts.noextglob = opts.noext;
|
|
5606
|
+
}
|
|
5607
|
+
|
|
5608
|
+
const state = {
|
|
5609
|
+
input,
|
|
5610
|
+
index: -1,
|
|
5611
|
+
start: 0,
|
|
5612
|
+
dot: opts.dot === true,
|
|
5613
|
+
consumed: '',
|
|
5614
|
+
output: '',
|
|
5615
|
+
prefix: '',
|
|
5616
|
+
backtrack: false,
|
|
5617
|
+
negated: false,
|
|
5618
|
+
brackets: 0,
|
|
5619
|
+
braces: 0,
|
|
5620
|
+
parens: 0,
|
|
5621
|
+
quotes: 0,
|
|
5622
|
+
globstar: false,
|
|
5623
|
+
tokens
|
|
5624
|
+
};
|
|
5625
|
+
|
|
5626
|
+
input = utils.removePrefix(input, state);
|
|
5627
|
+
len = input.length;
|
|
5628
|
+
|
|
5629
|
+
const extglobs = [];
|
|
5630
|
+
const braces = [];
|
|
5631
|
+
const stack = [];
|
|
5632
|
+
let prev = bos;
|
|
5633
|
+
let value;
|
|
5634
|
+
|
|
5635
|
+
/**
|
|
5636
|
+
* Tokenizing helpers
|
|
5637
|
+
*/
|
|
5638
|
+
|
|
5639
|
+
const eos = () => state.index === len - 1;
|
|
5640
|
+
const peek = state.peek = (n = 1) => input[state.index + n];
|
|
5641
|
+
const advance = state.advance = () => input[++state.index] || '';
|
|
5642
|
+
const remaining = () => input.slice(state.index + 1);
|
|
5643
|
+
const consume = (value = '', num = 0) => {
|
|
5644
|
+
state.consumed += value;
|
|
5645
|
+
state.index += num;
|
|
5646
|
+
};
|
|
5647
|
+
|
|
5648
|
+
const append = token => {
|
|
5649
|
+
state.output += token.output != null ? token.output : token.value;
|
|
5650
|
+
consume(token.value);
|
|
5651
|
+
};
|
|
5652
|
+
|
|
5653
|
+
const negate = () => {
|
|
5654
|
+
let count = 1;
|
|
5655
|
+
|
|
5656
|
+
while (peek() === '!' && (peek(2) !== '(' || peek(3) === '?')) {
|
|
5657
|
+
advance();
|
|
5658
|
+
state.start++;
|
|
5659
|
+
count++;
|
|
5660
|
+
}
|
|
5661
|
+
|
|
5662
|
+
if (count % 2 === 0) {
|
|
5663
|
+
return false;
|
|
5664
|
+
}
|
|
5665
|
+
|
|
5666
|
+
state.negated = true;
|
|
5667
|
+
state.start++;
|
|
5668
|
+
return true;
|
|
5669
|
+
};
|
|
5670
|
+
|
|
5671
|
+
const increment = type => {
|
|
5672
|
+
state[type]++;
|
|
5673
|
+
stack.push(type);
|
|
5674
|
+
};
|
|
5675
|
+
|
|
5676
|
+
const decrement = type => {
|
|
5677
|
+
state[type]--;
|
|
5678
|
+
stack.pop();
|
|
5679
|
+
};
|
|
5680
|
+
|
|
5681
|
+
/**
|
|
5682
|
+
* Push tokens onto the tokens array. This helper speeds up
|
|
5683
|
+
* tokenizing by 1) helping us avoid backtracking as much as possible,
|
|
5684
|
+
* and 2) helping us avoid creating extra tokens when consecutive
|
|
5685
|
+
* characters are plain text. This improves performance and simplifies
|
|
5686
|
+
* lookbehinds.
|
|
5687
|
+
*/
|
|
5688
|
+
|
|
5689
|
+
const push = tok => {
|
|
5690
|
+
if (prev.type === 'globstar') {
|
|
5691
|
+
const isBrace = state.braces > 0 && (tok.type === 'comma' || tok.type === 'brace');
|
|
5692
|
+
const isExtglob = tok.extglob === true || (extglobs.length && (tok.type === 'pipe' || tok.type === 'paren'));
|
|
5693
|
+
|
|
5694
|
+
if (tok.type !== 'slash' && tok.type !== 'paren' && !isBrace && !isExtglob) {
|
|
5695
|
+
state.output = state.output.slice(0, -prev.output.length);
|
|
5696
|
+
prev.type = 'star';
|
|
5697
|
+
prev.value = '*';
|
|
5698
|
+
prev.output = star;
|
|
5699
|
+
state.output += prev.output;
|
|
5700
|
+
}
|
|
5701
|
+
}
|
|
5702
|
+
|
|
5703
|
+
if (extglobs.length && tok.type !== 'paren') {
|
|
5704
|
+
extglobs[extglobs.length - 1].inner += tok.value;
|
|
5705
|
+
}
|
|
5706
|
+
|
|
5707
|
+
if (tok.value || tok.output) append(tok);
|
|
5708
|
+
if (prev && prev.type === 'text' && tok.type === 'text') {
|
|
5709
|
+
prev.output = (prev.output || prev.value) + tok.value;
|
|
5710
|
+
prev.value += tok.value;
|
|
5711
|
+
return;
|
|
5712
|
+
}
|
|
5713
|
+
|
|
5714
|
+
tok.prev = prev;
|
|
5715
|
+
tokens.push(tok);
|
|
5716
|
+
prev = tok;
|
|
5717
|
+
};
|
|
5718
|
+
|
|
5719
|
+
const extglobOpen = (type, value) => {
|
|
5720
|
+
const token = { ...EXTGLOB_CHARS[value], conditions: 1, inner: '' };
|
|
5721
|
+
|
|
5722
|
+
token.prev = prev;
|
|
5723
|
+
token.parens = state.parens;
|
|
5724
|
+
token.output = state.output;
|
|
5725
|
+
token.startIndex = state.index;
|
|
5726
|
+
token.tokensIndex = tokens.length;
|
|
5727
|
+
const output = (opts.capture ? '(' : '') + token.open;
|
|
5728
|
+
|
|
5729
|
+
increment('parens');
|
|
5730
|
+
push({ type, value, output: state.output ? '' : ONE_CHAR });
|
|
5731
|
+
push({ type: 'paren', extglob: true, value: advance(), output });
|
|
5732
|
+
extglobs.push(token);
|
|
5733
|
+
};
|
|
5734
|
+
|
|
5735
|
+
const extglobClose = token => {
|
|
5736
|
+
const literal = input.slice(token.startIndex, state.index + 1);
|
|
5737
|
+
const body = input.slice(token.startIndex + 2, state.index);
|
|
5738
|
+
const analysis = analyzeRepeatedExtglob(body, opts);
|
|
5739
|
+
|
|
5740
|
+
if ((token.type === 'plus' || token.type === 'star') && analysis.risky) {
|
|
5741
|
+
const safeOutput = analysis.safeOutput
|
|
5742
|
+
? (token.output ? '' : ONE_CHAR) + (opts.capture ? `(${analysis.safeOutput})` : analysis.safeOutput)
|
|
5743
|
+
: undefined;
|
|
5744
|
+
const open = tokens[token.tokensIndex];
|
|
5745
|
+
|
|
5746
|
+
open.type = 'text';
|
|
5747
|
+
open.value = literal;
|
|
5748
|
+
open.output = safeOutput || utils.escapeRegex(literal);
|
|
5749
|
+
|
|
5750
|
+
for (let i = token.tokensIndex + 1; i < tokens.length; i++) {
|
|
5751
|
+
tokens[i].value = '';
|
|
5752
|
+
tokens[i].output = '';
|
|
5753
|
+
delete tokens[i].suffix;
|
|
5754
|
+
}
|
|
5755
|
+
|
|
5756
|
+
state.output = token.output + open.output;
|
|
5757
|
+
state.backtrack = true;
|
|
5758
|
+
|
|
5759
|
+
push({ type: 'paren', extglob: true, value, output: '' });
|
|
5760
|
+
decrement('parens');
|
|
5761
|
+
return;
|
|
5762
|
+
}
|
|
5763
|
+
|
|
5764
|
+
let output = token.close + (opts.capture ? ')' : '');
|
|
5765
|
+
let rest;
|
|
5766
|
+
|
|
5767
|
+
if (token.type === 'negate') {
|
|
5768
|
+
let extglobStar = star;
|
|
5769
|
+
|
|
5770
|
+
if (token.inner && token.inner.length > 1 && token.inner.includes('/')) {
|
|
5771
|
+
extglobStar = globstar(opts);
|
|
5772
|
+
}
|
|
5773
|
+
|
|
5774
|
+
if (extglobStar !== star || eos() || /^\)+$/.test(remaining())) {
|
|
5775
|
+
output = token.close = `)$))${extglobStar}`;
|
|
5776
|
+
}
|
|
5777
|
+
|
|
5778
|
+
if (token.inner.includes('*') && (rest = remaining()) && /^\.[^\\/.]+$/.test(rest)) {
|
|
5779
|
+
// Any non-magical string (`.ts`) or even nested expression (`.{ts,tsx}`) can follow after the closing parenthesis.
|
|
5780
|
+
// In this case, we need to parse the string and use it in the output of the original pattern.
|
|
5781
|
+
// Suitable patterns: `/!(*.d).ts`, `/!(*.d).{ts,tsx}`, `**/!(*-dbg).@(js)`.
|
|
5782
|
+
//
|
|
5783
|
+
// Disabling the `fastpaths` option due to a problem with parsing strings as `.ts` in the pattern like `**/!(*.d).ts`.
|
|
5784
|
+
const expression = parse(rest, { ...options, fastpaths: false }).output;
|
|
5785
|
+
|
|
5786
|
+
output = token.close = `)${expression})${extglobStar})`;
|
|
5787
|
+
}
|
|
5788
|
+
|
|
5789
|
+
if (token.prev.type === 'bos') {
|
|
5790
|
+
state.negatedExtglob = true;
|
|
5791
|
+
}
|
|
5792
|
+
}
|
|
5793
|
+
|
|
5794
|
+
push({ type: 'paren', extglob: true, value, output });
|
|
5795
|
+
decrement('parens');
|
|
5796
|
+
};
|
|
5797
|
+
|
|
5798
|
+
/**
|
|
5799
|
+
* Fast paths
|
|
5800
|
+
*/
|
|
5801
|
+
|
|
5802
|
+
if (opts.fastpaths !== false && !/(^[*!]|[/()[\]{}"])/.test(input)) {
|
|
5803
|
+
let backslashes = false;
|
|
5804
|
+
|
|
5805
|
+
let output = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (m, esc, chars, first, rest, index) => {
|
|
5806
|
+
if (first === '\\') {
|
|
5807
|
+
backslashes = true;
|
|
5808
|
+
return m;
|
|
5809
|
+
}
|
|
5810
|
+
|
|
5811
|
+
if (first === '?') {
|
|
5812
|
+
if (esc) {
|
|
5813
|
+
return esc + first + (rest ? QMARK.repeat(rest.length) : '');
|
|
5814
|
+
}
|
|
5815
|
+
if (index === 0) {
|
|
5816
|
+
return qmarkNoDot + (rest ? QMARK.repeat(rest.length) : '');
|
|
5817
|
+
}
|
|
5818
|
+
return QMARK.repeat(chars.length);
|
|
5819
|
+
}
|
|
5820
|
+
|
|
5821
|
+
if (first === '.') {
|
|
5822
|
+
return DOT_LITERAL.repeat(chars.length);
|
|
5823
|
+
}
|
|
5824
|
+
|
|
5825
|
+
if (first === '*') {
|
|
5826
|
+
if (esc) {
|
|
5827
|
+
return esc + first + (rest ? star : '');
|
|
5828
|
+
}
|
|
5829
|
+
return star;
|
|
5830
|
+
}
|
|
5831
|
+
return esc ? m : `\\${m}`;
|
|
5832
|
+
});
|
|
5833
|
+
|
|
5834
|
+
if (backslashes === true) {
|
|
5835
|
+
if (opts.unescape === true) {
|
|
5836
|
+
output = output.replace(/\\/g, '');
|
|
5837
|
+
} else {
|
|
5838
|
+
output = output.replace(/\\+/g, m => {
|
|
5839
|
+
return m.length % 2 === 0 ? '\\\\' : (m ? '\\' : '');
|
|
5840
|
+
});
|
|
5841
|
+
}
|
|
5842
|
+
}
|
|
5843
|
+
|
|
5844
|
+
if (output === input && opts.contains === true) {
|
|
5845
|
+
state.output = input;
|
|
5846
|
+
return state;
|
|
5847
|
+
}
|
|
5848
|
+
|
|
5849
|
+
state.output = utils.wrapOutput(output, state, options);
|
|
5850
|
+
return state;
|
|
5851
|
+
}
|
|
5852
|
+
|
|
5853
|
+
/**
|
|
5854
|
+
* Tokenize input until we reach end-of-string
|
|
5855
|
+
*/
|
|
5856
|
+
|
|
5857
|
+
while (!eos()) {
|
|
5858
|
+
value = advance();
|
|
5859
|
+
|
|
5860
|
+
if (value === '\u0000') {
|
|
5861
|
+
continue;
|
|
5862
|
+
}
|
|
5863
|
+
|
|
5864
|
+
/**
|
|
5865
|
+
* Escaped characters
|
|
5866
|
+
*/
|
|
5867
|
+
|
|
5868
|
+
if (value === '\\') {
|
|
5869
|
+
const next = peek();
|
|
5870
|
+
|
|
5871
|
+
if (next === '/' && opts.bash !== true) {
|
|
5872
|
+
continue;
|
|
5873
|
+
}
|
|
5874
|
+
|
|
5875
|
+
if (next === '.' || next === ';') {
|
|
5876
|
+
continue;
|
|
5877
|
+
}
|
|
5878
|
+
|
|
5879
|
+
if (!next) {
|
|
5880
|
+
value += '\\';
|
|
5881
|
+
push({ type: 'text', value });
|
|
5882
|
+
continue;
|
|
5883
|
+
}
|
|
5884
|
+
|
|
5885
|
+
// collapse slashes to reduce potential for exploits
|
|
5886
|
+
const match = /^\\+/.exec(remaining());
|
|
5887
|
+
let slashes = 0;
|
|
5888
|
+
|
|
5889
|
+
if (match && match[0].length > 2) {
|
|
5890
|
+
slashes = match[0].length;
|
|
5891
|
+
state.index += slashes;
|
|
5892
|
+
if (slashes % 2 !== 0) {
|
|
5893
|
+
value += '\\';
|
|
5894
|
+
}
|
|
5895
|
+
}
|
|
5896
|
+
|
|
5897
|
+
if (opts.unescape === true) {
|
|
5898
|
+
value = advance();
|
|
5899
|
+
} else {
|
|
5900
|
+
value += advance();
|
|
5901
|
+
}
|
|
5902
|
+
|
|
5903
|
+
if (state.brackets === 0) {
|
|
5904
|
+
push({ type: 'text', value });
|
|
5905
|
+
continue;
|
|
5906
|
+
}
|
|
5907
|
+
}
|
|
5908
|
+
|
|
5909
|
+
/**
|
|
5910
|
+
* If we're inside a regex character class, continue
|
|
5911
|
+
* until we reach the closing bracket.
|
|
5912
|
+
*/
|
|
5913
|
+
|
|
5914
|
+
if (state.brackets > 0 && (value !== ']' || prev.value === '[' || prev.value === '[^')) {
|
|
5915
|
+
if (opts.posix !== false && value === ':') {
|
|
5916
|
+
const inner = prev.value.slice(1);
|
|
5917
|
+
if (inner.includes('[')) {
|
|
5918
|
+
prev.posix = true;
|
|
5919
|
+
|
|
5920
|
+
if (inner.includes(':')) {
|
|
5921
|
+
const idx = prev.value.lastIndexOf('[');
|
|
5922
|
+
const pre = prev.value.slice(0, idx);
|
|
5923
|
+
const rest = prev.value.slice(idx + 2);
|
|
5924
|
+
const posix = POSIX_REGEX_SOURCE[rest];
|
|
5925
|
+
if (posix) {
|
|
5926
|
+
prev.value = pre + posix;
|
|
5927
|
+
state.backtrack = true;
|
|
5928
|
+
advance();
|
|
5929
|
+
|
|
5930
|
+
if (!bos.output && tokens.indexOf(prev) === 1) {
|
|
5931
|
+
bos.output = ONE_CHAR;
|
|
5932
|
+
}
|
|
5933
|
+
continue;
|
|
5934
|
+
}
|
|
5935
|
+
}
|
|
5936
|
+
}
|
|
5937
|
+
}
|
|
5938
|
+
|
|
5939
|
+
if ((value === '[' && peek() !== ':') || (value === '-' && peek() === ']')) {
|
|
5940
|
+
value = `\\${value}`;
|
|
5941
|
+
}
|
|
5942
|
+
|
|
5943
|
+
if (value === ']' && (prev.value === '[' || prev.value === '[^')) {
|
|
5944
|
+
value = `\\${value}`;
|
|
5945
|
+
}
|
|
5946
|
+
|
|
5947
|
+
if (opts.posix === true && value === '!' && prev.value === '[') {
|
|
5948
|
+
value = '^';
|
|
5949
|
+
}
|
|
5950
|
+
|
|
5951
|
+
prev.value += value;
|
|
5952
|
+
append({ value });
|
|
5953
|
+
continue;
|
|
5954
|
+
}
|
|
5955
|
+
|
|
5956
|
+
/**
|
|
5957
|
+
* If we're inside a quoted string, continue
|
|
5958
|
+
* until we reach the closing double quote.
|
|
5959
|
+
*/
|
|
5960
|
+
|
|
5961
|
+
if (state.quotes === 1 && value !== '"') {
|
|
5962
|
+
value = utils.escapeRegex(value);
|
|
5963
|
+
prev.value += value;
|
|
5964
|
+
append({ value });
|
|
5965
|
+
continue;
|
|
5966
|
+
}
|
|
5967
|
+
|
|
5968
|
+
/**
|
|
5969
|
+
* Double quotes
|
|
5970
|
+
*/
|
|
5971
|
+
|
|
5972
|
+
if (value === '"') {
|
|
5973
|
+
state.quotes = state.quotes === 1 ? 0 : 1;
|
|
5974
|
+
if (opts.keepQuotes === true) {
|
|
5975
|
+
push({ type: 'text', value });
|
|
5976
|
+
}
|
|
5977
|
+
continue;
|
|
5978
|
+
}
|
|
5979
|
+
|
|
5980
|
+
/**
|
|
5981
|
+
* Parentheses
|
|
5982
|
+
*/
|
|
5983
|
+
|
|
5984
|
+
if (value === '(') {
|
|
5985
|
+
increment('parens');
|
|
5986
|
+
push({ type: 'paren', value });
|
|
5987
|
+
continue;
|
|
5988
|
+
}
|
|
5989
|
+
|
|
5990
|
+
if (value === ')') {
|
|
5991
|
+
if (state.parens === 0 && opts.strictBrackets === true) {
|
|
5992
|
+
throw new SyntaxError(syntaxError('opening', '('));
|
|
5993
|
+
}
|
|
5994
|
+
|
|
5995
|
+
const extglob = extglobs[extglobs.length - 1];
|
|
5996
|
+
if (extglob && state.parens === extglob.parens + 1) {
|
|
5997
|
+
extglobClose(extglobs.pop());
|
|
5998
|
+
continue;
|
|
5999
|
+
}
|
|
6000
|
+
|
|
6001
|
+
push({ type: 'paren', value, output: state.parens ? ')' : '\\)' });
|
|
6002
|
+
decrement('parens');
|
|
6003
|
+
continue;
|
|
6004
|
+
}
|
|
6005
|
+
|
|
6006
|
+
/**
|
|
6007
|
+
* Square brackets
|
|
6008
|
+
*/
|
|
6009
|
+
|
|
6010
|
+
if (value === '[') {
|
|
6011
|
+
if (opts.nobracket === true || !remaining().includes(']')) {
|
|
6012
|
+
if (opts.nobracket !== true && opts.strictBrackets === true) {
|
|
6013
|
+
throw new SyntaxError(syntaxError('closing', ']'));
|
|
6014
|
+
}
|
|
6015
|
+
|
|
6016
|
+
value = `\\${value}`;
|
|
6017
|
+
} else {
|
|
6018
|
+
increment('brackets');
|
|
6019
|
+
}
|
|
6020
|
+
|
|
6021
|
+
push({ type: 'bracket', value });
|
|
6022
|
+
continue;
|
|
6023
|
+
}
|
|
6024
|
+
|
|
6025
|
+
if (value === ']') {
|
|
6026
|
+
if (opts.nobracket === true || (prev && prev.type === 'bracket' && prev.value.length === 1)) {
|
|
6027
|
+
push({ type: 'text', value, output: `\\${value}` });
|
|
6028
|
+
continue;
|
|
6029
|
+
}
|
|
6030
|
+
|
|
6031
|
+
if (state.brackets === 0) {
|
|
6032
|
+
if (opts.strictBrackets === true) {
|
|
6033
|
+
throw new SyntaxError(syntaxError('opening', '['));
|
|
6034
|
+
}
|
|
6035
|
+
|
|
6036
|
+
push({ type: 'text', value, output: `\\${value}` });
|
|
6037
|
+
continue;
|
|
6038
|
+
}
|
|
6039
|
+
|
|
6040
|
+
decrement('brackets');
|
|
6041
|
+
|
|
6042
|
+
const prevValue = prev.value.slice(1);
|
|
6043
|
+
if (prev.posix !== true && prevValue[0] === '^' && !prevValue.includes('/')) {
|
|
6044
|
+
value = `/${value}`;
|
|
6045
|
+
}
|
|
6046
|
+
|
|
6047
|
+
prev.value += value;
|
|
6048
|
+
append({ value });
|
|
6049
|
+
|
|
6050
|
+
// when literal brackets are explicitly disabled
|
|
6051
|
+
// assume we should match with a regex character class
|
|
6052
|
+
if (opts.literalBrackets === false || utils.hasRegexChars(prevValue)) {
|
|
6053
|
+
continue;
|
|
6054
|
+
}
|
|
6055
|
+
|
|
6056
|
+
const escaped = utils.escapeRegex(prev.value);
|
|
6057
|
+
state.output = state.output.slice(0, -prev.value.length);
|
|
6058
|
+
|
|
6059
|
+
// when literal brackets are explicitly enabled
|
|
6060
|
+
// assume we should escape the brackets to match literal characters
|
|
6061
|
+
if (opts.literalBrackets === true) {
|
|
6062
|
+
state.output += escaped;
|
|
6063
|
+
prev.value = escaped;
|
|
6064
|
+
continue;
|
|
6065
|
+
}
|
|
6066
|
+
|
|
6067
|
+
// when the user specifies nothing, try to match both
|
|
6068
|
+
prev.value = `(${capture}${escaped}|${prev.value})`;
|
|
6069
|
+
state.output += prev.value;
|
|
6070
|
+
continue;
|
|
6071
|
+
}
|
|
6072
|
+
|
|
6073
|
+
/**
|
|
6074
|
+
* Braces
|
|
6075
|
+
*/
|
|
6076
|
+
|
|
6077
|
+
if (value === '{' && opts.nobrace !== true) {
|
|
6078
|
+
increment('braces');
|
|
6079
|
+
|
|
6080
|
+
const open = {
|
|
6081
|
+
type: 'brace',
|
|
6082
|
+
value,
|
|
6083
|
+
output: '(',
|
|
6084
|
+
outputIndex: state.output.length,
|
|
6085
|
+
tokensIndex: state.tokens.length
|
|
6086
|
+
};
|
|
6087
|
+
|
|
6088
|
+
braces.push(open);
|
|
6089
|
+
push(open);
|
|
6090
|
+
continue;
|
|
6091
|
+
}
|
|
6092
|
+
|
|
6093
|
+
if (value === '}') {
|
|
6094
|
+
const brace = braces[braces.length - 1];
|
|
6095
|
+
|
|
6096
|
+
if (opts.nobrace === true || !brace) {
|
|
6097
|
+
push({ type: 'text', value, output: value });
|
|
6098
|
+
continue;
|
|
6099
|
+
}
|
|
6100
|
+
|
|
6101
|
+
let output = ')';
|
|
6102
|
+
|
|
6103
|
+
if (brace.dots === true) {
|
|
6104
|
+
const arr = tokens.slice();
|
|
6105
|
+
const range = [];
|
|
6106
|
+
|
|
6107
|
+
for (let i = arr.length - 1; i >= 0; i--) {
|
|
6108
|
+
tokens.pop();
|
|
6109
|
+
if (arr[i].type === 'brace') {
|
|
6110
|
+
break;
|
|
6111
|
+
}
|
|
6112
|
+
if (arr[i].type !== 'dots') {
|
|
6113
|
+
range.unshift(arr[i].value);
|
|
6114
|
+
}
|
|
6115
|
+
}
|
|
6116
|
+
|
|
6117
|
+
output = expandRange(range, opts);
|
|
6118
|
+
state.backtrack = true;
|
|
6119
|
+
}
|
|
6120
|
+
|
|
6121
|
+
if (brace.comma !== true && brace.dots !== true) {
|
|
6122
|
+
const out = state.output.slice(0, brace.outputIndex);
|
|
6123
|
+
const toks = state.tokens.slice(brace.tokensIndex);
|
|
6124
|
+
brace.value = brace.output = '\\{';
|
|
6125
|
+
value = output = '\\}';
|
|
6126
|
+
state.output = out;
|
|
6127
|
+
for (const t of toks) {
|
|
6128
|
+
state.output += (t.output || t.value);
|
|
6129
|
+
}
|
|
6130
|
+
}
|
|
6131
|
+
|
|
6132
|
+
push({ type: 'brace', value, output });
|
|
6133
|
+
decrement('braces');
|
|
6134
|
+
braces.pop();
|
|
6135
|
+
continue;
|
|
6136
|
+
}
|
|
6137
|
+
|
|
6138
|
+
/**
|
|
6139
|
+
* Pipes
|
|
6140
|
+
*/
|
|
6141
|
+
|
|
6142
|
+
if (value === '|') {
|
|
6143
|
+
if (extglobs.length > 0) {
|
|
6144
|
+
extglobs[extglobs.length - 1].conditions++;
|
|
6145
|
+
}
|
|
6146
|
+
push({ type: 'text', value });
|
|
6147
|
+
continue;
|
|
6148
|
+
}
|
|
6149
|
+
|
|
6150
|
+
/**
|
|
6151
|
+
* Commas
|
|
6152
|
+
*/
|
|
6153
|
+
|
|
6154
|
+
if (value === ',') {
|
|
6155
|
+
let output = value;
|
|
6156
|
+
|
|
6157
|
+
const brace = braces[braces.length - 1];
|
|
6158
|
+
if (brace && stack[stack.length - 1] === 'braces') {
|
|
6159
|
+
brace.comma = true;
|
|
6160
|
+
output = '|';
|
|
6161
|
+
}
|
|
6162
|
+
|
|
6163
|
+
push({ type: 'comma', value, output });
|
|
6164
|
+
continue;
|
|
6165
|
+
}
|
|
6166
|
+
|
|
6167
|
+
/**
|
|
6168
|
+
* Slashes
|
|
6169
|
+
*/
|
|
6170
|
+
|
|
6171
|
+
if (value === '/') {
|
|
6172
|
+
// if the beginning of the glob is "./", advance the start
|
|
6173
|
+
// to the current index, and don't add the "./" characters
|
|
6174
|
+
// to the state. This greatly simplifies lookbehinds when
|
|
6175
|
+
// checking for BOS characters like "!" and "." (not "./")
|
|
6176
|
+
if (prev.type === 'dot' && state.index === state.start + 1) {
|
|
6177
|
+
state.start = state.index + 1;
|
|
6178
|
+
state.consumed = '';
|
|
6179
|
+
state.output = '';
|
|
6180
|
+
tokens.pop();
|
|
6181
|
+
prev = bos; // reset "prev" to the first token
|
|
6182
|
+
continue;
|
|
6183
|
+
}
|
|
6184
|
+
|
|
6185
|
+
push({ type: 'slash', value, output: SLASH_LITERAL });
|
|
6186
|
+
continue;
|
|
6187
|
+
}
|
|
6188
|
+
|
|
6189
|
+
/**
|
|
6190
|
+
* Dots
|
|
6191
|
+
*/
|
|
6192
|
+
|
|
6193
|
+
if (value === '.') {
|
|
6194
|
+
if (state.braces > 0 && prev.type === 'dot') {
|
|
6195
|
+
if (prev.value === '.') prev.output = DOT_LITERAL;
|
|
6196
|
+
const brace = braces[braces.length - 1];
|
|
6197
|
+
prev.type = 'dots';
|
|
6198
|
+
prev.output += value;
|
|
6199
|
+
prev.value += value;
|
|
6200
|
+
brace.dots = true;
|
|
6201
|
+
continue;
|
|
6202
|
+
}
|
|
6203
|
+
|
|
6204
|
+
if ((state.braces + state.parens) === 0 && prev.type !== 'bos' && prev.type !== 'slash') {
|
|
6205
|
+
push({ type: 'text', value, output: DOT_LITERAL });
|
|
6206
|
+
continue;
|
|
6207
|
+
}
|
|
6208
|
+
|
|
6209
|
+
push({ type: 'dot', value, output: DOT_LITERAL });
|
|
6210
|
+
continue;
|
|
6211
|
+
}
|
|
6212
|
+
|
|
6213
|
+
/**
|
|
6214
|
+
* Question marks
|
|
6215
|
+
*/
|
|
6216
|
+
|
|
6217
|
+
if (value === '?') {
|
|
6218
|
+
const isGroup = prev && prev.value === '(';
|
|
6219
|
+
if (!isGroup && opts.noextglob !== true && peek() === '(' && peek(2) !== '?') {
|
|
6220
|
+
extglobOpen('qmark', value);
|
|
6221
|
+
continue;
|
|
6222
|
+
}
|
|
6223
|
+
|
|
6224
|
+
if (prev && prev.type === 'paren') {
|
|
6225
|
+
const next = peek();
|
|
6226
|
+
let output = value;
|
|
6227
|
+
|
|
6228
|
+
if ((prev.value === '(' && !/[!=<:]/.test(next)) || (next === '<' && !/<([!=]|\w+>)/.test(remaining()))) {
|
|
6229
|
+
output = `\\${value}`;
|
|
6230
|
+
}
|
|
6231
|
+
|
|
6232
|
+
push({ type: 'text', value, output });
|
|
6233
|
+
continue;
|
|
6234
|
+
}
|
|
6235
|
+
|
|
6236
|
+
if (opts.dot !== true && (prev.type === 'slash' || prev.type === 'bos')) {
|
|
6237
|
+
push({ type: 'qmark', value, output: QMARK_NO_DOT });
|
|
6238
|
+
continue;
|
|
6239
|
+
}
|
|
6240
|
+
|
|
6241
|
+
push({ type: 'qmark', value, output: QMARK });
|
|
6242
|
+
continue;
|
|
6243
|
+
}
|
|
6244
|
+
|
|
6245
|
+
/**
|
|
6246
|
+
* Exclamation
|
|
6247
|
+
*/
|
|
6248
|
+
|
|
6249
|
+
if (value === '!') {
|
|
6250
|
+
if (opts.noextglob !== true && peek() === '(') {
|
|
6251
|
+
if (peek(2) !== '?' || !/[!=<:]/.test(peek(3))) {
|
|
6252
|
+
extglobOpen('negate', value);
|
|
6253
|
+
continue;
|
|
6254
|
+
}
|
|
6255
|
+
}
|
|
6256
|
+
|
|
6257
|
+
if (opts.nonegate !== true && state.index === 0) {
|
|
6258
|
+
negate();
|
|
6259
|
+
continue;
|
|
6260
|
+
}
|
|
6261
|
+
}
|
|
6262
|
+
|
|
6263
|
+
/**
|
|
6264
|
+
* Plus
|
|
6265
|
+
*/
|
|
6266
|
+
|
|
6267
|
+
if (value === '+') {
|
|
6268
|
+
if (opts.noextglob !== true && peek() === '(' && peek(2) !== '?') {
|
|
6269
|
+
extglobOpen('plus', value);
|
|
6270
|
+
continue;
|
|
6271
|
+
}
|
|
6272
|
+
|
|
6273
|
+
if ((prev && prev.value === '(') || opts.regex === false) {
|
|
6274
|
+
push({ type: 'plus', value, output: PLUS_LITERAL });
|
|
6275
|
+
continue;
|
|
6276
|
+
}
|
|
6277
|
+
|
|
6278
|
+
if ((prev && (prev.type === 'bracket' || prev.type === 'paren' || prev.type === 'brace')) || state.parens > 0) {
|
|
6279
|
+
push({ type: 'plus', value });
|
|
6280
|
+
continue;
|
|
6281
|
+
}
|
|
6282
|
+
|
|
6283
|
+
push({ type: 'plus', value: PLUS_LITERAL });
|
|
6284
|
+
continue;
|
|
6285
|
+
}
|
|
6286
|
+
|
|
6287
|
+
/**
|
|
6288
|
+
* Plain text
|
|
6289
|
+
*/
|
|
6290
|
+
|
|
6291
|
+
if (value === '@') {
|
|
6292
|
+
if (opts.noextglob !== true && peek() === '(' && peek(2) !== '?') {
|
|
6293
|
+
push({ type: 'at', extglob: true, value, output: '' });
|
|
6294
|
+
continue;
|
|
6295
|
+
}
|
|
6296
|
+
|
|
6297
|
+
push({ type: 'text', value });
|
|
6298
|
+
continue;
|
|
6299
|
+
}
|
|
6300
|
+
|
|
6301
|
+
/**
|
|
6302
|
+
* Plain text
|
|
6303
|
+
*/
|
|
6304
|
+
|
|
6305
|
+
if (value !== '*') {
|
|
6306
|
+
if (value === '$' || value === '^') {
|
|
6307
|
+
value = `\\${value}`;
|
|
6308
|
+
}
|
|
6309
|
+
|
|
6310
|
+
const match = REGEX_NON_SPECIAL_CHARS.exec(remaining());
|
|
6311
|
+
if (match) {
|
|
6312
|
+
value += match[0];
|
|
6313
|
+
state.index += match[0].length;
|
|
6314
|
+
}
|
|
6315
|
+
|
|
6316
|
+
push({ type: 'text', value });
|
|
6317
|
+
continue;
|
|
6318
|
+
}
|
|
6319
|
+
|
|
6320
|
+
/**
|
|
6321
|
+
* Stars
|
|
6322
|
+
*/
|
|
6323
|
+
|
|
6324
|
+
if (prev && (prev.type === 'globstar' || prev.star === true)) {
|
|
6325
|
+
prev.type = 'star';
|
|
6326
|
+
prev.star = true;
|
|
6327
|
+
prev.value += value;
|
|
6328
|
+
prev.output = star;
|
|
6329
|
+
state.backtrack = true;
|
|
6330
|
+
state.globstar = true;
|
|
6331
|
+
consume(value);
|
|
6332
|
+
continue;
|
|
6333
|
+
}
|
|
6334
|
+
|
|
6335
|
+
let rest = remaining();
|
|
6336
|
+
if (opts.noextglob !== true && /^\([^?]/.test(rest)) {
|
|
6337
|
+
extglobOpen('star', value);
|
|
6338
|
+
continue;
|
|
6339
|
+
}
|
|
6340
|
+
|
|
6341
|
+
if (prev.type === 'star') {
|
|
6342
|
+
if (opts.noglobstar === true) {
|
|
6343
|
+
consume(value);
|
|
6344
|
+
continue;
|
|
6345
|
+
}
|
|
6346
|
+
|
|
6347
|
+
const prior = prev.prev;
|
|
6348
|
+
const before = prior.prev;
|
|
6349
|
+
const isStart = prior.type === 'slash' || prior.type === 'bos';
|
|
6350
|
+
const afterStar = before && (before.type === 'star' || before.type === 'globstar');
|
|
6351
|
+
|
|
6352
|
+
if (opts.bash === true && (!isStart || (rest[0] && rest[0] !== '/'))) {
|
|
6353
|
+
push({ type: 'star', value, output: '' });
|
|
6354
|
+
continue;
|
|
6355
|
+
}
|
|
6356
|
+
|
|
6357
|
+
const isBrace = state.braces > 0 && (prior.type === 'comma' || prior.type === 'brace');
|
|
6358
|
+
const isExtglob = extglobs.length && (prior.type === 'pipe' || prior.type === 'paren');
|
|
6359
|
+
if (!isStart && prior.type !== 'paren' && !isBrace && !isExtglob) {
|
|
6360
|
+
push({ type: 'star', value, output: '' });
|
|
6361
|
+
continue;
|
|
6362
|
+
}
|
|
6363
|
+
|
|
6364
|
+
// strip consecutive `/**/`
|
|
6365
|
+
while (rest.slice(0, 3) === '/**') {
|
|
6366
|
+
const after = input[state.index + 4];
|
|
6367
|
+
if (after && after !== '/') {
|
|
6368
|
+
break;
|
|
6369
|
+
}
|
|
6370
|
+
rest = rest.slice(3);
|
|
6371
|
+
consume('/**', 3);
|
|
6372
|
+
}
|
|
6373
|
+
|
|
6374
|
+
// A globstar followed only by balanced closing parens is at the logical end of patterns like
|
|
6375
|
+
// `test(/utils/**)` and `test?(/utils/**)`. Treat it as EOS so the trailing `/**` can match its
|
|
6376
|
+
// parent path, except in negated extglobs where that would change the exclusion semantics.
|
|
6377
|
+
const isEnd = eos() || (
|
|
6378
|
+
state.parens > 0
|
|
6379
|
+
&& rest === ')'.repeat(state.parens)
|
|
6380
|
+
&& !extglobs.some(extglob => extglob.type === 'negate')
|
|
6381
|
+
);
|
|
6382
|
+
|
|
6383
|
+
if (prior.type === 'bos' && eos()) {
|
|
6384
|
+
prev.type = 'globstar';
|
|
6385
|
+
prev.value += value;
|
|
6386
|
+
prev.output = globstar(opts);
|
|
6387
|
+
state.output = prev.output;
|
|
6388
|
+
state.globstar = true;
|
|
6389
|
+
consume(value);
|
|
6390
|
+
continue;
|
|
6391
|
+
}
|
|
6392
|
+
|
|
6393
|
+
if (prior.type === 'slash' && prior.prev.type !== 'bos' && !afterStar && isEnd) {
|
|
6394
|
+
state.output = state.output.slice(0, -(prior.output + prev.output).length);
|
|
6395
|
+
prior.output = `(?:${prior.output}`;
|
|
6396
|
+
|
|
6397
|
+
prev.type = 'globstar';
|
|
6398
|
+
prev.output = globstar(opts) + (opts.strictSlashes ? ')' : '|$)');
|
|
6399
|
+
prev.value += value;
|
|
6400
|
+
state.globstar = true;
|
|
6401
|
+
state.output += prior.output + prev.output;
|
|
6402
|
+
consume(value);
|
|
6403
|
+
continue;
|
|
6404
|
+
}
|
|
6405
|
+
|
|
6406
|
+
if (prior.type === 'slash' && prior.prev.type !== 'bos' && rest[0] === '/') {
|
|
6407
|
+
const end = rest[1] !== void 0 ? '|$' : '';
|
|
6408
|
+
|
|
6409
|
+
state.output = state.output.slice(0, -(prior.output + prev.output).length);
|
|
6410
|
+
prior.output = `(?:${prior.output}`;
|
|
6411
|
+
|
|
6412
|
+
prev.type = 'globstar';
|
|
6413
|
+
prev.output = `${globstar(opts)}${SLASH_LITERAL}|${SLASH_LITERAL}${end})`;
|
|
6414
|
+
prev.value += value;
|
|
6415
|
+
|
|
6416
|
+
state.output += prior.output + prev.output;
|
|
6417
|
+
state.globstar = true;
|
|
6418
|
+
|
|
6419
|
+
consume(value + advance());
|
|
6420
|
+
|
|
6421
|
+
push({ type: 'slash', value: '/', output: '' });
|
|
6422
|
+
continue;
|
|
6423
|
+
}
|
|
6424
|
+
|
|
6425
|
+
if (prior.type === 'bos' && rest[0] === '/') {
|
|
6426
|
+
prev.type = 'globstar';
|
|
6427
|
+
prev.value += value;
|
|
6428
|
+
prev.output = `(?:^|${SLASH_LITERAL}|${globstar(opts)}${SLASH_LITERAL})`;
|
|
6429
|
+
state.output = prev.output;
|
|
6430
|
+
state.globstar = true;
|
|
6431
|
+
consume(value + advance());
|
|
6432
|
+
push({ type: 'slash', value: '/', output: '' });
|
|
6433
|
+
continue;
|
|
6434
|
+
}
|
|
6435
|
+
|
|
6436
|
+
// remove single star from output
|
|
6437
|
+
state.output = state.output.slice(0, -prev.output.length);
|
|
6438
|
+
|
|
6439
|
+
// reset previous token to globstar
|
|
6440
|
+
prev.type = 'globstar';
|
|
6441
|
+
prev.output = globstar(opts);
|
|
6442
|
+
prev.value += value;
|
|
6443
|
+
|
|
6444
|
+
// reset output with globstar
|
|
6445
|
+
state.output += prev.output;
|
|
6446
|
+
state.globstar = true;
|
|
6447
|
+
consume(value);
|
|
6448
|
+
continue;
|
|
6449
|
+
}
|
|
6450
|
+
|
|
6451
|
+
const token = { type: 'star', value, output: star };
|
|
6452
|
+
|
|
6453
|
+
if (opts.bash === true) {
|
|
6454
|
+
token.output = '.*?';
|
|
6455
|
+
if (prev.type === 'bos' || prev.type === 'slash') {
|
|
6456
|
+
token.output = nodot + token.output;
|
|
6457
|
+
}
|
|
6458
|
+
push(token);
|
|
6459
|
+
continue;
|
|
6460
|
+
}
|
|
6461
|
+
|
|
6462
|
+
if (prev && (prev.type === 'bracket' || prev.type === 'paren') && opts.regex === true) {
|
|
6463
|
+
token.output = value;
|
|
6464
|
+
push(token);
|
|
6465
|
+
continue;
|
|
6466
|
+
}
|
|
6467
|
+
|
|
6468
|
+
if (state.index === state.start || prev.type === 'slash' || prev.type === 'dot') {
|
|
6469
|
+
if (prev.type === 'dot') {
|
|
6470
|
+
state.output += NO_DOT_SLASH;
|
|
6471
|
+
prev.output += NO_DOT_SLASH;
|
|
6472
|
+
|
|
6473
|
+
} else if (opts.dot === true) {
|
|
6474
|
+
state.output += NO_DOTS_SLASH;
|
|
6475
|
+
prev.output += NO_DOTS_SLASH;
|
|
6476
|
+
|
|
6477
|
+
} else {
|
|
6478
|
+
state.output += nodot;
|
|
6479
|
+
prev.output += nodot;
|
|
6480
|
+
}
|
|
6481
|
+
|
|
6482
|
+
if (peek() !== '*') {
|
|
6483
|
+
state.output += ONE_CHAR;
|
|
6484
|
+
prev.output += ONE_CHAR;
|
|
6485
|
+
}
|
|
6486
|
+
}
|
|
6487
|
+
|
|
6488
|
+
push(token);
|
|
6489
|
+
}
|
|
6490
|
+
|
|
6491
|
+
while (state.brackets > 0) {
|
|
6492
|
+
if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', ']'));
|
|
6493
|
+
state.output = utils.escapeLast(state.output, '[');
|
|
6494
|
+
decrement('brackets');
|
|
6495
|
+
}
|
|
6496
|
+
|
|
6497
|
+
while (state.parens > 0) {
|
|
6498
|
+
if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', ')'));
|
|
6499
|
+
state.output = utils.escapeLast(state.output, '(');
|
|
6500
|
+
decrement('parens');
|
|
6501
|
+
}
|
|
6502
|
+
|
|
6503
|
+
while (state.braces > 0) {
|
|
6504
|
+
if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', '}'));
|
|
6505
|
+
state.output = utils.escapeLast(state.output, '{');
|
|
6506
|
+
decrement('braces');
|
|
6507
|
+
}
|
|
6508
|
+
|
|
6509
|
+
if (opts.strictSlashes !== true && (prev.type === 'star' || prev.type === 'bracket')) {
|
|
6510
|
+
push({ type: 'maybe_slash', value: '', output: `${SLASH_LITERAL}?` });
|
|
6511
|
+
}
|
|
6512
|
+
|
|
6513
|
+
// rebuild the output if we had to backtrack at any point
|
|
6514
|
+
if (state.backtrack === true) {
|
|
6515
|
+
state.output = '';
|
|
6516
|
+
|
|
6517
|
+
for (const token of state.tokens) {
|
|
6518
|
+
state.output += token.output != null ? token.output : token.value;
|
|
6519
|
+
|
|
6520
|
+
if (token.suffix) {
|
|
6521
|
+
state.output += token.suffix;
|
|
6522
|
+
}
|
|
6523
|
+
}
|
|
6524
|
+
}
|
|
6525
|
+
|
|
6526
|
+
return state;
|
|
6527
|
+
};
|
|
6528
|
+
|
|
6529
|
+
/**
|
|
6530
|
+
* Fast paths for creating regular expressions for common glob patterns.
|
|
6531
|
+
* This can significantly speed up processing and has very little downside
|
|
6532
|
+
* impact when none of the fast paths match.
|
|
6533
|
+
*/
|
|
6534
|
+
|
|
6535
|
+
parse.fastpaths = (input, options) => {
|
|
6536
|
+
const opts = { ...options };
|
|
6537
|
+
const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
|
|
6538
|
+
const len = input.length;
|
|
6539
|
+
if (len > max) {
|
|
6540
|
+
throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
|
|
6541
|
+
}
|
|
6542
|
+
|
|
6543
|
+
input = REPLACEMENTS[input] || input;
|
|
6544
|
+
|
|
6545
|
+
// create constants based on platform, for windows or posix
|
|
6546
|
+
const {
|
|
6547
|
+
DOT_LITERAL,
|
|
6548
|
+
SLASH_LITERAL,
|
|
6549
|
+
ONE_CHAR,
|
|
6550
|
+
DOTS_SLASH,
|
|
6551
|
+
NO_DOT,
|
|
6552
|
+
NO_DOTS,
|
|
6553
|
+
NO_DOTS_SLASH,
|
|
6554
|
+
STAR,
|
|
6555
|
+
START_ANCHOR
|
|
6556
|
+
} = constants.globChars(opts.windows);
|
|
6557
|
+
|
|
6558
|
+
const nodot = opts.dot ? NO_DOTS : NO_DOT;
|
|
6559
|
+
const slashDot = opts.dot ? NO_DOTS_SLASH : NO_DOT;
|
|
6560
|
+
const capture = opts.capture ? '' : '?:';
|
|
6561
|
+
const state = { negated: false, prefix: '' };
|
|
6562
|
+
let star = opts.bash === true ? '.*?' : STAR;
|
|
6563
|
+
|
|
6564
|
+
if (opts.capture) {
|
|
6565
|
+
star = `(${star})`;
|
|
6566
|
+
}
|
|
6567
|
+
|
|
6568
|
+
const globstar = opts => {
|
|
6569
|
+
if (opts.noglobstar === true) return star;
|
|
6570
|
+
return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
|
|
6571
|
+
};
|
|
6572
|
+
|
|
6573
|
+
const create = str => {
|
|
6574
|
+
switch (str) {
|
|
6575
|
+
case '*':
|
|
6576
|
+
return `${nodot}${ONE_CHAR}${star}`;
|
|
6577
|
+
|
|
6578
|
+
case '.*':
|
|
6579
|
+
return `${DOT_LITERAL}${ONE_CHAR}${star}`;
|
|
6580
|
+
|
|
6581
|
+
case '*.*':
|
|
6582
|
+
return `${nodot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;
|
|
6583
|
+
|
|
6584
|
+
case '*/*':
|
|
6585
|
+
return `${nodot}${star}${SLASH_LITERAL}${ONE_CHAR}${slashDot}${star}`;
|
|
6586
|
+
|
|
6587
|
+
case '**':
|
|
6588
|
+
return nodot + globstar(opts);
|
|
6589
|
+
|
|
6590
|
+
case '**/*':
|
|
6591
|
+
return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${ONE_CHAR}${star}`;
|
|
6592
|
+
|
|
6593
|
+
case '**/*.*':
|
|
6594
|
+
return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;
|
|
6595
|
+
|
|
6596
|
+
case '**/.*':
|
|
6597
|
+
return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${DOT_LITERAL}${ONE_CHAR}${star}`;
|
|
6598
|
+
|
|
6599
|
+
default: {
|
|
6600
|
+
const match = /^(.*?)\.(\w+)$/.exec(str);
|
|
6601
|
+
if (!match) return;
|
|
6602
|
+
|
|
6603
|
+
const source = create(match[1]);
|
|
6604
|
+
if (!source) return;
|
|
6605
|
+
|
|
6606
|
+
return source + DOT_LITERAL + match[2];
|
|
6607
|
+
}
|
|
6608
|
+
}
|
|
6609
|
+
};
|
|
6610
|
+
|
|
6611
|
+
const output = utils.removePrefix(input, state);
|
|
6612
|
+
let source = create(output);
|
|
6613
|
+
|
|
6614
|
+
if (source && opts.strictSlashes !== true) {
|
|
6615
|
+
source += `${SLASH_LITERAL}?`;
|
|
6616
|
+
}
|
|
6617
|
+
|
|
6618
|
+
return source;
|
|
6619
|
+
};
|
|
6620
|
+
|
|
6621
|
+
module.exports = parse;
|
|
6622
|
+
|
|
6623
|
+
|
|
6624
|
+
/***/ }),
|
|
6625
|
+
|
|
6626
|
+
/***/ 1890:
|
|
6627
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
6628
|
+
|
|
6629
|
+
"use strict";
|
|
6630
|
+
|
|
6631
|
+
|
|
6632
|
+
const scan = __webpack_require__(5083);
|
|
6633
|
+
const parse = __webpack_require__(5767);
|
|
6634
|
+
const utils = __webpack_require__(4717);
|
|
6635
|
+
const constants = __webpack_require__(553);
|
|
6636
|
+
const isObject = val => val && typeof val === 'object' && !Array.isArray(val);
|
|
6637
|
+
|
|
6638
|
+
/**
|
|
6639
|
+
* Creates a matcher function from one or more glob patterns. The
|
|
6640
|
+
* returned function takes a string to match as its first argument,
|
|
6641
|
+
* and returns true if the string is a match. The returned matcher
|
|
6642
|
+
* function also takes a boolean as the second argument that, when true,
|
|
6643
|
+
* returns an object with additional information.
|
|
6644
|
+
*
|
|
6645
|
+
* ```js
|
|
6646
|
+
* const picomatch = require('picomatch');
|
|
6647
|
+
* // picomatch(glob[, options]);
|
|
6648
|
+
*
|
|
6649
|
+
* const isMatch = picomatch('*.!(*a)');
|
|
6650
|
+
* console.log(isMatch('a.a')); //=> false
|
|
6651
|
+
* console.log(isMatch('a.b')); //=> true
|
|
6652
|
+
*
|
|
6653
|
+
* // For environments without `node.js`, `picomatch/posix` provides you a dependency-free matcher, without automatic OS detection.
|
|
6654
|
+
* const picomatch = require('picomatch/posix');
|
|
6655
|
+
* // the same API, defaulting to posix paths
|
|
6656
|
+
* const isMatch = picomatch('a/*');
|
|
6657
|
+
* console.log(isMatch('a\\b')); //=> false
|
|
6658
|
+
* console.log(isMatch('a/b')); //=> true
|
|
6659
|
+
*
|
|
6660
|
+
* // you can still configure the matcher function to accept windows paths
|
|
6661
|
+
* const isMatch = picomatch('a/*', { options: windows });
|
|
6662
|
+
* console.log(isMatch('a\\b')); //=> true
|
|
6663
|
+
* console.log(isMatch('a/b')); //=> true
|
|
6664
|
+
* ```
|
|
6665
|
+
* @name picomatch
|
|
6666
|
+
* @param {String|Array} `globs` One or more glob patterns.
|
|
6667
|
+
* @param {Object=} `options`
|
|
6668
|
+
* @return {Function=} Returns a matcher function.
|
|
6669
|
+
* @api public
|
|
6670
|
+
*/
|
|
6671
|
+
|
|
6672
|
+
const picomatch = (glob, options, returnState = false) => {
|
|
6673
|
+
if (Array.isArray(glob)) {
|
|
6674
|
+
const fns = glob.map(input => picomatch(input, options, returnState));
|
|
6675
|
+
const arrayMatcher = str => {
|
|
6676
|
+
for (const isMatch of fns) {
|
|
6677
|
+
const state = isMatch(str);
|
|
6678
|
+
if (state) return state;
|
|
6679
|
+
}
|
|
6680
|
+
return false;
|
|
6681
|
+
};
|
|
6682
|
+
return arrayMatcher;
|
|
6683
|
+
}
|
|
6684
|
+
|
|
6685
|
+
const isState = isObject(glob) && glob.tokens && glob.input;
|
|
6686
|
+
|
|
6687
|
+
if (glob === '' || (typeof glob !== 'string' && !isState)) {
|
|
6688
|
+
throw new TypeError('Expected pattern to be a non-empty string');
|
|
6689
|
+
}
|
|
6690
|
+
|
|
6691
|
+
const opts = options || {};
|
|
6692
|
+
const posix = opts.windows;
|
|
6693
|
+
const regex = isState
|
|
6694
|
+
? picomatch.compileRe(glob, options)
|
|
6695
|
+
: picomatch.makeRe(glob, options, false, true);
|
|
6696
|
+
|
|
6697
|
+
const state = regex.state;
|
|
6698
|
+
delete regex.state;
|
|
6699
|
+
|
|
6700
|
+
let isIgnored = () => false;
|
|
6701
|
+
if (opts.ignore) {
|
|
6702
|
+
const ignoreOpts = { ...options, ignore: null, onMatch: null, onResult: null };
|
|
6703
|
+
isIgnored = picomatch(opts.ignore, ignoreOpts, returnState);
|
|
6704
|
+
}
|
|
6705
|
+
|
|
6706
|
+
const matcher = (input, returnObject = false) => {
|
|
6707
|
+
const { isMatch, match, output } = picomatch.test(input, regex, options, { glob, posix });
|
|
6708
|
+
const result = { glob, state, regex, posix, input, output, match, isMatch };
|
|
6709
|
+
|
|
6710
|
+
if (typeof opts.onResult === 'function') {
|
|
6711
|
+
opts.onResult(result);
|
|
6712
|
+
}
|
|
6713
|
+
|
|
6714
|
+
if (isMatch === false) {
|
|
6715
|
+
result.isMatch = false;
|
|
6716
|
+
return returnObject ? result : false;
|
|
6717
|
+
}
|
|
6718
|
+
|
|
6719
|
+
if (isIgnored(input)) {
|
|
6720
|
+
if (typeof opts.onIgnore === 'function') {
|
|
6721
|
+
opts.onIgnore(result);
|
|
6722
|
+
}
|
|
6723
|
+
result.isMatch = false;
|
|
6724
|
+
return returnObject ? result : false;
|
|
6725
|
+
}
|
|
6726
|
+
|
|
6727
|
+
if (typeof opts.onMatch === 'function') {
|
|
6728
|
+
opts.onMatch(result);
|
|
6729
|
+
}
|
|
6730
|
+
return returnObject ? result : true;
|
|
6731
|
+
};
|
|
6732
|
+
|
|
6733
|
+
if (returnState) {
|
|
6734
|
+
matcher.state = state;
|
|
6735
|
+
}
|
|
6736
|
+
|
|
6737
|
+
return matcher;
|
|
6738
|
+
};
|
|
6739
|
+
|
|
6740
|
+
/**
|
|
6741
|
+
* Test `input` with the given `regex`. This is used by the main
|
|
6742
|
+
* `picomatch()` function to test the input string.
|
|
6743
|
+
*
|
|
6744
|
+
* ```js
|
|
6745
|
+
* const picomatch = require('picomatch');
|
|
6746
|
+
* // picomatch.test(input, regex[, options]);
|
|
6747
|
+
*
|
|
6748
|
+
* console.log(picomatch.test('foo/bar', /^(?:([^/]*?)\/([^/]*?))$/));
|
|
6749
|
+
* // { isMatch: true, match: [ 'foo/', 'foo', 'bar' ], output: 'foo/bar' }
|
|
6750
|
+
* ```
|
|
6751
|
+
* @param {String} `input` String to test.
|
|
6752
|
+
* @param {RegExp} `regex`
|
|
6753
|
+
* @return {Object} Returns an object with matching info.
|
|
6754
|
+
* @api public
|
|
6755
|
+
*/
|
|
6756
|
+
|
|
6757
|
+
picomatch.test = (input, regex, options, { glob, posix } = {}) => {
|
|
6758
|
+
if (typeof input !== 'string') {
|
|
6759
|
+
throw new TypeError('Expected input to be a string');
|
|
6760
|
+
}
|
|
6761
|
+
|
|
6762
|
+
if (input === '') {
|
|
6763
|
+
return { isMatch: false, output: '' };
|
|
6764
|
+
}
|
|
6765
|
+
|
|
6766
|
+
const opts = options || {};
|
|
6767
|
+
const format = opts.format || (posix ? utils.toPosixSlashes : null);
|
|
6768
|
+
let match = input === glob;
|
|
6769
|
+
let output = (match && format) ? format(input) : input;
|
|
6770
|
+
|
|
6771
|
+
if (match === false) {
|
|
6772
|
+
output = format ? format(input) : input;
|
|
6773
|
+
match = output === glob;
|
|
6774
|
+
}
|
|
6775
|
+
|
|
6776
|
+
if (match === false || opts.capture === true) {
|
|
6777
|
+
if (opts.matchBase === true || opts.basename === true) {
|
|
6778
|
+
match = picomatch.matchBase(input, regex, options, posix);
|
|
6779
|
+
} else {
|
|
6780
|
+
match = regex.exec(output);
|
|
6781
|
+
}
|
|
6782
|
+
}
|
|
6783
|
+
|
|
6784
|
+
return { isMatch: Boolean(match), match, output };
|
|
6785
|
+
};
|
|
6786
|
+
|
|
6787
|
+
/**
|
|
6788
|
+
* Match the basename of a filepath.
|
|
6789
|
+
*
|
|
6790
|
+
* ```js
|
|
6791
|
+
* const picomatch = require('picomatch');
|
|
6792
|
+
* // picomatch.matchBase(input, glob[, options]);
|
|
6793
|
+
* console.log(picomatch.matchBase('foo/bar.js', '*.js'); // true
|
|
6794
|
+
* ```
|
|
6795
|
+
* @param {String} `input` String to test.
|
|
6796
|
+
* @param {RegExp|String} `glob` Glob pattern or regex created by [.makeRe](#makeRe).
|
|
6797
|
+
* @return {Boolean}
|
|
6798
|
+
* @api public
|
|
6799
|
+
*/
|
|
6800
|
+
|
|
6801
|
+
picomatch.matchBase = (input, glob, options, posix = options && options.windows) => {
|
|
6802
|
+
const regex = glob instanceof RegExp ? glob : picomatch.makeRe(glob, options);
|
|
6803
|
+
return regex.test(utils.basename(input, { windows: posix }));
|
|
6804
|
+
};
|
|
6805
|
+
|
|
6806
|
+
/**
|
|
6807
|
+
* Returns true if **any** of the given glob `patterns` match the specified `string`.
|
|
6808
|
+
*
|
|
6809
|
+
* ```js
|
|
6810
|
+
* const picomatch = require('picomatch');
|
|
6811
|
+
* // picomatch.isMatch(string, patterns[, options]);
|
|
6812
|
+
*
|
|
6813
|
+
* console.log(picomatch.isMatch('a.a', ['b.*', '*.a'])); //=> true
|
|
6814
|
+
* console.log(picomatch.isMatch('a.a', 'b.*')); //=> false
|
|
6815
|
+
* ```
|
|
6816
|
+
* @param {String|Array} str The string to test.
|
|
6817
|
+
* @param {String|Array} patterns One or more glob patterns to use for matching.
|
|
6818
|
+
* @param {Object} [options] See available [options](#options).
|
|
6819
|
+
* @return {Boolean} Returns true if any patterns match `str`
|
|
6820
|
+
* @api public
|
|
6821
|
+
*/
|
|
6822
|
+
|
|
6823
|
+
picomatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str);
|
|
6824
|
+
|
|
6825
|
+
/**
|
|
6826
|
+
* Parse a glob pattern to create the source string for a regular
|
|
6827
|
+
* expression.
|
|
6828
|
+
*
|
|
6829
|
+
* ```js
|
|
6830
|
+
* const picomatch = require('picomatch');
|
|
6831
|
+
* const result = picomatch.parse(pattern[, options]);
|
|
6832
|
+
* ```
|
|
6833
|
+
* @param {String} `pattern`
|
|
6834
|
+
* @param {Object} `options`
|
|
6835
|
+
* @return {Object} Returns an object with useful properties and output to be used as a regex source string.
|
|
6836
|
+
* @api public
|
|
6837
|
+
*/
|
|
6838
|
+
|
|
6839
|
+
picomatch.parse = (pattern, options) => {
|
|
6840
|
+
if (Array.isArray(pattern)) return pattern.map(p => picomatch.parse(p, options));
|
|
6841
|
+
return parse(pattern, { ...options, fastpaths: false });
|
|
6842
|
+
};
|
|
6843
|
+
|
|
6844
|
+
/**
|
|
6845
|
+
* Scan a glob pattern to separate the pattern into segments.
|
|
6846
|
+
*
|
|
6847
|
+
* ```js
|
|
6848
|
+
* const picomatch = require('picomatch');
|
|
6849
|
+
* // picomatch.scan(input[, options]);
|
|
6850
|
+
*
|
|
6851
|
+
* const result = picomatch.scan('!./foo/*.js');
|
|
6852
|
+
* console.log(result);
|
|
6853
|
+
* { prefix: '!./',
|
|
6854
|
+
* input: '!./foo/*.js',
|
|
6855
|
+
* start: 3,
|
|
6856
|
+
* base: 'foo',
|
|
6857
|
+
* glob: '*.js',
|
|
6858
|
+
* isBrace: false,
|
|
6859
|
+
* isBracket: false,
|
|
6860
|
+
* isGlob: true,
|
|
6861
|
+
* isExtglob: false,
|
|
6862
|
+
* isGlobstar: false,
|
|
6863
|
+
* negated: true }
|
|
6864
|
+
* ```
|
|
6865
|
+
* @param {String} `input` Glob pattern to scan.
|
|
6866
|
+
* @param {Object} `options`
|
|
6867
|
+
* @return {Object} Returns an object with
|
|
6868
|
+
* @api public
|
|
6869
|
+
*/
|
|
6870
|
+
|
|
6871
|
+
picomatch.scan = (input, options) => scan(input, options);
|
|
6872
|
+
|
|
6873
|
+
/**
|
|
6874
|
+
* Compile a regular expression from the `state` object returned by the
|
|
6875
|
+
* [parse()](#parse) method.
|
|
6876
|
+
*
|
|
6877
|
+
* ```js
|
|
6878
|
+
* const picomatch = require('picomatch');
|
|
6879
|
+
* const state = picomatch.parse('*.js');
|
|
6880
|
+
* // picomatch.compileRe(state[, options]);
|
|
6881
|
+
*
|
|
6882
|
+
* console.log(picomatch.compileRe(state));
|
|
6883
|
+
* //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/
|
|
6884
|
+
* ```
|
|
6885
|
+
* @param {Object} `state`
|
|
6886
|
+
* @param {Object} `options`
|
|
6887
|
+
* @param {Boolean} `returnOutput` Intended for implementors, this argument allows you to return the raw output from the parser.
|
|
6888
|
+
* @param {Boolean} `returnState` Adds the state to a `state` property on the returned regex. Useful for implementors and debugging.
|
|
6889
|
+
* @return {RegExp}
|
|
6890
|
+
* @api public
|
|
6891
|
+
*/
|
|
6892
|
+
|
|
6893
|
+
picomatch.compileRe = (state, options, returnOutput = false, returnState = false) => {
|
|
6894
|
+
if (returnOutput === true) {
|
|
6895
|
+
return state.output;
|
|
6896
|
+
}
|
|
6897
|
+
|
|
6898
|
+
const opts = options || {};
|
|
6899
|
+
const prepend = opts.contains ? '' : '^';
|
|
6900
|
+
const append = opts.contains ? '' : '$';
|
|
6901
|
+
|
|
6902
|
+
let source = `${prepend}(?:${state.output})${append}`;
|
|
6903
|
+
if (state && state.negated === true) {
|
|
6904
|
+
source = `^(?!${source}).*$`;
|
|
6905
|
+
}
|
|
6906
|
+
|
|
6907
|
+
const regex = picomatch.toRegex(source, options);
|
|
6908
|
+
if (returnState === true) {
|
|
6909
|
+
regex.state = state;
|
|
6910
|
+
}
|
|
6911
|
+
|
|
6912
|
+
return regex;
|
|
6913
|
+
};
|
|
6914
|
+
|
|
6915
|
+
/**
|
|
6916
|
+
* Create a regular expression from a parsed glob pattern.
|
|
6917
|
+
*
|
|
6918
|
+
* ```js
|
|
6919
|
+
* const picomatch = require('picomatch');
|
|
6920
|
+
* // picomatch.makeRe(state[, options]);
|
|
6921
|
+
*
|
|
6922
|
+
* const result = picomatch.makeRe('*.js');
|
|
6923
|
+
* console.log(result);
|
|
6924
|
+
* //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/
|
|
6925
|
+
* ```
|
|
6926
|
+
* @param {String} `state` The object returned from the `.parse` method.
|
|
6927
|
+
* @param {Object} `options`
|
|
6928
|
+
* @param {Boolean} `returnOutput` Implementors may use this argument to return the compiled output, instead of a regular expression. This is not exposed on the options to prevent end-users from mutating the result.
|
|
6929
|
+
* @param {Boolean} `returnState` Implementors may use this argument to return the state from the parsed glob with the returned regular expression.
|
|
6930
|
+
* @return {RegExp} Returns a regex created from the given pattern.
|
|
6931
|
+
* @api public
|
|
6932
|
+
*/
|
|
6933
|
+
|
|
6934
|
+
picomatch.makeRe = (input, options = {}, returnOutput = false, returnState = false) => {
|
|
6935
|
+
if (!input || typeof input !== 'string') {
|
|
6936
|
+
throw new TypeError('Expected a non-empty string');
|
|
6937
|
+
}
|
|
6938
|
+
|
|
6939
|
+
let parsed = { negated: false, fastpaths: true };
|
|
6940
|
+
|
|
6941
|
+
if (options.fastpaths !== false && (input[0] === '.' || input[0] === '*')) {
|
|
6942
|
+
parsed.output = parse.fastpaths(input, options);
|
|
6943
|
+
}
|
|
6944
|
+
|
|
6945
|
+
if (!parsed.output) {
|
|
6946
|
+
parsed = parse(input, options);
|
|
6947
|
+
}
|
|
6948
|
+
|
|
6949
|
+
return picomatch.compileRe(parsed, options, returnOutput, returnState);
|
|
6950
|
+
};
|
|
6951
|
+
|
|
6952
|
+
/**
|
|
6953
|
+
* Create a regular expression from the given regex source string.
|
|
6954
|
+
*
|
|
6955
|
+
* ```js
|
|
6956
|
+
* const picomatch = require('picomatch');
|
|
6957
|
+
* // picomatch.toRegex(source[, options]);
|
|
6958
|
+
*
|
|
6959
|
+
* const { output } = picomatch.parse('*.js');
|
|
6960
|
+
* console.log(picomatch.toRegex(output));
|
|
6961
|
+
* //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/
|
|
6962
|
+
* ```
|
|
6963
|
+
* @param {String} `source` Regular expression source string.
|
|
6964
|
+
* @param {Object} `options`
|
|
6965
|
+
* @return {RegExp}
|
|
6966
|
+
* @api public
|
|
6967
|
+
*/
|
|
6968
|
+
|
|
6969
|
+
picomatch.toRegex = (source, options) => {
|
|
6970
|
+
try {
|
|
6971
|
+
const opts = options || {};
|
|
6972
|
+
return new RegExp(source, opts.flags || (opts.nocase ? 'i' : ''));
|
|
6973
|
+
} catch (err) {
|
|
6974
|
+
if (options && options.debug === true) throw err;
|
|
6975
|
+
return /$^/;
|
|
6976
|
+
}
|
|
6977
|
+
};
|
|
6978
|
+
|
|
6979
|
+
/**
|
|
6980
|
+
* Picomatch constants.
|
|
6981
|
+
* @return {Object}
|
|
6982
|
+
*/
|
|
6983
|
+
|
|
6984
|
+
picomatch.constants = constants;
|
|
6985
|
+
|
|
6986
|
+
/**
|
|
6987
|
+
* Expose "picomatch"
|
|
6988
|
+
*/
|
|
6989
|
+
|
|
6990
|
+
module.exports = picomatch;
|
|
6991
|
+
|
|
6992
|
+
|
|
6993
|
+
/***/ }),
|
|
6994
|
+
|
|
6995
|
+
/***/ 5083:
|
|
6996
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
6997
|
+
|
|
6998
|
+
"use strict";
|
|
6999
|
+
|
|
7000
|
+
|
|
7001
|
+
const utils = __webpack_require__(4717);
|
|
7002
|
+
const {
|
|
7003
|
+
CHAR_ASTERISK, /* * */
|
|
7004
|
+
CHAR_AT, /* @ */
|
|
7005
|
+
CHAR_BACKWARD_SLASH, /* \ */
|
|
7006
|
+
CHAR_COMMA, /* , */
|
|
7007
|
+
CHAR_DOT, /* . */
|
|
7008
|
+
CHAR_EXCLAMATION_MARK, /* ! */
|
|
7009
|
+
CHAR_FORWARD_SLASH, /* / */
|
|
7010
|
+
CHAR_LEFT_CURLY_BRACE, /* { */
|
|
7011
|
+
CHAR_LEFT_PARENTHESES, /* ( */
|
|
7012
|
+
CHAR_LEFT_SQUARE_BRACKET, /* [ */
|
|
7013
|
+
CHAR_PLUS, /* + */
|
|
7014
|
+
CHAR_QUESTION_MARK, /* ? */
|
|
7015
|
+
CHAR_RIGHT_CURLY_BRACE, /* } */
|
|
7016
|
+
CHAR_RIGHT_PARENTHESES, /* ) */
|
|
7017
|
+
CHAR_RIGHT_SQUARE_BRACKET /* ] */
|
|
7018
|
+
} = __webpack_require__(553);
|
|
7019
|
+
|
|
7020
|
+
const isPathSeparator = code => {
|
|
7021
|
+
return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH;
|
|
7022
|
+
};
|
|
7023
|
+
|
|
7024
|
+
const depth = token => {
|
|
7025
|
+
if (token.isPrefix !== true) {
|
|
7026
|
+
token.depth = token.isGlobstar ? Infinity : 1;
|
|
7027
|
+
}
|
|
7028
|
+
};
|
|
7029
|
+
|
|
7030
|
+
/**
|
|
7031
|
+
* Quickly scans a glob pattern and returns an object with a handful of
|
|
7032
|
+
* useful properties, like `isGlob`, `path` (the leading non-glob, if it exists),
|
|
7033
|
+
* `glob` (the actual pattern), `negated` (true if the path starts with `!` but not
|
|
7034
|
+
* with `!(`) and `negatedExtglob` (true if the path starts with `!(`).
|
|
7035
|
+
*
|
|
7036
|
+
* ```js
|
|
7037
|
+
* const pm = require('picomatch');
|
|
7038
|
+
* console.log(pm.scan('foo/bar/*.js'));
|
|
7039
|
+
* { isGlob: true, input: 'foo/bar/*.js', base: 'foo/bar', glob: '*.js' }
|
|
7040
|
+
* ```
|
|
7041
|
+
* @param {String} `str`
|
|
7042
|
+
* @param {Object} `options`
|
|
7043
|
+
* @return {Object} Returns an object with tokens and regex source string.
|
|
7044
|
+
* @api public
|
|
7045
|
+
*/
|
|
7046
|
+
|
|
7047
|
+
const scan = (input, options) => {
|
|
7048
|
+
const opts = options || {};
|
|
7049
|
+
|
|
7050
|
+
const length = input.length - 1;
|
|
7051
|
+
const scanToEnd = opts.parts === true || opts.tokens === true || opts.scanToEnd === true;
|
|
7052
|
+
const slashes = [];
|
|
7053
|
+
const tokens = [];
|
|
7054
|
+
const parts = [];
|
|
7055
|
+
|
|
7056
|
+
let str = input;
|
|
7057
|
+
let index = -1;
|
|
7058
|
+
let start = 0;
|
|
7059
|
+
let lastIndex = 0;
|
|
7060
|
+
let isBrace = false;
|
|
7061
|
+
let isBracket = false;
|
|
7062
|
+
let isGlob = false;
|
|
7063
|
+
let isExtglob = false;
|
|
7064
|
+
let isGlobstar = false;
|
|
7065
|
+
let braceEscaped = false;
|
|
7066
|
+
let backslashes = false;
|
|
7067
|
+
let negated = false;
|
|
7068
|
+
let negatedExtglob = false;
|
|
7069
|
+
let finished = false;
|
|
7070
|
+
let braces = 0;
|
|
7071
|
+
let prev;
|
|
7072
|
+
let code;
|
|
7073
|
+
let token = { value: '', depth: 0, isGlob: false };
|
|
7074
|
+
|
|
7075
|
+
const eos = () => index >= length;
|
|
7076
|
+
const peek = () => str.charCodeAt(index + 1);
|
|
7077
|
+
const advance = () => {
|
|
7078
|
+
prev = code;
|
|
7079
|
+
return str.charCodeAt(++index);
|
|
7080
|
+
};
|
|
7081
|
+
|
|
7082
|
+
while (index < length) {
|
|
7083
|
+
code = advance();
|
|
7084
|
+
let next;
|
|
7085
|
+
|
|
7086
|
+
if (code === CHAR_BACKWARD_SLASH) {
|
|
7087
|
+
backslashes = token.backslashes = true;
|
|
7088
|
+
code = advance();
|
|
7089
|
+
|
|
7090
|
+
if (code === CHAR_LEFT_CURLY_BRACE) {
|
|
7091
|
+
braceEscaped = true;
|
|
7092
|
+
}
|
|
7093
|
+
continue;
|
|
7094
|
+
}
|
|
7095
|
+
|
|
7096
|
+
if (braceEscaped === true || code === CHAR_LEFT_CURLY_BRACE) {
|
|
7097
|
+
braces++;
|
|
7098
|
+
|
|
7099
|
+
while (eos() !== true && (code = advance())) {
|
|
7100
|
+
if (code === CHAR_BACKWARD_SLASH) {
|
|
7101
|
+
backslashes = token.backslashes = true;
|
|
7102
|
+
advance();
|
|
7103
|
+
continue;
|
|
7104
|
+
}
|
|
7105
|
+
|
|
7106
|
+
if (code === CHAR_LEFT_CURLY_BRACE) {
|
|
7107
|
+
braces++;
|
|
7108
|
+
continue;
|
|
7109
|
+
}
|
|
7110
|
+
|
|
7111
|
+
if (braceEscaped !== true && code === CHAR_DOT && (code = advance()) === CHAR_DOT) {
|
|
7112
|
+
isBrace = token.isBrace = true;
|
|
7113
|
+
isGlob = token.isGlob = true;
|
|
7114
|
+
finished = true;
|
|
7115
|
+
|
|
7116
|
+
if (scanToEnd === true) {
|
|
7117
|
+
continue;
|
|
7118
|
+
}
|
|
7119
|
+
|
|
7120
|
+
break;
|
|
7121
|
+
}
|
|
7122
|
+
|
|
7123
|
+
if (braceEscaped !== true && code === CHAR_COMMA) {
|
|
7124
|
+
isBrace = token.isBrace = true;
|
|
7125
|
+
isGlob = token.isGlob = true;
|
|
7126
|
+
finished = true;
|
|
7127
|
+
|
|
7128
|
+
if (scanToEnd === true) {
|
|
7129
|
+
continue;
|
|
7130
|
+
}
|
|
7131
|
+
|
|
7132
|
+
break;
|
|
7133
|
+
}
|
|
7134
|
+
|
|
7135
|
+
if (code === CHAR_RIGHT_CURLY_BRACE) {
|
|
7136
|
+
braces--;
|
|
7137
|
+
|
|
7138
|
+
if (braces === 0) {
|
|
7139
|
+
braceEscaped = false;
|
|
7140
|
+
isBrace = token.isBrace = true;
|
|
7141
|
+
finished = true;
|
|
7142
|
+
break;
|
|
7143
|
+
}
|
|
7144
|
+
}
|
|
7145
|
+
}
|
|
7146
|
+
|
|
7147
|
+
if (scanToEnd === true) {
|
|
7148
|
+
continue;
|
|
7149
|
+
}
|
|
7150
|
+
|
|
7151
|
+
break;
|
|
7152
|
+
}
|
|
7153
|
+
|
|
7154
|
+
if (code === CHAR_FORWARD_SLASH) {
|
|
7155
|
+
slashes.push(index);
|
|
7156
|
+
tokens.push(token);
|
|
7157
|
+
token = { value: '', depth: 0, isGlob: false };
|
|
7158
|
+
|
|
7159
|
+
if (finished === true) continue;
|
|
7160
|
+
if (prev === CHAR_DOT && index === (start + 1)) {
|
|
7161
|
+
start += 2;
|
|
7162
|
+
continue;
|
|
7163
|
+
}
|
|
7164
|
+
|
|
7165
|
+
lastIndex = index + 1;
|
|
7166
|
+
continue;
|
|
7167
|
+
}
|
|
7168
|
+
|
|
7169
|
+
if (opts.noext !== true) {
|
|
7170
|
+
const isExtglobChar = code === CHAR_PLUS
|
|
7171
|
+
|| code === CHAR_AT
|
|
7172
|
+
|| code === CHAR_ASTERISK
|
|
7173
|
+
|| code === CHAR_QUESTION_MARK
|
|
7174
|
+
|| code === CHAR_EXCLAMATION_MARK;
|
|
7175
|
+
|
|
7176
|
+
if (isExtglobChar === true && peek() === CHAR_LEFT_PARENTHESES) {
|
|
7177
|
+
isGlob = token.isGlob = true;
|
|
7178
|
+
isExtglob = token.isExtglob = true;
|
|
7179
|
+
finished = true;
|
|
7180
|
+
if (code === CHAR_EXCLAMATION_MARK && index === start) {
|
|
7181
|
+
negatedExtglob = true;
|
|
7182
|
+
}
|
|
7183
|
+
|
|
7184
|
+
if (scanToEnd === true) {
|
|
7185
|
+
let parens = 0;
|
|
7186
|
+
|
|
7187
|
+
while (eos() !== true && (code = advance())) {
|
|
7188
|
+
if (code === CHAR_BACKWARD_SLASH) {
|
|
7189
|
+
backslashes = token.backslashes = true;
|
|
7190
|
+
advance();
|
|
7191
|
+
continue;
|
|
7192
|
+
}
|
|
7193
|
+
|
|
7194
|
+
if (code === CHAR_LEFT_PARENTHESES) {
|
|
7195
|
+
parens++;
|
|
7196
|
+
continue;
|
|
7197
|
+
}
|
|
7198
|
+
|
|
7199
|
+
if (code === CHAR_RIGHT_PARENTHESES && --parens === 0) {
|
|
7200
|
+
finished = true;
|
|
7201
|
+
break;
|
|
7202
|
+
}
|
|
7203
|
+
}
|
|
7204
|
+
continue;
|
|
7205
|
+
}
|
|
7206
|
+
break;
|
|
7207
|
+
}
|
|
7208
|
+
}
|
|
7209
|
+
|
|
7210
|
+
if (code === CHAR_ASTERISK) {
|
|
7211
|
+
if (prev === CHAR_ASTERISK) isGlobstar = token.isGlobstar = true;
|
|
7212
|
+
isGlob = token.isGlob = true;
|
|
7213
|
+
finished = true;
|
|
7214
|
+
|
|
7215
|
+
if (scanToEnd === true) {
|
|
7216
|
+
continue;
|
|
7217
|
+
}
|
|
7218
|
+
break;
|
|
7219
|
+
}
|
|
7220
|
+
|
|
7221
|
+
if (code === CHAR_QUESTION_MARK) {
|
|
7222
|
+
isGlob = token.isGlob = true;
|
|
7223
|
+
finished = true;
|
|
7224
|
+
|
|
7225
|
+
if (scanToEnd === true) {
|
|
7226
|
+
continue;
|
|
7227
|
+
}
|
|
7228
|
+
break;
|
|
7229
|
+
}
|
|
7230
|
+
|
|
7231
|
+
if (code === CHAR_LEFT_SQUARE_BRACKET) {
|
|
7232
|
+
while (eos() !== true && (next = advance())) {
|
|
7233
|
+
if (next === CHAR_BACKWARD_SLASH) {
|
|
7234
|
+
backslashes = token.backslashes = true;
|
|
7235
|
+
advance();
|
|
7236
|
+
continue;
|
|
7237
|
+
}
|
|
7238
|
+
|
|
7239
|
+
if (next === CHAR_RIGHT_SQUARE_BRACKET) {
|
|
7240
|
+
isBracket = token.isBracket = true;
|
|
7241
|
+
isGlob = token.isGlob = true;
|
|
7242
|
+
finished = true;
|
|
7243
|
+
break;
|
|
7244
|
+
}
|
|
7245
|
+
}
|
|
7246
|
+
|
|
7247
|
+
if (scanToEnd === true) {
|
|
7248
|
+
continue;
|
|
7249
|
+
}
|
|
7250
|
+
|
|
7251
|
+
break;
|
|
7252
|
+
}
|
|
7253
|
+
|
|
7254
|
+
if (opts.nonegate !== true && code === CHAR_EXCLAMATION_MARK && index === start) {
|
|
7255
|
+
negated = token.negated = true;
|
|
7256
|
+
start++;
|
|
7257
|
+
continue;
|
|
7258
|
+
}
|
|
7259
|
+
|
|
7260
|
+
if (opts.noparen !== true && code === CHAR_LEFT_PARENTHESES) {
|
|
7261
|
+
isGlob = token.isGlob = true;
|
|
7262
|
+
|
|
7263
|
+
if (scanToEnd === true) {
|
|
7264
|
+
let parens = 1;
|
|
7265
|
+
|
|
7266
|
+
while (eos() !== true && (code = advance())) {
|
|
7267
|
+
if (code === CHAR_BACKWARD_SLASH) {
|
|
7268
|
+
backslashes = token.backslashes = true;
|
|
7269
|
+
advance();
|
|
7270
|
+
continue;
|
|
7271
|
+
}
|
|
7272
|
+
|
|
7273
|
+
if (code === CHAR_LEFT_PARENTHESES) {
|
|
7274
|
+
parens++;
|
|
7275
|
+
continue;
|
|
7276
|
+
}
|
|
7277
|
+
|
|
7278
|
+
if (code === CHAR_RIGHT_PARENTHESES && --parens === 0) {
|
|
7279
|
+
finished = true;
|
|
7280
|
+
break;
|
|
7281
|
+
}
|
|
7282
|
+
}
|
|
7283
|
+
continue;
|
|
7284
|
+
}
|
|
7285
|
+
break;
|
|
7286
|
+
}
|
|
7287
|
+
|
|
7288
|
+
if (isGlob === true) {
|
|
7289
|
+
finished = true;
|
|
7290
|
+
|
|
7291
|
+
if (scanToEnd === true) {
|
|
7292
|
+
continue;
|
|
7293
|
+
}
|
|
7294
|
+
|
|
7295
|
+
break;
|
|
7296
|
+
}
|
|
7297
|
+
}
|
|
7298
|
+
|
|
7299
|
+
if (opts.noext === true) {
|
|
7300
|
+
isExtglob = false;
|
|
7301
|
+
isGlob = false;
|
|
7302
|
+
}
|
|
7303
|
+
|
|
7304
|
+
let base = str;
|
|
7305
|
+
let prefix = '';
|
|
7306
|
+
let glob = '';
|
|
7307
|
+
|
|
7308
|
+
if (start > 0) {
|
|
7309
|
+
prefix = str.slice(0, start);
|
|
7310
|
+
str = str.slice(start);
|
|
7311
|
+
lastIndex -= start;
|
|
7312
|
+
}
|
|
7313
|
+
|
|
7314
|
+
if (base && isGlob === true && lastIndex > 0) {
|
|
7315
|
+
base = str.slice(0, lastIndex);
|
|
7316
|
+
glob = str.slice(lastIndex);
|
|
7317
|
+
} else if (isGlob === true) {
|
|
7318
|
+
base = '';
|
|
7319
|
+
glob = str;
|
|
7320
|
+
} else {
|
|
7321
|
+
base = str;
|
|
7322
|
+
}
|
|
7323
|
+
|
|
7324
|
+
if (base && base !== '' && base !== '/' && base !== str) {
|
|
7325
|
+
if (isPathSeparator(base.charCodeAt(base.length - 1))) {
|
|
7326
|
+
base = base.slice(0, -1);
|
|
7327
|
+
}
|
|
7328
|
+
}
|
|
7329
|
+
|
|
7330
|
+
if (opts.unescape === true) {
|
|
7331
|
+
if (glob) glob = utils.removeBackslashes(glob);
|
|
7332
|
+
|
|
7333
|
+
if (base && backslashes === true) {
|
|
7334
|
+
base = utils.removeBackslashes(base);
|
|
7335
|
+
}
|
|
7336
|
+
}
|
|
7337
|
+
|
|
7338
|
+
const state = {
|
|
7339
|
+
prefix,
|
|
7340
|
+
input,
|
|
7341
|
+
start,
|
|
7342
|
+
base,
|
|
7343
|
+
glob,
|
|
7344
|
+
isBrace,
|
|
7345
|
+
isBracket,
|
|
7346
|
+
isGlob,
|
|
7347
|
+
isExtglob,
|
|
7348
|
+
isGlobstar,
|
|
7349
|
+
negated,
|
|
7350
|
+
negatedExtglob
|
|
7351
|
+
};
|
|
7352
|
+
|
|
7353
|
+
if (opts.tokens === true) {
|
|
7354
|
+
state.maxDepth = 0;
|
|
7355
|
+
if (!isPathSeparator(code)) {
|
|
7356
|
+
tokens.push(token);
|
|
7357
|
+
}
|
|
7358
|
+
state.tokens = tokens;
|
|
7359
|
+
}
|
|
7360
|
+
|
|
7361
|
+
if (opts.parts === true || opts.tokens === true) {
|
|
7362
|
+
let prevIndex;
|
|
7363
|
+
|
|
7364
|
+
for (let idx = 0; idx < slashes.length; idx++) {
|
|
7365
|
+
const n = prevIndex !== undefined ? prevIndex + 1 : start;
|
|
7366
|
+
const i = slashes[idx];
|
|
7367
|
+
const value = input.slice(n, i);
|
|
7368
|
+
if (opts.tokens) {
|
|
7369
|
+
if (idx === 0 && start !== 0) {
|
|
7370
|
+
tokens[idx].isPrefix = true;
|
|
7371
|
+
tokens[idx].value = prefix;
|
|
7372
|
+
} else {
|
|
7373
|
+
tokens[idx].value = value;
|
|
7374
|
+
}
|
|
7375
|
+
depth(tokens[idx]);
|
|
7376
|
+
state.maxDepth += tokens[idx].depth;
|
|
7377
|
+
}
|
|
7378
|
+
if (i >= start) {
|
|
7379
|
+
parts.push(value);
|
|
7380
|
+
prevIndex = i;
|
|
7381
|
+
}
|
|
7382
|
+
}
|
|
7383
|
+
|
|
7384
|
+
const n = prevIndex !== undefined ? prevIndex + 1 : start;
|
|
7385
|
+
const value = input.slice(n);
|
|
7386
|
+
parts.push(value);
|
|
7387
|
+
|
|
7388
|
+
if (opts.tokens && prevIndex && prevIndex + 1 < input.length) {
|
|
7389
|
+
tokens[tokens.length - 1].value = value;
|
|
7390
|
+
depth(tokens[tokens.length - 1]);
|
|
7391
|
+
state.maxDepth += tokens[tokens.length - 1].depth;
|
|
7392
|
+
}
|
|
7393
|
+
|
|
7394
|
+
state.slashes = slashes;
|
|
7395
|
+
state.parts = parts;
|
|
7396
|
+
}
|
|
7397
|
+
|
|
7398
|
+
return state;
|
|
7399
|
+
};
|
|
7400
|
+
|
|
7401
|
+
module.exports = scan;
|
|
7402
|
+
|
|
7403
|
+
|
|
7404
|
+
/***/ }),
|
|
7405
|
+
|
|
7406
|
+
/***/ 4717:
|
|
7407
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
7408
|
+
|
|
7409
|
+
"use strict";
|
|
7410
|
+
/*global navigator*/
|
|
7411
|
+
|
|
7412
|
+
|
|
7413
|
+
const {
|
|
7414
|
+
REGEX_BACKSLASH,
|
|
7415
|
+
REGEX_REMOVE_BACKSLASH,
|
|
7416
|
+
REGEX_SPECIAL_CHARS,
|
|
7417
|
+
REGEX_SPECIAL_CHARS_GLOBAL
|
|
7418
|
+
} = __webpack_require__(553);
|
|
7419
|
+
|
|
7420
|
+
exports.isObject = val => val !== null && typeof val === 'object' && !Array.isArray(val);
|
|
7421
|
+
exports.hasRegexChars = str => REGEX_SPECIAL_CHARS.test(str);
|
|
7422
|
+
exports.isRegexChar = str => str.length === 1 && exports.hasRegexChars(str);
|
|
7423
|
+
exports.escapeRegex = str => str.replace(REGEX_SPECIAL_CHARS_GLOBAL, '\\$1');
|
|
7424
|
+
exports.toPosixSlashes = str => str.replace(REGEX_BACKSLASH, '/');
|
|
7425
|
+
|
|
7426
|
+
exports.isWindows = () => {
|
|
7427
|
+
if (typeof navigator !== 'undefined' && navigator.platform) {
|
|
7428
|
+
const platform = navigator.platform.toLowerCase();
|
|
7429
|
+
return platform === 'win32' || platform === 'windows';
|
|
7430
|
+
}
|
|
7431
|
+
|
|
7432
|
+
if (typeof process !== 'undefined' && process.platform) {
|
|
7433
|
+
return process.platform === 'win32';
|
|
7434
|
+
}
|
|
7435
|
+
|
|
7436
|
+
return false;
|
|
7437
|
+
};
|
|
7438
|
+
|
|
7439
|
+
exports.removeBackslashes = str => {
|
|
7440
|
+
return str.replace(REGEX_REMOVE_BACKSLASH, match => {
|
|
7441
|
+
return match === '\\' ? '' : match;
|
|
7442
|
+
});
|
|
7443
|
+
};
|
|
7444
|
+
|
|
7445
|
+
exports.escapeLast = (input, char, lastIdx) => {
|
|
7446
|
+
const idx = input.lastIndexOf(char, lastIdx);
|
|
7447
|
+
if (idx === -1) return input;
|
|
7448
|
+
if (input[idx - 1] === '\\') return exports.escapeLast(input, char, idx - 1);
|
|
7449
|
+
return `${input.slice(0, idx)}\\${input.slice(idx)}`;
|
|
7450
|
+
};
|
|
7451
|
+
|
|
7452
|
+
exports.removePrefix = (input, state = {}) => {
|
|
7453
|
+
let output = input;
|
|
7454
|
+
if (output.startsWith('./')) {
|
|
7455
|
+
output = output.slice(2);
|
|
7456
|
+
state.prefix = './';
|
|
7457
|
+
}
|
|
7458
|
+
return output;
|
|
7459
|
+
};
|
|
7460
|
+
|
|
7461
|
+
exports.wrapOutput = (input, state = {}, options = {}) => {
|
|
7462
|
+
const prepend = options.contains ? '' : '^';
|
|
7463
|
+
const append = options.contains ? '' : '$';
|
|
7464
|
+
|
|
7465
|
+
let output = `${prepend}(?:${input})${append}`;
|
|
7466
|
+
if (state.negated === true) {
|
|
7467
|
+
output = `(?:^(?!${output}).*$)`;
|
|
7468
|
+
}
|
|
7469
|
+
return output;
|
|
7470
|
+
};
|
|
7471
|
+
|
|
7472
|
+
exports.basename = (path, { windows } = {}) => {
|
|
7473
|
+
const segs = path.split(windows ? /[\\/]/ : '/');
|
|
7474
|
+
const last = segs[segs.length - 1];
|
|
7475
|
+
|
|
7476
|
+
if (last === '') {
|
|
7477
|
+
return segs[segs.length - 2];
|
|
7478
|
+
}
|
|
7479
|
+
|
|
7480
|
+
return last;
|
|
7481
|
+
};
|
|
7482
|
+
|
|
7483
|
+
|
|
4974
7484
|
/***/ }),
|
|
4975
7485
|
|
|
4976
7486
|
/***/ 3066:
|
|
@@ -11762,31 +14272,6 @@ function bisearch(ucs) {
|
|
|
11762
14272
|
}
|
|
11763
14273
|
|
|
11764
14274
|
|
|
11765
|
-
/***/ }),
|
|
11766
|
-
|
|
11767
|
-
/***/ 9337:
|
|
11768
|
-
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|
11769
|
-
|
|
11770
|
-
"use strict";
|
|
11771
|
-
var node_fs__WEBPACK_IMPORTED_MODULE_3___namespace_cache;
|
|
11772
|
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
11773
|
-
/* harmony export */ TI: () => (/* binding */ Ze)
|
|
11774
|
-
/* harmony export */ });
|
|
11775
|
-
/* unused harmony exports Glob, Ignore, escape, globIterate, globIterateSync, globStream, globStreamSync, globSync, hasMagic, iterate, iterateSync, stream, streamSync, sync, unescape */
|
|
11776
|
-
/* harmony import */ var node_url__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3136);
|
|
11777
|
-
/* harmony import */ var node_path__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6760);
|
|
11778
|
-
/* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9896);
|
|
11779
|
-
/* harmony import */ var node_fs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(3024);
|
|
11780
|
-
/* harmony import */ var node_fs_promises__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1455);
|
|
11781
|
-
/* harmony import */ var node_events__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(8474);
|
|
11782
|
-
/* harmony import */ var node_stream__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(7075);
|
|
11783
|
-
/* harmony import */ var node_string_decoder__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(6193);
|
|
11784
|
-
var Gt=(n,t,e)=>{let s=n instanceof RegExp?ce(n,e):n,i=t instanceof RegExp?ce(t,e):t,r=s!==null&&i!=null&&ss(s,i,e);return r&&{start:r[0],end:r[1],pre:e.slice(0,r[0]),body:e.slice(r[0]+s.length,r[1]),post:e.slice(r[1]+i.length)}},ce=(n,t)=>{let e=t.match(n);return e?e[0]:null},ss=(n,t,e)=>{let s,i,r,o,h,a=e.indexOf(n),l=e.indexOf(t,a+1),u=a;if(a>=0&&l>0){if(n===t)return[a,l];for(s=[],r=e.length;u>=0&&!h;){if(u===a)s.push(u),a=e.indexOf(n,u+1);else if(s.length===1){let c=s.pop();c!==void 0&&(h=[c,l])}else i=s.pop(),i!==void 0&&i<r&&(r=i,o=l),l=e.indexOf(t,u+1);u=a<l&&a>=0?a:l}s.length&&o!==void 0&&(h=[r,o])}return h};var fe="\0SLASH"+Math.random()+"\0",ue="\0OPEN"+Math.random()+"\0",qt="\0CLOSE"+Math.random()+"\0",de="\0COMMA"+Math.random()+"\0",pe="\0PERIOD"+Math.random()+"\0",is=new RegExp(fe,"g"),rs=new RegExp(ue,"g"),ns=new RegExp(qt,"g"),os=new RegExp(de,"g"),hs=new RegExp(pe,"g"),as=/\\\\/g,ls=/\\{/g,cs=/\\}/g,fs=/\\,/g,us=/\\./g,ds=1e5;function Ht(n){return isNaN(n)?n.charCodeAt(0):parseInt(n,10)}function ps(n){return n.replace(as,fe).replace(ls,ue).replace(cs,qt).replace(fs,de).replace(us,pe)}function ms(n){return n.replace(is,"\\").replace(rs,"{").replace(ns,"}").replace(os,",").replace(hs,".")}function me(n){if(!n)return[""];let t=[],e=Gt("{","}",n);if(!e)return n.split(",");let{pre:s,body:i,post:r}=e,o=s.split(",");o[o.length-1]+="{"+i+"}";let h=me(r);return r.length&&(o[o.length-1]+=h.shift(),o.push.apply(o,h)),t.push.apply(t,o),t}function ge(n,t={}){if(!n)return[];let{max:e=ds}=t;return n.slice(0,2)==="{}"&&(n="\\{\\}"+n.slice(2)),ht(ps(n),e,!0).map(ms)}function gs(n){return"{"+n+"}"}function ws(n){return/^-?0\d/.test(n)}function ys(n,t){return n<=t}function bs(n,t){return n>=t}function ht(n,t,e){let s=[],i=Gt("{","}",n);if(!i)return[n];let r=i.pre,o=i.post.length?ht(i.post,t,!1):[""];if(/\$$/.test(i.pre))for(let h=0;h<o.length&&h<t;h++){let a=r+"{"+i.body+"}"+o[h];s.push(a)}else{let h=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(i.body),a=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(i.body),l=h||a,u=i.body.indexOf(",")>=0;if(!l&&!u)return i.post.match(/,(?!,).*\}/)?(n=i.pre+"{"+i.body+qt+i.post,ht(n,t,!0)):[n];let c;if(l)c=i.body.split(/\.\./);else if(c=me(i.body),c.length===1&&c[0]!==void 0&&(c=ht(c[0],t,!1).map(gs),c.length===1))return o.map(f=>i.pre+c[0]+f);let d;if(l&&c[0]!==void 0&&c[1]!==void 0){let f=Ht(c[0]),m=Ht(c[1]),p=Math.max(c[0].length,c[1].length),w=c.length===3&&c[2]!==void 0?Math.abs(Ht(c[2])):1,g=ys;m<f&&(w*=-1,g=bs);let E=c.some(ws);d=[];for(let y=f;g(y,m);y+=w){let b;if(a)b=String.fromCharCode(y),b==="\\"&&(b="");else if(b=String(y),E){let z=p-b.length;if(z>0){let $=new Array(z+1).join("0");y<0?b="-"+$+b.slice(1):b=$+b}}d.push(b)}}else{d=[];for(let f=0;f<c.length;f++)d.push.apply(d,ht(c[f],t,!1))}for(let f=0;f<d.length;f++)for(let m=0;m<o.length&&s.length<t;m++){let p=r+d[f]+o[m];(!e||l||p)&&s.push(p)}}return s}var at=n=>{if(typeof n!="string")throw new TypeError("invalid pattern");if(n.length>65536)throw new TypeError("pattern is too long")};var Ss={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},lt=n=>n.replace(/[[\]\\-]/g,"\\$&"),Es=n=>n.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),we=n=>n.join(""),ye=(n,t)=>{let e=t;if(n.charAt(e)!=="[")throw new Error("not in a brace expression");let s=[],i=[],r=e+1,o=!1,h=!1,a=!1,l=!1,u=e,c="";t:for(;r<n.length;){let p=n.charAt(r);if((p==="!"||p==="^")&&r===e+1){l=!0,r++;continue}if(p==="]"&&o&&!a){u=r+1;break}if(o=!0,p==="\\"&&!a){a=!0,r++;continue}if(p==="["&&!a){for(let[w,[g,S,E]]of Object.entries(Ss))if(n.startsWith(w,r)){if(c)return["$.",!1,n.length-e,!0];r+=w.length,E?i.push(g):s.push(g),h=h||S;continue t}}if(a=!1,c){p>c?s.push(lt(c)+"-"+lt(p)):p===c&&s.push(lt(p)),c="",r++;continue}if(n.startsWith("-]",r+1)){s.push(lt(p+"-")),r+=2;continue}if(n.startsWith("-",r+1)){c=p,r+=2;continue}s.push(lt(p)),r++}if(u<r)return["",!1,0,!1];if(!s.length&&!i.length)return["$.",!1,n.length-e,!0];if(i.length===0&&s.length===1&&/^\\?.$/.test(s[0])&&!l){let p=s[0].length===2?s[0].slice(-1):s[0];return[Es(p),!1,u-e,!1]}let d="["+(l?"^":"")+we(s)+"]",f="["+(l?"":"^")+we(i)+"]";return[s.length&&i.length?"("+d+"|"+f+")":s.length?d:f,h,u-e,!0]};var W=(n,{windowsPathsNoEscape:t=!1,magicalBraces:e=!0}={})=>e?t?n.replace(/\[([^\/\\])\]/g,"$1"):n.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1"):t?n.replace(/\[([^\/\\{}])\]/g,"$1"):n.replace(/((?!\\).|^)\[([^\/\\{}])\]/g,"$1$2").replace(/\\([^\/{}])/g,"$1");var xs=new Set(["!","?","+","*","@"]),be=n=>xs.has(n),vs="(?!(?:^|/)\\.\\.?(?:$|/))",Ct="(?!\\.)",Cs=new Set(["[","."]),Ts=new Set(["..","."]),As=new Set("().*{}+?[]^$\\!"),ks=n=>n.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Kt="[^/]",Se=Kt+"*?",Ee=Kt+"+?",Q=class n{type;#t;#s;#n=!1;#r=[];#o;#S;#w;#c=!1;#h;#u;#f=!1;constructor(t,e,s={}){this.type=t,t&&(this.#s=!0),this.#o=e,this.#t=this.#o?this.#o.#t:this,this.#h=this.#t===this?s:this.#t.#h,this.#w=this.#t===this?[]:this.#t.#w,t==="!"&&!this.#t.#c&&this.#w.push(this),this.#S=this.#o?this.#o.#r.length:0}get hasMagic(){if(this.#s!==void 0)return this.#s;for(let t of this.#r)if(typeof t!="string"&&(t.type||t.hasMagic))return this.#s=!0;return this.#s}toString(){return this.#u!==void 0?this.#u:this.type?this.#u=this.type+"("+this.#r.map(t=>String(t)).join("|")+")":this.#u=this.#r.map(t=>String(t)).join("")}#a(){if(this!==this.#t)throw new Error("should only call on root");if(this.#c)return this;this.toString(),this.#c=!0;let t;for(;t=this.#w.pop();){if(t.type!=="!")continue;let e=t,s=e.#o;for(;s;){for(let i=e.#S+1;!s.type&&i<s.#r.length;i++)for(let r of t.#r){if(typeof r=="string")throw new Error("string part in extglob AST??");r.copyIn(s.#r[i])}e=s,s=e.#o}}return this}push(...t){for(let e of t)if(e!==""){if(typeof e!="string"&&!(e instanceof n&&e.#o===this))throw new Error("invalid part: "+e);this.#r.push(e)}}toJSON(){let t=this.type===null?this.#r.slice().map(e=>typeof e=="string"?e:e.toJSON()):[this.type,...this.#r.map(e=>e.toJSON())];return this.isStart()&&!this.type&&t.unshift([]),this.isEnd()&&(this===this.#t||this.#t.#c&&this.#o?.type==="!")&&t.push({}),t}isStart(){if(this.#t===this)return!0;if(!this.#o?.isStart())return!1;if(this.#S===0)return!0;let t=this.#o;for(let e=0;e<this.#S;e++){let s=t.#r[e];if(!(s instanceof n&&s.type==="!"))return!1}return!0}isEnd(){if(this.#t===this||this.#o?.type==="!")return!0;if(!this.#o?.isEnd())return!1;if(!this.type)return this.#o?.isEnd();let t=this.#o?this.#o.#r.length:0;return this.#S===t-1}copyIn(t){typeof t=="string"?this.push(t):this.push(t.clone(this))}clone(t){let e=new n(this.type,t);for(let s of this.#r)e.copyIn(s);return e}static#i(t,e,s,i){let r=!1,o=!1,h=-1,a=!1;if(e.type===null){let f=s,m="";for(;f<t.length;){let p=t.charAt(f++);if(r||p==="\\"){r=!r,m+=p;continue}if(o){f===h+1?(p==="^"||p==="!")&&(a=!0):p==="]"&&!(f===h+2&&a)&&(o=!1),m+=p;continue}else if(p==="["){o=!0,h=f,a=!1,m+=p;continue}if(!i.noext&&be(p)&&t.charAt(f)==="("){e.push(m),m="";let w=new n(p,e);f=n.#i(t,w,f,i),e.push(w);continue}m+=p}return e.push(m),f}let l=s+1,u=new n(null,e),c=[],d="";for(;l<t.length;){let f=t.charAt(l++);if(r||f==="\\"){r=!r,d+=f;continue}if(o){l===h+1?(f==="^"||f==="!")&&(a=!0):f==="]"&&!(l===h+2&&a)&&(o=!1),d+=f;continue}else if(f==="["){o=!0,h=l,a=!1,d+=f;continue}if(be(f)&&t.charAt(l)==="("){u.push(d),d="";let m=new n(f,u);u.push(m),l=n.#i(t,m,l,i);continue}if(f==="|"){u.push(d),d="",c.push(u),u=new n(null,e);continue}if(f===")")return d===""&&e.#r.length===0&&(e.#f=!0),u.push(d),d="",e.push(...c,u),l;d+=f}return e.type=null,e.#s=void 0,e.#r=[t.substring(s-1)],l}static fromGlob(t,e={}){let s=new n(null,void 0,e);return n.#i(t,s,0,e),s}toMMPattern(){if(this!==this.#t)return this.#t.toMMPattern();let t=this.toString(),[e,s,i,r]=this.toRegExpSource();if(!(i||this.#s||this.#h.nocase&&!this.#h.nocaseMagicOnly&&t.toUpperCase()!==t.toLowerCase()))return s;let h=(this.#h.nocase?"i":"")+(r?"u":"");return Object.assign(new RegExp(`^${e}$`,h),{_src:e,_glob:t})}get options(){return this.#h}toRegExpSource(t){let e=t??!!this.#h.dot;if(this.#t===this&&this.#a(),!this.type){let a=this.isStart()&&this.isEnd()&&!this.#r.some(f=>typeof f!="string"),l=this.#r.map(f=>{let[m,p,w,g]=typeof f=="string"?n.#E(f,this.#s,a):f.toRegExpSource(t);return this.#s=this.#s||w,this.#n=this.#n||g,m}).join(""),u="";if(this.isStart()&&typeof this.#r[0]=="string"&&!(this.#r.length===1&&Ts.has(this.#r[0]))){let m=Cs,p=e&&m.has(l.charAt(0))||l.startsWith("\\.")&&m.has(l.charAt(2))||l.startsWith("\\.\\.")&&m.has(l.charAt(4)),w=!e&&!t&&m.has(l.charAt(0));u=p?vs:w?Ct:""}let c="";return this.isEnd()&&this.#t.#c&&this.#o?.type==="!"&&(c="(?:$|\\/)"),[u+l+c,W(l),this.#s=!!this.#s,this.#n]}let s=this.type==="*"||this.type==="+",i=this.type==="!"?"(?:(?!(?:":"(?:",r=this.#d(e);if(this.isStart()&&this.isEnd()&&!r&&this.type!=="!"){let a=this.toString();return this.#r=[a],this.type=null,this.#s=void 0,[a,W(this.toString()),!1,!1]}let o=!s||t||e||!Ct?"":this.#d(!0);o===r&&(o=""),o&&(r=`(?:${r})(?:${o})*?`);let h="";if(this.type==="!"&&this.#f)h=(this.isStart()&&!e?Ct:"")+Ee;else{let a=this.type==="!"?"))"+(this.isStart()&&!e&&!t?Ct:"")+Se+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&o?")":this.type==="*"&&o?")?":`)${this.type}`;h=i+r+a}return[h,W(r),this.#s=!!this.#s,this.#n]}#d(t){return this.#r.map(e=>{if(typeof e=="string")throw new Error("string type in extglob ast??");let[s,i,r,o]=e.toRegExpSource(t);return this.#n=this.#n||o,s}).filter(e=>!(this.isStart()&&this.isEnd())||!!e).join("|")}static#E(t,e,s=!1){let i=!1,r="",o=!1,h=!1;for(let a=0;a<t.length;a++){let l=t.charAt(a);if(i){i=!1,r+=(As.has(l)?"\\":"")+l;continue}if(l==="*"){if(h)continue;h=!0,r+=s&&/^[*]+$/.test(t)?Ee:Se,e=!0;continue}else h=!1;if(l==="\\"){a===t.length-1?r+="\\\\":i=!0;continue}if(l==="["){let[u,c,d,f]=ye(t,a);if(d){r+=u,o=o||c,a+=d-1,e=e||f;continue}}if(l==="?"){r+=Kt,e=!0;continue}r+=ks(l)}return[r,W(t),!!e,o]}};var tt=(n,{windowsPathsNoEscape:t=!1,magicalBraces:e=!1}={})=>e?t?n.replace(/[?*()[\]{}]/g,"[$&]"):n.replace(/[?*()[\]\\{}]/g,"\\$&"):t?n.replace(/[?*()[\]]/g,"[$&]"):n.replace(/[?*()[\]\\]/g,"\\$&");var O=(n,t,e={})=>(at(t),!e.nocomment&&t.charAt(0)==="#"?!1:new D(t,e).match(n)),Rs=/^\*+([^+@!?\*\[\(]*)$/,Os=n=>t=>!t.startsWith(".")&&t.endsWith(n),Fs=n=>t=>t.endsWith(n),Ds=n=>(n=n.toLowerCase(),t=>!t.startsWith(".")&&t.toLowerCase().endsWith(n)),Ms=n=>(n=n.toLowerCase(),t=>t.toLowerCase().endsWith(n)),Ns=/^\*+\.\*+$/,_s=n=>!n.startsWith(".")&&n.includes("."),Ls=n=>n!=="."&&n!==".."&&n.includes("."),Ws=/^\.\*+$/,Ps=n=>n!=="."&&n!==".."&&n.startsWith("."),js=/^\*+$/,Is=n=>n.length!==0&&!n.startsWith("."),zs=n=>n.length!==0&&n!=="."&&n!=="..",Bs=/^\?+([^+@!?\*\[\(]*)?$/,Us=([n,t=""])=>{let e=Ce([n]);return t?(t=t.toLowerCase(),s=>e(s)&&s.toLowerCase().endsWith(t)):e},$s=([n,t=""])=>{let e=Te([n]);return t?(t=t.toLowerCase(),s=>e(s)&&s.toLowerCase().endsWith(t)):e},Gs=([n,t=""])=>{let e=Te([n]);return t?s=>e(s)&&s.endsWith(t):e},Hs=([n,t=""])=>{let e=Ce([n]);return t?s=>e(s)&&s.endsWith(t):e},Ce=([n])=>{let t=n.length;return e=>e.length===t&&!e.startsWith(".")},Te=([n])=>{let t=n.length;return e=>e.length===t&&e!=="."&&e!==".."},Ae=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",xe={win32:{sep:"\\"},posix:{sep:"/"}},qs=Ae==="win32"?xe.win32.sep:xe.posix.sep;O.sep=qs;var A=Symbol("globstar **");O.GLOBSTAR=A;var Ks="[^/]",Vs=Ks+"*?",Ys="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",Xs="(?:(?!(?:\\/|^)\\.).)*?",Js=(n,t={})=>e=>O(e,n,t);O.filter=Js;var N=(n,t={})=>Object.assign({},n,t),Zs=n=>{if(!n||typeof n!="object"||!Object.keys(n).length)return O;let t=O;return Object.assign((s,i,r={})=>t(s,i,N(n,r)),{Minimatch:class extends t.Minimatch{constructor(i,r={}){super(i,N(n,r))}static defaults(i){return t.defaults(N(n,i)).Minimatch}},AST:class extends t.AST{constructor(i,r,o={}){super(i,r,N(n,o))}static fromGlob(i,r={}){return t.AST.fromGlob(i,N(n,r))}},unescape:(s,i={})=>t.unescape(s,N(n,i)),escape:(s,i={})=>t.escape(s,N(n,i)),filter:(s,i={})=>t.filter(s,N(n,i)),defaults:s=>t.defaults(N(n,s)),makeRe:(s,i={})=>t.makeRe(s,N(n,i)),braceExpand:(s,i={})=>t.braceExpand(s,N(n,i)),match:(s,i,r={})=>t.match(s,i,N(n,r)),sep:t.sep,GLOBSTAR:A})};O.defaults=Zs;var ke=(n,t={})=>(at(n),t.nobrace||!/\{(?:(?!\{).)*\}/.test(n)?[n]:ge(n,{max:t.braceExpandMax}));O.braceExpand=ke;var Qs=(n,t={})=>new D(n,t).makeRe();O.makeRe=Qs;var ti=(n,t,e={})=>{let s=new D(t,e);return n=n.filter(i=>s.match(i)),s.options.nonull&&!n.length&&n.push(t),n};O.match=ti;var ve=/[?*]|[+@!]\(.*?\)|\[|\]/,ei=n=>n.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),D=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(t,e={}){at(t),e=e||{},this.options=e,this.pattern=t,this.platform=e.platform||Ae,this.isWindows=this.platform==="win32";let s="allowWindowsEscape";this.windowsPathsNoEscape=!!e.windowsPathsNoEscape||e[s]===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!e.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!e.nonegate,this.comment=!1,this.empty=!1,this.partial=!!e.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=e.windowsNoMagicRoot!==void 0?e.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let t of this.set)for(let e of t)if(typeof e!="string")return!0;return!1}debug(...t){}make(){let t=this.pattern,e=this.options;if(!e.nocomment&&t.charAt(0)==="#"){this.comment=!0;return}if(!t){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],e.debug&&(this.debug=(...r)=>console.error(...r)),this.debug(this.pattern,this.globSet);let s=this.globSet.map(r=>this.slashSplit(r));this.globParts=this.preprocess(s),this.debug(this.pattern,this.globParts);let i=this.globParts.map((r,o,h)=>{if(this.isWindows&&this.windowsNoMagicRoot){let a=r[0]===""&&r[1]===""&&(r[2]==="?"||!ve.test(r[2]))&&!ve.test(r[3]),l=/^[a-z]:/i.test(r[0]);if(a)return[...r.slice(0,4),...r.slice(4).map(u=>this.parse(u))];if(l)return[r[0],...r.slice(1).map(u=>this.parse(u))]}return r.map(a=>this.parse(a))});if(this.debug(this.pattern,i),this.set=i.filter(r=>r.indexOf(!1)===-1),this.isWindows)for(let r=0;r<this.set.length;r++){let o=this.set[r];o[0]===""&&o[1]===""&&this.globParts[r][2]==="?"&&typeof o[3]=="string"&&/^[a-z]:$/i.test(o[3])&&(o[2]="?")}this.debug(this.pattern,this.set)}preprocess(t){if(this.options.noglobstar)for(let s=0;s<t.length;s++)for(let i=0;i<t[s].length;i++)t[s][i]==="**"&&(t[s][i]="*");let{optimizationLevel:e=1}=this.options;return e>=2?(t=this.firstPhasePreProcess(t),t=this.secondPhasePreProcess(t)):e>=1?t=this.levelOneOptimize(t):t=this.adjascentGlobstarOptimize(t),t}adjascentGlobstarOptimize(t){return t.map(e=>{let s=-1;for(;(s=e.indexOf("**",s+1))!==-1;){let i=s;for(;e[i+1]==="**";)i++;i!==s&&e.splice(s,i-s)}return e})}levelOneOptimize(t){return t.map(e=>(e=e.reduce((s,i)=>{let r=s[s.length-1];return i==="**"&&r==="**"?s:i===".."&&r&&r!==".."&&r!=="."&&r!=="**"?(s.pop(),s):(s.push(i),s)},[]),e.length===0?[""]:e))}levelTwoFileOptimize(t){Array.isArray(t)||(t=this.slashSplit(t));let e=!1;do{if(e=!1,!this.preserveMultipleSlashes){for(let i=1;i<t.length-1;i++){let r=t[i];i===1&&r===""&&t[0]===""||(r==="."||r==="")&&(e=!0,t.splice(i,1),i--)}t[0]==="."&&t.length===2&&(t[1]==="."||t[1]==="")&&(e=!0,t.pop())}let s=0;for(;(s=t.indexOf("..",s+1))!==-1;){let i=t[s-1];i&&i!=="."&&i!==".."&&i!=="**"&&(e=!0,t.splice(s-1,2),s-=2)}}while(e);return t.length===0?[""]:t}firstPhasePreProcess(t){let e=!1;do{e=!1;for(let s of t){let i=-1;for(;(i=s.indexOf("**",i+1))!==-1;){let o=i;for(;s[o+1]==="**";)o++;o>i&&s.splice(i+1,o-i);let h=s[i+1],a=s[i+2],l=s[i+3];if(h!==".."||!a||a==="."||a===".."||!l||l==="."||l==="..")continue;e=!0,s.splice(i,1);let u=s.slice(0);u[i]="**",t.push(u),i--}if(!this.preserveMultipleSlashes){for(let o=1;o<s.length-1;o++){let h=s[o];o===1&&h===""&&s[0]===""||(h==="."||h==="")&&(e=!0,s.splice(o,1),o--)}s[0]==="."&&s.length===2&&(s[1]==="."||s[1]==="")&&(e=!0,s.pop())}let r=0;for(;(r=s.indexOf("..",r+1))!==-1;){let o=s[r-1];if(o&&o!=="."&&o!==".."&&o!=="**"){e=!0;let a=r===1&&s[r+1]==="**"?["."]:[];s.splice(r-1,2,...a),s.length===0&&s.push(""),r-=2}}}}while(e);return t}secondPhasePreProcess(t){for(let e=0;e<t.length-1;e++)for(let s=e+1;s<t.length;s++){let i=this.partsMatch(t[e],t[s],!this.preserveMultipleSlashes);if(i){t[e]=[],t[s]=i;break}}return t.filter(e=>e.length)}partsMatch(t,e,s=!1){let i=0,r=0,o=[],h="";for(;i<t.length&&r<e.length;)if(t[i]===e[r])o.push(h==="b"?e[r]:t[i]),i++,r++;else if(s&&t[i]==="**"&&e[r]===t[i+1])o.push(t[i]),i++;else if(s&&e[r]==="**"&&t[i]===e[r+1])o.push(e[r]),r++;else if(t[i]==="*"&&e[r]&&(this.options.dot||!e[r].startsWith("."))&&e[r]!=="**"){if(h==="b")return!1;h="a",o.push(t[i]),i++,r++}else if(e[r]==="*"&&t[i]&&(this.options.dot||!t[i].startsWith("."))&&t[i]!=="**"){if(h==="a")return!1;h="b",o.push(e[r]),i++,r++}else return!1;return t.length===e.length&&o}parseNegate(){if(this.nonegate)return;let t=this.pattern,e=!1,s=0;for(let i=0;i<t.length&&t.charAt(i)==="!";i++)e=!e,s++;s&&(this.pattern=t.slice(s)),this.negate=e}matchOne(t,e,s=!1){let i=this.options;if(this.isWindows){let p=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),w=!p&&t[0]===""&&t[1]===""&&t[2]==="?"&&/^[a-z]:$/i.test(t[3]),g=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),S=!g&&e[0]===""&&e[1]===""&&e[2]==="?"&&typeof e[3]=="string"&&/^[a-z]:$/i.test(e[3]),E=w?3:p?0:void 0,y=S?3:g?0:void 0;if(typeof E=="number"&&typeof y=="number"){let[b,z]=[t[E],e[y]];b.toLowerCase()===z.toLowerCase()&&(e[y]=b,y>E?e=e.slice(y):E>y&&(t=t.slice(E)))}}let{optimizationLevel:r=1}=this.options;r>=2&&(t=this.levelTwoFileOptimize(t)),this.debug("matchOne",this,{file:t,pattern:e}),this.debug("matchOne",t.length,e.length);for(var o=0,h=0,a=t.length,l=e.length;o<a&&h<l;o++,h++){this.debug("matchOne loop");var u=e[h],c=t[o];if(this.debug(e,u,c),u===!1)return!1;if(u===A){this.debug("GLOBSTAR",[e,u,c]);var d=o,f=h+1;if(f===l){for(this.debug("** at the end");o<a;o++)if(t[o]==="."||t[o]===".."||!i.dot&&t[o].charAt(0)===".")return!1;return!0}for(;d<a;){var m=t[d];if(this.debug(`
|
|
11785
|
-
globstar while`,t,d,e,f,m),this.matchOne(t.slice(d),e.slice(f),s))return this.debug("globstar found match!",d,a,m),!0;if(m==="."||m===".."||!i.dot&&m.charAt(0)==="."){this.debug("dot detected!",t,d,e,f);break}this.debug("globstar swallow a segment, and continue"),d++}return!!(s&&(this.debug(`
|
|
11786
|
-
>>> no match, partial?`,t,d,e,f),d===a))}let p;if(typeof u=="string"?(p=c===u,this.debug("string match",u,c,p)):(p=u.test(c),this.debug("pattern match",u,c,p)),!p)return!1}if(o===a&&h===l)return!0;if(o===a)return s;if(h===l)return o===a-1&&t[o]==="";throw new Error("wtf?")}braceExpand(){return ke(this.pattern,this.options)}parse(t){at(t);let e=this.options;if(t==="**")return A;if(t==="")return"";let s,i=null;(s=t.match(js))?i=e.dot?zs:Is:(s=t.match(Rs))?i=(e.nocase?e.dot?Ms:Ds:e.dot?Fs:Os)(s[1]):(s=t.match(Bs))?i=(e.nocase?e.dot?$s:Us:e.dot?Gs:Hs)(s):(s=t.match(Ns))?i=e.dot?Ls:_s:(s=t.match(Ws))&&(i=Ps);let r=Q.fromGlob(t,this.options).toMMPattern();return i&&typeof r=="object"&&Reflect.defineProperty(r,"test",{value:i}),r}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let t=this.set;if(!t.length)return this.regexp=!1,this.regexp;let e=this.options,s=e.noglobstar?Vs:e.dot?Ys:Xs,i=new Set(e.nocase?["i"]:[]),r=t.map(a=>{let l=a.map(c=>{if(c instanceof RegExp)for(let d of c.flags.split(""))i.add(d);return typeof c=="string"?ei(c):c===A?A:c._src});l.forEach((c,d)=>{let f=l[d+1],m=l[d-1];c!==A||m===A||(m===void 0?f!==void 0&&f!==A?l[d+1]="(?:\\/|"+s+"\\/)?"+f:l[d]=s:f===void 0?l[d-1]=m+"(?:\\/|\\/"+s+")?":f!==A&&(l[d-1]=m+"(?:\\/|\\/"+s+"\\/)"+f,l[d+1]=A))});let u=l.filter(c=>c!==A);if(this.partial&&u.length>=1){let c=[];for(let d=1;d<=u.length;d++)c.push(u.slice(0,d).join("/"));return"(?:"+c.join("|")+")"}return u.join("/")}).join("|"),[o,h]=t.length>1?["(?:",")"]:["",""];r="^"+o+r+h+"$",this.partial&&(r="^(?:\\/|"+o+r.slice(1,-1)+h+")$"),this.negate&&(r="^(?!"+r+").+$");try{this.regexp=new RegExp(r,[...i].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(t){return this.preserveMultipleSlashes?t.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(t)?["",...t.split(/\/+/)]:t.split(/\/+/)}match(t,e=this.partial){if(this.debug("match",t,this.pattern),this.comment)return!1;if(this.empty)return t==="";if(t==="/"&&e)return!0;let s=this.options;this.isWindows&&(t=t.split("\\").join("/"));let i=this.slashSplit(t);this.debug(this.pattern,"split",i);let r=this.set;this.debug(this.pattern,"set",r);let o=i[i.length-1];if(!o)for(let h=i.length-2;!o&&h>=0;h--)o=i[h];for(let h=0;h<r.length;h++){let a=r[h],l=i;if(s.matchBase&&a.length===1&&(l=[o]),this.matchOne(l,a,e))return s.flipNegate?!0:!this.negate}return s.flipNegate?!1:this.negate}static defaults(t){return O.defaults(t).Minimatch}};O.AST=Q;O.Minimatch=D;O.escape=tt;O.unescape=W;var si=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Oe=new Set,Vt=typeof process=="object"&&process?process:{},Fe=(n,t,e,s)=>{typeof Vt.emitWarning=="function"?Vt.emitWarning(n,t,e,s):console.error(`[${e}] ${t}: ${n}`)},At=globalThis.AbortController,Re=globalThis.AbortSignal;if(typeof At>"u"){Re=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(e,s){this._onabort.push(s)}},At=class{constructor(){t()}signal=new Re;abort(e){if(!this.signal.aborted){this.signal.reason=e,this.signal.aborted=!0;for(let s of this.signal._onabort)s(e);this.signal.onabort?.(e)}}};let n=Vt.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",t=()=>{n&&(n=!1,Fe("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",t))}}var ii=n=>!Oe.has(n);var q=n=>n&&n===Math.floor(n)&&n>0&&isFinite(n),De=n=>q(n)?n<=Math.pow(2,8)?Uint8Array:n<=Math.pow(2,16)?Uint16Array:n<=Math.pow(2,32)?Uint32Array:n<=Number.MAX_SAFE_INTEGER?Tt:null:null,Tt=class extends Array{constructor(n){super(n),this.fill(0)}},ri=class ct{heap;length;static#t=!1;static create(t){let e=De(t);if(!e)return[];ct.#t=!0;let s=new ct(t,e);return ct.#t=!1,s}constructor(t,e){if(!ct.#t)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new e(t),this.length=0}push(t){this.heap[this.length++]=t}pop(){return this.heap[--this.length]}},ft=class Me{#t;#s;#n;#r;#o;#S;#w;#c;get perf(){return this.#c}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#h;#u;#f;#a;#i;#d;#E;#b;#p;#R;#m;#C;#T;#g;#y;#x;#A;#e;#_;static unsafeExposeInternals(t){return{starts:t.#T,ttls:t.#g,autopurgeTimers:t.#y,sizes:t.#C,keyMap:t.#f,keyList:t.#a,valList:t.#i,next:t.#d,prev:t.#E,get head(){return t.#b},get tail(){return t.#p},free:t.#R,isBackgroundFetch:e=>t.#l(e),backgroundFetch:(e,s,i,r)=>t.#U(e,s,i,r),moveToTail:e=>t.#W(e),indexes:e=>t.#F(e),rindexes:e=>t.#D(e),isStale:e=>t.#v(e)}}get max(){return this.#t}get maxSize(){return this.#s}get calculatedSize(){return this.#u}get size(){return this.#h}get fetchMethod(){return this.#S}get memoMethod(){return this.#w}get dispose(){return this.#n}get onInsert(){return this.#r}get disposeAfter(){return this.#o}constructor(t){let{max:e=0,ttl:s,ttlResolution:i=1,ttlAutopurge:r,updateAgeOnGet:o,updateAgeOnHas:h,allowStale:a,dispose:l,onInsert:u,disposeAfter:c,noDisposeOnSet:d,noUpdateTTL:f,maxSize:m=0,maxEntrySize:p=0,sizeCalculation:w,fetchMethod:g,memoMethod:S,noDeleteOnFetchRejection:E,noDeleteOnStaleGet:y,allowStaleOnFetchRejection:b,allowStaleOnFetchAbort:z,ignoreFetchAbort:$,perf:J}=t;if(J!==void 0&&typeof J?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(this.#c=J??si,e!==0&&!q(e))throw new TypeError("max option must be a nonnegative integer");let Z=e?De(e):Array;if(!Z)throw new Error("invalid max value: "+e);if(this.#t=e,this.#s=m,this.maxEntrySize=p||this.#s,this.sizeCalculation=w,this.sizeCalculation){if(!this.#s&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(S!==void 0&&typeof S!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#w=S,g!==void 0&&typeof g!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#S=g,this.#A=!!g,this.#f=new Map,this.#a=new Array(e).fill(void 0),this.#i=new Array(e).fill(void 0),this.#d=new Z(e),this.#E=new Z(e),this.#b=0,this.#p=0,this.#R=ri.create(e),this.#h=0,this.#u=0,typeof l=="function"&&(this.#n=l),typeof u=="function"&&(this.#r=u),typeof c=="function"?(this.#o=c,this.#m=[]):(this.#o=void 0,this.#m=void 0),this.#x=!!this.#n,this.#_=!!this.#r,this.#e=!!this.#o,this.noDisposeOnSet=!!d,this.noUpdateTTL=!!f,this.noDeleteOnFetchRejection=!!E,this.allowStaleOnFetchRejection=!!b,this.allowStaleOnFetchAbort=!!z,this.ignoreFetchAbort=!!$,this.maxEntrySize!==0){if(this.#s!==0&&!q(this.#s))throw new TypeError("maxSize must be a positive integer if specified");if(!q(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#G()}if(this.allowStale=!!a,this.noDeleteOnStaleGet=!!y,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!h,this.ttlResolution=q(i)||i===0?i:1,this.ttlAutopurge=!!r,this.ttl=s||0,this.ttl){if(!q(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#M()}if(this.#t===0&&this.ttl===0&&this.#s===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#t&&!this.#s){let $t="LRU_CACHE_UNBOUNDED";ii($t)&&(Oe.add($t),Fe("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",$t,Me))}}getRemainingTTL(t){return this.#f.has(t)?1/0:0}#M(){let t=new Tt(this.#t),e=new Tt(this.#t);this.#g=t,this.#T=e;let s=this.ttlAutopurge?new Array(this.#t):void 0;this.#y=s,this.#j=(o,h,a=this.#c.now())=>{if(e[o]=h!==0?a:0,t[o]=h,s?.[o]&&(clearTimeout(s[o]),s[o]=void 0),h!==0&&s){let l=setTimeout(()=>{this.#v(o)&&this.#O(this.#a[o],"expire")},h+1);l.unref&&l.unref(),s[o]=l}},this.#k=o=>{e[o]=t[o]!==0?this.#c.now():0},this.#N=(o,h)=>{if(t[h]){let a=t[h],l=e[h];if(!a||!l)return;o.ttl=a,o.start=l,o.now=i||r();let u=o.now-l;o.remainingTTL=a-u}};let i=0,r=()=>{let o=this.#c.now();if(this.ttlResolution>0){i=o;let h=setTimeout(()=>i=0,this.ttlResolution);h.unref&&h.unref()}return o};this.getRemainingTTL=o=>{let h=this.#f.get(o);if(h===void 0)return 0;let a=t[h],l=e[h];if(!a||!l)return 1/0;let u=(i||r())-l;return a-u},this.#v=o=>{let h=e[o],a=t[o];return!!a&&!!h&&(i||r())-h>a}}#k=()=>{};#N=()=>{};#j=()=>{};#v=()=>!1;#G(){let t=new Tt(this.#t);this.#u=0,this.#C=t,this.#P=e=>{this.#u-=t[e],t[e]=0},this.#I=(e,s,i,r)=>{if(this.#l(s))return 0;if(!q(i))if(r){if(typeof r!="function")throw new TypeError("sizeCalculation must be a function");if(i=r(s,e),!q(i))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return i},this.#L=(e,s,i)=>{if(t[e]=s,this.#s){let r=this.#s-t[e];for(;this.#u>r;)this.#B(!0)}this.#u+=t[e],i&&(i.entrySize=s,i.totalCalculatedSize=this.#u)}}#P=t=>{};#L=(t,e,s)=>{};#I=(t,e,s,i)=>{if(s||i)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#F({allowStale:t=this.allowStale}={}){if(this.#h)for(let e=this.#p;!(!this.#z(e)||((t||!this.#v(e))&&(yield e),e===this.#b));)e=this.#E[e]}*#D({allowStale:t=this.allowStale}={}){if(this.#h)for(let e=this.#b;!(!this.#z(e)||((t||!this.#v(e))&&(yield e),e===this.#p));)e=this.#d[e]}#z(t){return t!==void 0&&this.#f.get(this.#a[t])===t}*entries(){for(let t of this.#F())this.#i[t]!==void 0&&this.#a[t]!==void 0&&!this.#l(this.#i[t])&&(yield[this.#a[t],this.#i[t]])}*rentries(){for(let t of this.#D())this.#i[t]!==void 0&&this.#a[t]!==void 0&&!this.#l(this.#i[t])&&(yield[this.#a[t],this.#i[t]])}*keys(){for(let t of this.#F()){let e=this.#a[t];e!==void 0&&!this.#l(this.#i[t])&&(yield e)}}*rkeys(){for(let t of this.#D()){let e=this.#a[t];e!==void 0&&!this.#l(this.#i[t])&&(yield e)}}*values(){for(let t of this.#F())this.#i[t]!==void 0&&!this.#l(this.#i[t])&&(yield this.#i[t])}*rvalues(){for(let t of this.#D())this.#i[t]!==void 0&&!this.#l(this.#i[t])&&(yield this.#i[t])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(t,e={}){for(let s of this.#F()){let i=this.#i[s],r=this.#l(i)?i.__staleWhileFetching:i;if(r!==void 0&&t(r,this.#a[s],this))return this.get(this.#a[s],e)}}forEach(t,e=this){for(let s of this.#F()){let i=this.#i[s],r=this.#l(i)?i.__staleWhileFetching:i;r!==void 0&&t.call(e,r,this.#a[s],this)}}rforEach(t,e=this){for(let s of this.#D()){let i=this.#i[s],r=this.#l(i)?i.__staleWhileFetching:i;r!==void 0&&t.call(e,r,this.#a[s],this)}}purgeStale(){let t=!1;for(let e of this.#D({allowStale:!0}))this.#v(e)&&(this.#O(this.#a[e],"expire"),t=!0);return t}info(t){let e=this.#f.get(t);if(e===void 0)return;let s=this.#i[e],i=this.#l(s)?s.__staleWhileFetching:s;if(i===void 0)return;let r={value:i};if(this.#g&&this.#T){let o=this.#g[e],h=this.#T[e];if(o&&h){let a=o-(this.#c.now()-h);r.ttl=a,r.start=Date.now()}}return this.#C&&(r.size=this.#C[e]),r}dump(){let t=[];for(let e of this.#F({allowStale:!0})){let s=this.#a[e],i=this.#i[e],r=this.#l(i)?i.__staleWhileFetching:i;if(r===void 0||s===void 0)continue;let o={value:r};if(this.#g&&this.#T){o.ttl=this.#g[e];let h=this.#c.now()-this.#T[e];o.start=Math.floor(Date.now()-h)}this.#C&&(o.size=this.#C[e]),t.unshift([s,o])}return t}load(t){this.clear();for(let[e,s]of t){if(s.start){let i=Date.now()-s.start;s.start=this.#c.now()-i}this.set(e,s.value,s)}}set(t,e,s={}){if(e===void 0)return this.delete(t),this;let{ttl:i=this.ttl,start:r,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:h=this.sizeCalculation,status:a}=s,{noUpdateTTL:l=this.noUpdateTTL}=s,u=this.#I(t,e,s.size||0,h);if(this.maxEntrySize&&u>this.maxEntrySize)return a&&(a.set="miss",a.maxEntrySizeExceeded=!0),this.#O(t,"set"),this;let c=this.#h===0?void 0:this.#f.get(t);if(c===void 0)c=this.#h===0?this.#p:this.#R.length!==0?this.#R.pop():this.#h===this.#t?this.#B(!1):this.#h,this.#a[c]=t,this.#i[c]=e,this.#f.set(t,c),this.#d[this.#p]=c,this.#E[c]=this.#p,this.#p=c,this.#h++,this.#L(c,u,a),a&&(a.set="add"),l=!1,this.#_&&this.#r?.(e,t,"add");else{this.#W(c);let d=this.#i[c];if(e!==d){if(this.#A&&this.#l(d)){d.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:f}=d;f!==void 0&&!o&&(this.#x&&this.#n?.(f,t,"set"),this.#e&&this.#m?.push([f,t,"set"]))}else o||(this.#x&&this.#n?.(d,t,"set"),this.#e&&this.#m?.push([d,t,"set"]));if(this.#P(c),this.#L(c,u,a),this.#i[c]=e,a){a.set="replace";let f=d&&this.#l(d)?d.__staleWhileFetching:d;f!==void 0&&(a.oldValue=f)}}else a&&(a.set="update");this.#_&&this.onInsert?.(e,t,e===d?"update":"replace")}if(i!==0&&!this.#g&&this.#M(),this.#g&&(l||this.#j(c,i,r),a&&this.#N(a,c)),!o&&this.#e&&this.#m){let d=this.#m,f;for(;f=d?.shift();)this.#o?.(...f)}return this}pop(){try{for(;this.#h;){let t=this.#i[this.#b];if(this.#B(!0),this.#l(t)){if(t.__staleWhileFetching)return t.__staleWhileFetching}else if(t!==void 0)return t}}finally{if(this.#e&&this.#m){let t=this.#m,e;for(;e=t?.shift();)this.#o?.(...e)}}}#B(t){let e=this.#b,s=this.#a[e],i=this.#i[e];return this.#A&&this.#l(i)?i.__abortController.abort(new Error("evicted")):(this.#x||this.#e)&&(this.#x&&this.#n?.(i,s,"evict"),this.#e&&this.#m?.push([i,s,"evict"])),this.#P(e),this.#y?.[e]&&(clearTimeout(this.#y[e]),this.#y[e]=void 0),t&&(this.#a[e]=void 0,this.#i[e]=void 0,this.#R.push(e)),this.#h===1?(this.#b=this.#p=0,this.#R.length=0):this.#b=this.#d[e],this.#f.delete(s),this.#h--,e}has(t,e={}){let{updateAgeOnHas:s=this.updateAgeOnHas,status:i}=e,r=this.#f.get(t);if(r!==void 0){let o=this.#i[r];if(this.#l(o)&&o.__staleWhileFetching===void 0)return!1;if(this.#v(r))i&&(i.has="stale",this.#N(i,r));else return s&&this.#k(r),i&&(i.has="hit",this.#N(i,r)),!0}else i&&(i.has="miss");return!1}peek(t,e={}){let{allowStale:s=this.allowStale}=e,i=this.#f.get(t);if(i===void 0||!s&&this.#v(i))return;let r=this.#i[i];return this.#l(r)?r.__staleWhileFetching:r}#U(t,e,s,i){let r=e===void 0?void 0:this.#i[e];if(this.#l(r))return r;let o=new At,{signal:h}=s;h?.addEventListener("abort",()=>o.abort(h.reason),{signal:o.signal});let a={signal:o.signal,options:s,context:i},l=(p,w=!1)=>{let{aborted:g}=o.signal,S=s.ignoreFetchAbort&&p!==void 0,E=s.ignoreFetchAbort||!!(s.allowStaleOnFetchAbort&&p!==void 0);if(s.status&&(g&&!w?(s.status.fetchAborted=!0,s.status.fetchError=o.signal.reason,S&&(s.status.fetchAbortIgnored=!0)):s.status.fetchResolved=!0),g&&!S&&!w)return c(o.signal.reason,E);let y=f,b=this.#i[e];return(b===f||S&&w&&b===void 0)&&(p===void 0?y.__staleWhileFetching!==void 0?this.#i[e]=y.__staleWhileFetching:this.#O(t,"fetch"):(s.status&&(s.status.fetchUpdated=!0),this.set(t,p,a.options))),p},u=p=>(s.status&&(s.status.fetchRejected=!0,s.status.fetchError=p),c(p,!1)),c=(p,w)=>{let{aborted:g}=o.signal,S=g&&s.allowStaleOnFetchAbort,E=S||s.allowStaleOnFetchRejection,y=E||s.noDeleteOnFetchRejection,b=f;if(this.#i[e]===f&&(!y||!w&&b.__staleWhileFetching===void 0?this.#O(t,"fetch"):S||(this.#i[e]=b.__staleWhileFetching)),E)return s.status&&b.__staleWhileFetching!==void 0&&(s.status.returnedStale=!0),b.__staleWhileFetching;if(b.__returned===b)throw p},d=(p,w)=>{let g=this.#S?.(t,r,a);g&&g instanceof Promise&&g.then(S=>p(S===void 0?void 0:S),w),o.signal.addEventListener("abort",()=>{(!s.ignoreFetchAbort||s.allowStaleOnFetchAbort)&&(p(void 0),s.allowStaleOnFetchAbort&&(p=S=>l(S,!0)))})};s.status&&(s.status.fetchDispatched=!0);let f=new Promise(d).then(l,u),m=Object.assign(f,{__abortController:o,__staleWhileFetching:r,__returned:void 0});return e===void 0?(this.set(t,m,{...a.options,status:void 0}),e=this.#f.get(t)):this.#i[e]=m,m}#l(t){if(!this.#A)return!1;let e=t;return!!e&&e instanceof Promise&&e.hasOwnProperty("__staleWhileFetching")&&e.__abortController instanceof At}async fetch(t,e={}){let{allowStale:s=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:h=this.noDisposeOnSet,size:a=0,sizeCalculation:l=this.sizeCalculation,noUpdateTTL:u=this.noUpdateTTL,noDeleteOnFetchRejection:c=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:d=this.allowStaleOnFetchRejection,ignoreFetchAbort:f=this.ignoreFetchAbort,allowStaleOnFetchAbort:m=this.allowStaleOnFetchAbort,context:p,forceRefresh:w=!1,status:g,signal:S}=e;if(!this.#A)return g&&(g.fetch="get"),this.get(t,{allowStale:s,updateAgeOnGet:i,noDeleteOnStaleGet:r,status:g});let E={allowStale:s,updateAgeOnGet:i,noDeleteOnStaleGet:r,ttl:o,noDisposeOnSet:h,size:a,sizeCalculation:l,noUpdateTTL:u,noDeleteOnFetchRejection:c,allowStaleOnFetchRejection:d,allowStaleOnFetchAbort:m,ignoreFetchAbort:f,status:g,signal:S},y=this.#f.get(t);if(y===void 0){g&&(g.fetch="miss");let b=this.#U(t,y,E,p);return b.__returned=b}else{let b=this.#i[y];if(this.#l(b)){let Z=s&&b.__staleWhileFetching!==void 0;return g&&(g.fetch="inflight",Z&&(g.returnedStale=!0)),Z?b.__staleWhileFetching:b.__returned=b}let z=this.#v(y);if(!w&&!z)return g&&(g.fetch="hit"),this.#W(y),i&&this.#k(y),g&&this.#N(g,y),b;let $=this.#U(t,y,E,p),J=$.__staleWhileFetching!==void 0&&s;return g&&(g.fetch=z?"stale":"refresh",J&&z&&(g.returnedStale=!0)),J?$.__staleWhileFetching:$.__returned=$}}async forceFetch(t,e={}){let s=await this.fetch(t,e);if(s===void 0)throw new Error("fetch() returned undefined");return s}memo(t,e={}){let s=this.#w;if(!s)throw new Error("no memoMethod provided to constructor");let{context:i,forceRefresh:r,...o}=e,h=this.get(t,o);if(!r&&h!==void 0)return h;let a=s(t,h,{options:o,context:i});return this.set(t,a,o),a}get(t,e={}){let{allowStale:s=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,status:o}=e,h=this.#f.get(t);if(h!==void 0){let a=this.#i[h],l=this.#l(a);return o&&this.#N(o,h),this.#v(h)?(o&&(o.get="stale"),l?(o&&s&&a.__staleWhileFetching!==void 0&&(o.returnedStale=!0),s?a.__staleWhileFetching:void 0):(r||this.#O(t,"expire"),o&&s&&(o.returnedStale=!0),s?a:void 0)):(o&&(o.get="hit"),l?a.__staleWhileFetching:(this.#W(h),i&&this.#k(h),a))}else o&&(o.get="miss")}#$(t,e){this.#E[e]=t,this.#d[t]=e}#W(t){t!==this.#p&&(t===this.#b?this.#b=this.#d[t]:this.#$(this.#E[t],this.#d[t]),this.#$(this.#p,t),this.#p=t)}delete(t){return this.#O(t,"delete")}#O(t,e){let s=!1;if(this.#h!==0){let i=this.#f.get(t);if(i!==void 0)if(this.#y?.[i]&&(clearTimeout(this.#y?.[i]),this.#y[i]=void 0),s=!0,this.#h===1)this.#H(e);else{this.#P(i);let r=this.#i[i];if(this.#l(r)?r.__abortController.abort(new Error("deleted")):(this.#x||this.#e)&&(this.#x&&this.#n?.(r,t,e),this.#e&&this.#m?.push([r,t,e])),this.#f.delete(t),this.#a[i]=void 0,this.#i[i]=void 0,i===this.#p)this.#p=this.#E[i];else if(i===this.#b)this.#b=this.#d[i];else{let o=this.#E[i];this.#d[o]=this.#d[i];let h=this.#d[i];this.#E[h]=this.#E[i]}this.#h--,this.#R.push(i)}}if(this.#e&&this.#m?.length){let i=this.#m,r;for(;r=i?.shift();)this.#o?.(...r)}return s}clear(){return this.#H("delete")}#H(t){for(let e of this.#D({allowStale:!0})){let s=this.#i[e];if(this.#l(s))s.__abortController.abort(new Error("deleted"));else{let i=this.#a[e];this.#x&&this.#n?.(s,i,t),this.#e&&this.#m?.push([s,i,t])}}if(this.#f.clear(),this.#i.fill(void 0),this.#a.fill(void 0),this.#g&&this.#T){this.#g.fill(0),this.#T.fill(0);for(let e of this.#y??[])e!==void 0&&clearTimeout(e);this.#y?.fill(void 0)}if(this.#C&&this.#C.fill(0),this.#b=0,this.#p=0,this.#R.length=0,this.#u=0,this.#h=0,this.#e&&this.#m){let e=this.#m,s;for(;s=e?.shift();)this.#o?.(...s)}}};var Ne=typeof process=="object"&&process?process:{stdout:null,stderr:null},oi=n=>!!n&&typeof n=="object"&&(n instanceof V||n instanceof node_stream__WEBPACK_IMPORTED_MODULE_6__||hi(n)||ai(n)),hi=n=>!!n&&typeof n=="object"&&n instanceof node_events__WEBPACK_IMPORTED_MODULE_5__.EventEmitter&&typeof n.pipe=="function"&&n.pipe!==node_stream__WEBPACK_IMPORTED_MODULE_6__.Writable.prototype.pipe,ai=n=>!!n&&typeof n=="object"&&n instanceof node_events__WEBPACK_IMPORTED_MODULE_5__.EventEmitter&&typeof n.write=="function"&&typeof n.end=="function",G=Symbol("EOF"),H=Symbol("maybeEmitEnd"),K=Symbol("emittedEnd"),kt=Symbol("emittingEnd"),ut=Symbol("emittedError"),Rt=Symbol("closed"),_e=Symbol("read"),Ot=Symbol("flush"),Le=Symbol("flushChunk"),P=Symbol("encoding"),et=Symbol("decoder"),v=Symbol("flowing"),dt=Symbol("paused"),st=Symbol("resume"),C=Symbol("buffer"),F=Symbol("pipes"),T=Symbol("bufferLength"),Yt=Symbol("bufferPush"),Ft=Symbol("bufferShift"),k=Symbol("objectMode"),x=Symbol("destroyed"),Xt=Symbol("error"),Jt=Symbol("emitData"),We=Symbol("emitEnd"),Zt=Symbol("emitEnd2"),B=Symbol("async"),Qt=Symbol("abort"),Dt=Symbol("aborted"),pt=Symbol("signal"),Y=Symbol("dataListeners"),M=Symbol("discarded"),mt=n=>Promise.resolve().then(n),li=n=>n(),ci=n=>n==="end"||n==="finish"||n==="prefinish",fi=n=>n instanceof ArrayBuffer||!!n&&typeof n=="object"&&n.constructor&&n.constructor.name==="ArrayBuffer"&&n.byteLength>=0,ui=n=>!Buffer.isBuffer(n)&&ArrayBuffer.isView(n),Mt=class{src;dest;opts;ondrain;constructor(t,e,s){this.src=t,this.dest=e,this.opts=s,this.ondrain=()=>t[st](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(t){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},te=class extends Mt{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(t,e,s){super(t,e,s),this.proxyErrors=i=>this.dest.emit("error",i),t.on("error",this.proxyErrors)}},di=n=>!!n.objectMode,pi=n=>!n.objectMode&&!!n.encoding&&n.encoding!=="buffer",V=class extends node_events__WEBPACK_IMPORTED_MODULE_5__.EventEmitter{[v]=!1;[dt]=!1;[F]=[];[C]=[];[k];[P];[B];[et];[G]=!1;[K]=!1;[kt]=!1;[Rt]=!1;[ut]=null;[T]=0;[x]=!1;[pt];[Dt]=!1;[Y]=0;[M]=!1;writable=!0;readable=!0;constructor(...t){let e=t[0]||{};if(super(),e.objectMode&&typeof e.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");di(e)?(this[k]=!0,this[P]=null):pi(e)?(this[P]=e.encoding,this[k]=!1):(this[k]=!1,this[P]=null),this[B]=!!e.async,this[et]=this[P]?new node_string_decoder__WEBPACK_IMPORTED_MODULE_7__.StringDecoder(this[P]):null,e&&e.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[C]}),e&&e.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[F]});let{signal:s}=e;s&&(this[pt]=s,s.aborted?this[Qt]():s.addEventListener("abort",()=>this[Qt]()))}get bufferLength(){return this[T]}get encoding(){return this[P]}set encoding(t){throw new Error("Encoding must be set at instantiation time")}setEncoding(t){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[k]}set objectMode(t){throw new Error("objectMode must be set at instantiation time")}get async(){return this[B]}set async(t){this[B]=this[B]||!!t}[Qt](){this[Dt]=!0,this.emit("abort",this[pt]?.reason),this.destroy(this[pt]?.reason)}get aborted(){return this[Dt]}set aborted(t){}write(t,e,s){if(this[Dt])return!1;if(this[G])throw new Error("write after end");if(this[x])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof e=="function"&&(s=e,e="utf8"),e||(e="utf8");let i=this[B]?mt:li;if(!this[k]&&!Buffer.isBuffer(t)){if(ui(t))t=Buffer.from(t.buffer,t.byteOffset,t.byteLength);else if(fi(t))t=Buffer.from(t);else if(typeof t!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[k]?(this[v]&&this[T]!==0&&this[Ot](!0),this[v]?this.emit("data",t):this[Yt](t),this[T]!==0&&this.emit("readable"),s&&i(s),this[v]):t.length?(typeof t=="string"&&!(e===this[P]&&!this[et]?.lastNeed)&&(t=Buffer.from(t,e)),Buffer.isBuffer(t)&&this[P]&&(t=this[et].write(t)),this[v]&&this[T]!==0&&this[Ot](!0),this[v]?this.emit("data",t):this[Yt](t),this[T]!==0&&this.emit("readable"),s&&i(s),this[v]):(this[T]!==0&&this.emit("readable"),s&&i(s),this[v])}read(t){if(this[x])return null;if(this[M]=!1,this[T]===0||t===0||t&&t>this[T])return this[H](),null;this[k]&&(t=null),this[C].length>1&&!this[k]&&(this[C]=[this[P]?this[C].join(""):Buffer.concat(this[C],this[T])]);let e=this[_e](t||null,this[C][0]);return this[H](),e}[_e](t,e){if(this[k])this[Ft]();else{let s=e;t===s.length||t===null?this[Ft]():typeof s=="string"?(this[C][0]=s.slice(t),e=s.slice(0,t),this[T]-=t):(this[C][0]=s.subarray(t),e=s.subarray(0,t),this[T]-=t)}return this.emit("data",e),!this[C].length&&!this[G]&&this.emit("drain"),e}end(t,e,s){return typeof t=="function"&&(s=t,t=void 0),typeof e=="function"&&(s=e,e="utf8"),t!==void 0&&this.write(t,e),s&&this.once("end",s),this[G]=!0,this.writable=!1,(this[v]||!this[dt])&&this[H](),this}[st](){this[x]||(!this[Y]&&!this[F].length&&(this[M]=!0),this[dt]=!1,this[v]=!0,this.emit("resume"),this[C].length?this[Ot]():this[G]?this[H]():this.emit("drain"))}resume(){return this[st]()}pause(){this[v]=!1,this[dt]=!0,this[M]=!1}get destroyed(){return this[x]}get flowing(){return this[v]}get paused(){return this[dt]}[Yt](t){this[k]?this[T]+=1:this[T]+=t.length,this[C].push(t)}[Ft](){return this[k]?this[T]-=1:this[T]-=this[C][0].length,this[C].shift()}[Ot](t=!1){do;while(this[Le](this[Ft]())&&this[C].length);!t&&!this[C].length&&!this[G]&&this.emit("drain")}[Le](t){return this.emit("data",t),this[v]}pipe(t,e){if(this[x])return t;this[M]=!1;let s=this[K];return e=e||{},t===Ne.stdout||t===Ne.stderr?e.end=!1:e.end=e.end!==!1,e.proxyErrors=!!e.proxyErrors,s?e.end&&t.end():(this[F].push(e.proxyErrors?new te(this,t,e):new Mt(this,t,e)),this[B]?mt(()=>this[st]()):this[st]()),t}unpipe(t){let e=this[F].find(s=>s.dest===t);e&&(this[F].length===1?(this[v]&&this[Y]===0&&(this[v]=!1),this[F]=[]):this[F].splice(this[F].indexOf(e),1),e.unpipe())}addListener(t,e){return this.on(t,e)}on(t,e){let s=super.on(t,e);if(t==="data")this[M]=!1,this[Y]++,!this[F].length&&!this[v]&&this[st]();else if(t==="readable"&&this[T]!==0)super.emit("readable");else if(ci(t)&&this[K])super.emit(t),this.removeAllListeners(t);else if(t==="error"&&this[ut]){let i=e;this[B]?mt(()=>i.call(this,this[ut])):i.call(this,this[ut])}return s}removeListener(t,e){return this.off(t,e)}off(t,e){let s=super.off(t,e);return t==="data"&&(this[Y]=this.listeners("data").length,this[Y]===0&&!this[M]&&!this[F].length&&(this[v]=!1)),s}removeAllListeners(t){let e=super.removeAllListeners(t);return(t==="data"||t===void 0)&&(this[Y]=0,!this[M]&&!this[F].length&&(this[v]=!1)),e}get emittedEnd(){return this[K]}[H](){!this[kt]&&!this[K]&&!this[x]&&this[C].length===0&&this[G]&&(this[kt]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[Rt]&&this.emit("close"),this[kt]=!1)}emit(t,...e){let s=e[0];if(t!=="error"&&t!=="close"&&t!==x&&this[x])return!1;if(t==="data")return!this[k]&&!s?!1:this[B]?(mt(()=>this[Jt](s)),!0):this[Jt](s);if(t==="end")return this[We]();if(t==="close"){if(this[Rt]=!0,!this[K]&&!this[x])return!1;let r=super.emit("close");return this.removeAllListeners("close"),r}else if(t==="error"){this[ut]=s,super.emit(Xt,s);let r=!this[pt]||this.listeners("error").length?super.emit("error",s):!1;return this[H](),r}else if(t==="resume"){let r=super.emit("resume");return this[H](),r}else if(t==="finish"||t==="prefinish"){let r=super.emit(t);return this.removeAllListeners(t),r}let i=super.emit(t,...e);return this[H](),i}[Jt](t){for(let s of this[F])s.dest.write(t)===!1&&this.pause();let e=this[M]?!1:super.emit("data",t);return this[H](),e}[We](){return this[K]?!1:(this[K]=!0,this.readable=!1,this[B]?(mt(()=>this[Zt]()),!0):this[Zt]())}[Zt](){if(this[et]){let e=this[et].end();if(e){for(let s of this[F])s.dest.write(e);this[M]||super.emit("data",e)}}for(let e of this[F])e.end();let t=super.emit("end");return this.removeAllListeners("end"),t}async collect(){let t=Object.assign([],{dataLength:0});this[k]||(t.dataLength=0);let e=this.promise();return this.on("data",s=>{t.push(s),this[k]||(t.dataLength+=s.length)}),await e,t}async concat(){if(this[k])throw new Error("cannot concat in objectMode");let t=await this.collect();return this[P]?t.join(""):Buffer.concat(t,t.dataLength)}async promise(){return new Promise((t,e)=>{this.on(x,()=>e(new Error("stream destroyed"))),this.on("error",s=>e(s)),this.on("end",()=>t())})}[Symbol.asyncIterator](){this[M]=!1;let t=!1,e=async()=>(this.pause(),t=!0,{value:void 0,done:!0});return{next:()=>{if(t)return e();let i=this.read();if(i!==null)return Promise.resolve({done:!1,value:i});if(this[G])return e();let r,o,h=c=>{this.off("data",a),this.off("end",l),this.off(x,u),e(),o(c)},a=c=>{this.off("error",h),this.off("end",l),this.off(x,u),this.pause(),r({value:c,done:!!this[G]})},l=()=>{this.off("error",h),this.off("data",a),this.off(x,u),e(),r({done:!0,value:void 0})},u=()=>h(new Error("stream destroyed"));return new Promise((c,d)=>{o=d,r=c,this.once(x,u),this.once("error",h),this.once("end",l),this.once("data",a)})},throw:e,return:e,[Symbol.asyncIterator](){return this},[Symbol.asyncDispose]:async()=>{}}}[Symbol.iterator](){this[M]=!1;let t=!1,e=()=>(this.pause(),this.off(Xt,e),this.off(x,e),this.off("end",e),t=!0,{done:!0,value:void 0}),s=()=>{if(t)return e();let i=this.read();return i===null?e():{done:!1,value:i}};return this.once("end",e),this.once(Xt,e),this.once(x,e),{next:s,throw:e,return:e,[Symbol.iterator](){return this},[Symbol.dispose]:()=>{}}}destroy(t){if(this[x])return t?this.emit("error",t):this.emit(x),this;this[x]=!0,this[M]=!0,this[C].length=0,this[T]=0;let e=this;return typeof e.close=="function"&&!this[Rt]&&e.close(),t?this.emit("error",t):this.emit(x),this}static get isStream(){return oi}};var vi=fs__WEBPACK_IMPORTED_MODULE_2__.realpathSync.native,wt={lstatSync:fs__WEBPACK_IMPORTED_MODULE_2__.lstatSync,readdir:fs__WEBPACK_IMPORTED_MODULE_2__.readdir,readdirSync:fs__WEBPACK_IMPORTED_MODULE_2__.readdirSync,readlinkSync:fs__WEBPACK_IMPORTED_MODULE_2__.readlinkSync,realpathSync:vi,promises:{lstat:node_fs_promises__WEBPACK_IMPORTED_MODULE_4__.lstat,readdir:node_fs_promises__WEBPACK_IMPORTED_MODULE_4__.readdir,readlink:node_fs_promises__WEBPACK_IMPORTED_MODULE_4__.readlink,realpath:node_fs_promises__WEBPACK_IMPORTED_MODULE_4__.realpath}},Ue=n=>!n||n===wt||n===/*#__PURE__*/ (node_fs__WEBPACK_IMPORTED_MODULE_3___namespace_cache || (node_fs__WEBPACK_IMPORTED_MODULE_3___namespace_cache = __webpack_require__.t(node_fs__WEBPACK_IMPORTED_MODULE_3__, 2)))?wt:{...wt,...n,promises:{...wt.promises,...n.promises||{}}},$e=/^\\\\\?\\([a-z]:)\\?$/i,Ri=n=>n.replace(/\//g,"\\").replace($e,"$1\\"),Oi=/[\\\/]/,L=0,Ge=1,He=2,U=4,qe=6,Ke=8,X=10,Ve=12,_=15,gt=~_,se=16,je=32,yt=64,j=128,Nt=256,Lt=512,Ie=yt|j|Lt,Fi=1023,ie=n=>n.isFile()?Ke:n.isDirectory()?U:n.isSymbolicLink()?X:n.isCharacterDevice()?He:n.isBlockDevice()?qe:n.isSocket()?Ve:n.isFIFO()?Ge:L,ze=new ft({max:2**12}),bt=n=>{let t=ze.get(n);if(t)return t;let e=n.normalize("NFKD");return ze.set(n,e),e},Be=new ft({max:2**12}),_t=n=>{let t=Be.get(n);if(t)return t;let e=bt(n.toLowerCase());return Be.set(n,e),e},Wt=class extends ft{constructor(){super({max:256})}},ne=class extends ft{constructor(t=16*1024){super({maxSize:t,sizeCalculation:e=>e.length+1})}},Ye=Symbol("PathScurry setAsCwd"),R=class{name;root;roots;parent;nocase;isCWD=!1;#t;#s;get dev(){return this.#s}#n;get mode(){return this.#n}#r;get nlink(){return this.#r}#o;get uid(){return this.#o}#S;get gid(){return this.#S}#w;get rdev(){return this.#w}#c;get blksize(){return this.#c}#h;get ino(){return this.#h}#u;get size(){return this.#u}#f;get blocks(){return this.#f}#a;get atimeMs(){return this.#a}#i;get mtimeMs(){return this.#i}#d;get ctimeMs(){return this.#d}#E;get birthtimeMs(){return this.#E}#b;get atime(){return this.#b}#p;get mtime(){return this.#p}#R;get ctime(){return this.#R}#m;get birthtime(){return this.#m}#C;#T;#g;#y;#x;#A;#e;#_;#M;#k;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(t,e=L,s,i,r,o,h){this.name=t,this.#C=r?_t(t):bt(t),this.#e=e&Fi,this.nocase=r,this.roots=i,this.root=s||this,this.#_=o,this.#g=h.fullpath,this.#x=h.relative,this.#A=h.relativePosix,this.parent=h.parent,this.parent?this.#t=this.parent.#t:this.#t=Ue(h.fs)}depth(){return this.#T!==void 0?this.#T:this.parent?this.#T=this.parent.depth()+1:this.#T=0}childrenCache(){return this.#_}resolve(t){if(!t)return this;let e=this.getRootString(t),i=t.substring(e.length).split(this.splitSep);return e?this.getRoot(e).#N(i):this.#N(i)}#N(t){let e=this;for(let s of t)e=e.child(s);return e}children(){let t=this.#_.get(this);if(t)return t;let e=Object.assign([],{provisional:0});return this.#_.set(this,e),this.#e&=~se,e}child(t,e){if(t===""||t===".")return this;if(t==="..")return this.parent||this;let s=this.children(),i=this.nocase?_t(t):bt(t);for(let a of s)if(a.#C===i)return a;let r=this.parent?this.sep:"",o=this.#g?this.#g+r+t:void 0,h=this.newChild(t,L,{...e,parent:this,fullpath:o});return this.canReaddir()||(h.#e|=j),s.push(h),h}relative(){if(this.isCWD)return"";if(this.#x!==void 0)return this.#x;let t=this.name,e=this.parent;if(!e)return this.#x=this.name;let s=e.relative();return s+(!s||!e.parent?"":this.sep)+t}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(this.#A!==void 0)return this.#A;let t=this.name,e=this.parent;if(!e)return this.#A=this.fullpathPosix();let s=e.relativePosix();return s+(!s||!e.parent?"":"/")+t}fullpath(){if(this.#g!==void 0)return this.#g;let t=this.name,e=this.parent;if(!e)return this.#g=this.name;let i=e.fullpath()+(e.parent?this.sep:"")+t;return this.#g=i}fullpathPosix(){if(this.#y!==void 0)return this.#y;if(this.sep==="/")return this.#y=this.fullpath();if(!this.parent){let i=this.fullpath().replace(/\\/g,"/");return/^[a-z]:\//i.test(i)?this.#y=`//?/${i}`:this.#y=i}let t=this.parent,e=t.fullpathPosix(),s=e+(!e||!t.parent?"":"/")+this.name;return this.#y=s}isUnknown(){return(this.#e&_)===L}isType(t){return this[`is${t}`]()}getType(){return this.isUnknown()?"Unknown":this.isDirectory()?"Directory":this.isFile()?"File":this.isSymbolicLink()?"SymbolicLink":this.isFIFO()?"FIFO":this.isCharacterDevice()?"CharacterDevice":this.isBlockDevice()?"BlockDevice":this.isSocket()?"Socket":"Unknown"}isFile(){return(this.#e&_)===Ke}isDirectory(){return(this.#e&_)===U}isCharacterDevice(){return(this.#e&_)===He}isBlockDevice(){return(this.#e&_)===qe}isFIFO(){return(this.#e&_)===Ge}isSocket(){return(this.#e&_)===Ve}isSymbolicLink(){return(this.#e&X)===X}lstatCached(){return this.#e&je?this:void 0}readlinkCached(){return this.#M}realpathCached(){return this.#k}readdirCached(){let t=this.children();return t.slice(0,t.provisional)}canReadlink(){if(this.#M)return!0;if(!this.parent)return!1;let t=this.#e&_;return!(t!==L&&t!==X||this.#e&Nt||this.#e&j)}calledReaddir(){return!!(this.#e&se)}isENOENT(){return!!(this.#e&j)}isNamed(t){return this.nocase?this.#C===_t(t):this.#C===bt(t)}async readlink(){let t=this.#M;if(t)return t;if(this.canReadlink()&&this.parent)try{let e=await this.#t.promises.readlink(this.fullpath()),s=(await this.parent.realpath())?.resolve(e);if(s)return this.#M=s}catch(e){this.#D(e.code);return}}readlinkSync(){let t=this.#M;if(t)return t;if(this.canReadlink()&&this.parent)try{let e=this.#t.readlinkSync(this.fullpath()),s=this.parent.realpathSync()?.resolve(e);if(s)return this.#M=s}catch(e){this.#D(e.code);return}}#j(t){this.#e|=se;for(let e=t.provisional;e<t.length;e++){let s=t[e];s&&s.#v()}}#v(){this.#e&j||(this.#e=(this.#e|j)>,this.#G())}#G(){let t=this.children();t.provisional=0;for(let e of t)e.#v()}#P(){this.#e|=Lt,this.#L()}#L(){if(this.#e&yt)return;let t=this.#e;(t&_)===U&&(t&=gt),this.#e=t|yt,this.#G()}#I(t=""){t==="ENOTDIR"||t==="EPERM"?this.#L():t==="ENOENT"?this.#v():this.children().provisional=0}#F(t=""){t==="ENOTDIR"?this.parent.#L():t==="ENOENT"&&this.#v()}#D(t=""){let e=this.#e;e|=Nt,t==="ENOENT"&&(e|=j),(t==="EINVAL"||t==="UNKNOWN")&&(e&=gt),this.#e=e,t==="ENOTDIR"&&this.parent&&this.parent.#L()}#z(t,e){return this.#U(t,e)||this.#B(t,e)}#B(t,e){let s=ie(t),i=this.newChild(t.name,s,{parent:this}),r=i.#e&_;return r!==U&&r!==X&&r!==L&&(i.#e|=yt),e.unshift(i),e.provisional++,i}#U(t,e){for(let s=e.provisional;s<e.length;s++){let i=e[s];if((this.nocase?_t(t.name):bt(t.name))===i.#C)return this.#l(t,i,s,e)}}#l(t,e,s,i){let r=e.name;return e.#e=e.#e>|ie(t),r!==t.name&&(e.name=t.name),s!==i.provisional&&(s===i.length-1?i.pop():i.splice(s,1),i.unshift(e)),i.provisional++,e}async lstat(){if((this.#e&j)===0)try{return this.#$(await this.#t.promises.lstat(this.fullpath())),this}catch(t){this.#F(t.code)}}lstatSync(){if((this.#e&j)===0)try{return this.#$(this.#t.lstatSync(this.fullpath())),this}catch(t){this.#F(t.code)}}#$(t){let{atime:e,atimeMs:s,birthtime:i,birthtimeMs:r,blksize:o,blocks:h,ctime:a,ctimeMs:l,dev:u,gid:c,ino:d,mode:f,mtime:m,mtimeMs:p,nlink:w,rdev:g,size:S,uid:E}=t;this.#b=e,this.#a=s,this.#m=i,this.#E=r,this.#c=o,this.#f=h,this.#R=a,this.#d=l,this.#s=u,this.#S=c,this.#h=d,this.#n=f,this.#p=m,this.#i=p,this.#r=w,this.#w=g,this.#u=S,this.#o=E;let y=ie(t);this.#e=this.#e>|y|je,y!==L&&y!==U&&y!==X&&(this.#e|=yt)}#W=[];#O=!1;#H(t){this.#O=!1;let e=this.#W.slice();this.#W.length=0,e.forEach(s=>s(null,t))}readdirCB(t,e=!1){if(!this.canReaddir()){e?t(null,[]):queueMicrotask(()=>t(null,[]));return}let s=this.children();if(this.calledReaddir()){let r=s.slice(0,s.provisional);e?t(null,r):queueMicrotask(()=>t(null,r));return}if(this.#W.push(t),this.#O)return;this.#O=!0;let i=this.fullpath();this.#t.readdir(i,{withFileTypes:!0},(r,o)=>{if(r)this.#I(r.code),s.provisional=0;else{for(let h of o)this.#z(h,s);this.#j(s)}this.#H(s.slice(0,s.provisional))})}#q;async readdir(){if(!this.canReaddir())return[];let t=this.children();if(this.calledReaddir())return t.slice(0,t.provisional);let e=this.fullpath();if(this.#q)await this.#q;else{let s=()=>{};this.#q=new Promise(i=>s=i);try{for(let i of await this.#t.promises.readdir(e,{withFileTypes:!0}))this.#z(i,t);this.#j(t)}catch(i){this.#I(i.code),t.provisional=0}this.#q=void 0,s()}return t.slice(0,t.provisional)}readdirSync(){if(!this.canReaddir())return[];let t=this.children();if(this.calledReaddir())return t.slice(0,t.provisional);let e=this.fullpath();try{for(let s of this.#t.readdirSync(e,{withFileTypes:!0}))this.#z(s,t);this.#j(t)}catch(s){this.#I(s.code),t.provisional=0}return t.slice(0,t.provisional)}canReaddir(){if(this.#e&Ie)return!1;let t=_&this.#e;return t===L||t===U||t===X}shouldWalk(t,e){return(this.#e&U)===U&&!(this.#e&Ie)&&!t.has(this)&&(!e||e(this))}async realpath(){if(this.#k)return this.#k;if(!((Lt|Nt|j)&this.#e))try{let t=await this.#t.promises.realpath(this.fullpath());return this.#k=this.resolve(t)}catch{this.#P()}}realpathSync(){if(this.#k)return this.#k;if(!((Lt|Nt|j)&this.#e))try{let t=this.#t.realpathSync(this.fullpath());return this.#k=this.resolve(t)}catch{this.#P()}}[Ye](t){if(t===this)return;t.isCWD=!1,this.isCWD=!0;let e=new Set([]),s=[],i=this;for(;i&&i.parent;)e.add(i),i.#x=s.join(this.sep),i.#A=s.join("/"),i=i.parent,s.push("..");for(i=t;i&&i.parent&&!e.has(i);)i.#x=void 0,i.#A=void 0,i=i.parent}},Pt=class n extends R{sep="\\";splitSep=Oi;constructor(t,e=L,s,i,r,o,h){super(t,e,s,i,r,o,h)}newChild(t,e=L,s={}){return new n(t,e,this.root,this.roots,this.nocase,this.childrenCache(),s)}getRootString(t){return node_path__WEBPACK_IMPORTED_MODULE_1__.win32.parse(t).root}getRoot(t){if(t=Ri(t.toUpperCase()),t===this.root.name)return this.root;for(let[e,s]of Object.entries(this.roots))if(this.sameRoot(t,e))return this.roots[t]=s;return this.roots[t]=new it(t,this).root}sameRoot(t,e=this.root.name){return t=t.toUpperCase().replace(/\//g,"\\").replace($e,"$1\\"),t===e}},jt=class n extends R{splitSep="/";sep="/";constructor(t,e=L,s,i,r,o,h){super(t,e,s,i,r,o,h)}getRootString(t){return t.startsWith("/")?"/":""}getRoot(t){return this.root}newChild(t,e=L,s={}){return new n(t,e,this.root,this.roots,this.nocase,this.childrenCache(),s)}},It=class{root;rootPath;roots;cwd;#t;#s;#n;nocase;#r;constructor(t=process.cwd(),e,s,{nocase:i,childrenCacheSize:r=16*1024,fs:o=wt}={}){this.#r=Ue(o),(t instanceof URL||t.startsWith("file://"))&&(t=(0,node_url__WEBPACK_IMPORTED_MODULE_0__.fileURLToPath)(t));let h=e.resolve(t);this.roots=Object.create(null),this.rootPath=this.parseRootPath(h),this.#t=new Wt,this.#s=new Wt,this.#n=new ne(r);let a=h.substring(this.rootPath.length).split(s);if(a.length===1&&!a[0]&&a.pop(),i===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=i,this.root=this.newRoot(this.#r),this.roots[this.rootPath]=this.root;let l=this.root,u=a.length-1,c=e.sep,d=this.rootPath,f=!1;for(let m of a){let p=u--;l=l.child(m,{relative:new Array(p).fill("..").join(c),relativePosix:new Array(p).fill("..").join("/"),fullpath:d+=(f?"":c)+m}),f=!0}this.cwd=l}depth(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.depth()}childrenCache(){return this.#n}resolve(...t){let e="";for(let r=t.length-1;r>=0;r--){let o=t[r];if(!(!o||o===".")&&(e=e?`${o}/${e}`:o,this.isAbsolute(o)))break}let s=this.#t.get(e);if(s!==void 0)return s;let i=this.cwd.resolve(e).fullpath();return this.#t.set(e,i),i}resolvePosix(...t){let e="";for(let r=t.length-1;r>=0;r--){let o=t[r];if(!(!o||o===".")&&(e=e?`${o}/${e}`:o,this.isAbsolute(o)))break}let s=this.#s.get(e);if(s!==void 0)return s;let i=this.cwd.resolve(e).fullpathPosix();return this.#s.set(e,i),i}relative(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.relative()}relativePosix(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.relativePosix()}basename(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.name}dirname(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),(t.parent||t).fullpath()}async readdir(t=this.cwd,e={withFileTypes:!0}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof R||(e=t,t=this.cwd);let{withFileTypes:s}=e;if(t.canReaddir()){let i=await t.readdir();return s?i:i.map(r=>r.name)}else return[]}readdirSync(t=this.cwd,e={withFileTypes:!0}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof R||(e=t,t=this.cwd);let{withFileTypes:s=!0}=e;return t.canReaddir()?s?t.readdirSync():t.readdirSync().map(i=>i.name):[]}async lstat(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.lstat()}lstatSync(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.lstatSync()}async readlink(t=this.cwd,{withFileTypes:e}={withFileTypes:!1}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof R||(e=t.withFileTypes,t=this.cwd);let s=await t.readlink();return e?s:s?.fullpath()}readlinkSync(t=this.cwd,{withFileTypes:e}={withFileTypes:!1}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof R||(e=t.withFileTypes,t=this.cwd);let s=t.readlinkSync();return e?s:s?.fullpath()}async realpath(t=this.cwd,{withFileTypes:e}={withFileTypes:!1}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof R||(e=t.withFileTypes,t=this.cwd);let s=await t.realpath();return e?s:s?.fullpath()}realpathSync(t=this.cwd,{withFileTypes:e}={withFileTypes:!1}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof R||(e=t.withFileTypes,t=this.cwd);let s=t.realpathSync();return e?s:s?.fullpath()}async walk(t=this.cwd,e={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof R||(e=t,t=this.cwd);let{withFileTypes:s=!0,follow:i=!1,filter:r,walkFilter:o}=e,h=[];(!r||r(t))&&h.push(s?t:t.fullpath());let a=new Set,l=(c,d)=>{a.add(c),c.readdirCB((f,m)=>{if(f)return d(f);let p=m.length;if(!p)return d();let w=()=>{--p===0&&d()};for(let g of m)(!r||r(g))&&h.push(s?g:g.fullpath()),i&&g.isSymbolicLink()?g.realpath().then(S=>S?.isUnknown()?S.lstat():S).then(S=>S?.shouldWalk(a,o)?l(S,w):w()):g.shouldWalk(a,o)?l(g,w):w()},!0)},u=t;return new Promise((c,d)=>{l(u,f=>{if(f)return d(f);c(h)})})}walkSync(t=this.cwd,e={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof R||(e=t,t=this.cwd);let{withFileTypes:s=!0,follow:i=!1,filter:r,walkFilter:o}=e,h=[];(!r||r(t))&&h.push(s?t:t.fullpath());let a=new Set([t]);for(let l of a){let u=l.readdirSync();for(let c of u){(!r||r(c))&&h.push(s?c:c.fullpath());let d=c;if(c.isSymbolicLink()){if(!(i&&(d=c.realpathSync())))continue;d.isUnknown()&&d.lstatSync()}d.shouldWalk(a,o)&&a.add(d)}}return h}[Symbol.asyncIterator](){return this.iterate()}iterate(t=this.cwd,e={}){return typeof t=="string"?t=this.cwd.resolve(t):t instanceof R||(e=t,t=this.cwd),this.stream(t,e)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(t=this.cwd,e={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof R||(e=t,t=this.cwd);let{withFileTypes:s=!0,follow:i=!1,filter:r,walkFilter:o}=e;(!r||r(t))&&(yield s?t:t.fullpath());let h=new Set([t]);for(let a of h){let l=a.readdirSync();for(let u of l){(!r||r(u))&&(yield s?u:u.fullpath());let c=u;if(u.isSymbolicLink()){if(!(i&&(c=u.realpathSync())))continue;c.isUnknown()&&c.lstatSync()}c.shouldWalk(h,o)&&h.add(c)}}}stream(t=this.cwd,e={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof R||(e=t,t=this.cwd);let{withFileTypes:s=!0,follow:i=!1,filter:r,walkFilter:o}=e,h=new V({objectMode:!0});(!r||r(t))&&h.write(s?t:t.fullpath());let a=new Set,l=[t],u=0,c=()=>{let d=!1;for(;!d;){let f=l.shift();if(!f){u===0&&h.end();return}u++,a.add(f);let m=(w,g,S=!1)=>{if(w)return h.emit("error",w);if(i&&!S){let E=[];for(let y of g)y.isSymbolicLink()&&E.push(y.realpath().then(b=>b?.isUnknown()?b.lstat():b));if(E.length){Promise.all(E).then(()=>m(null,g,!0));return}}for(let E of g)E&&(!r||r(E))&&(h.write(s?E:E.fullpath())||(d=!0));u--;for(let E of g){let y=E.realpathCached()||E;y.shouldWalk(a,o)&&l.push(y)}d&&!h.flowing?h.once("drain",c):p||c()},p=!0;f.readdirCB(m,!0),p=!1}};return c(),h}streamSync(t=this.cwd,e={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof R||(e=t,t=this.cwd);let{withFileTypes:s=!0,follow:i=!1,filter:r,walkFilter:o}=e,h=new V({objectMode:!0}),a=new Set;(!r||r(t))&&h.write(s?t:t.fullpath());let l=[t],u=0,c=()=>{let d=!1;for(;!d;){let f=l.shift();if(!f){u===0&&h.end();return}u++,a.add(f);let m=f.readdirSync();for(let p of m)(!r||r(p))&&(h.write(s?p:p.fullpath())||(d=!0));u--;for(let p of m){let w=p;if(p.isSymbolicLink()){if(!(i&&(w=p.realpathSync())))continue;w.isUnknown()&&w.lstatSync()}w.shouldWalk(a,o)&&l.push(w)}}d&&!h.flowing&&h.once("drain",c)};return c(),h}chdir(t=this.cwd){let e=this.cwd;this.cwd=typeof t=="string"?this.cwd.resolve(t):t,this.cwd[Ye](e)}},it=class extends It{sep="\\";constructor(t=process.cwd(),e={}){let{nocase:s=!0}=e;super(t,node_path__WEBPACK_IMPORTED_MODULE_1__.win32,"\\",{...e,nocase:s}),this.nocase=s;for(let i=this.cwd;i;i=i.parent)i.nocase=this.nocase}parseRootPath(t){return node_path__WEBPACK_IMPORTED_MODULE_1__.win32.parse(t).root.toUpperCase()}newRoot(t){return new Pt(this.rootPath,U,void 0,this.roots,this.nocase,this.childrenCache(),{fs:t})}isAbsolute(t){return t.startsWith("/")||t.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(t)}},rt=class extends It{sep="/";constructor(t=process.cwd(),e={}){let{nocase:s=!1}=e;super(t,node_path__WEBPACK_IMPORTED_MODULE_1__.posix,"/",{...e,nocase:s}),this.nocase=s}parseRootPath(t){return"/"}newRoot(t){return new jt(this.rootPath,U,void 0,this.roots,this.nocase,this.childrenCache(),{fs:t})}isAbsolute(t){return t.startsWith("/")}},St=class extends rt{constructor(t=process.cwd(),e={}){let{nocase:s=!0}=e;super(t,{...e,nocase:s})}},Cr=process.platform==="win32"?Pt:jt,Xe=process.platform==="win32"?it:process.platform==="darwin"?St:rt;var Di=n=>n.length>=1,Mi=n=>n.length>=1,Ni=Symbol.for("nodejs.util.inspect.custom"),nt=class n{#t;#s;#n;length;#r;#o;#S;#w;#c;#h;#u=!0;constructor(t,e,s,i){if(!Di(t))throw new TypeError("empty pattern list");if(!Mi(e))throw new TypeError("empty glob list");if(e.length!==t.length)throw new TypeError("mismatched pattern list and glob list lengths");if(this.length=t.length,s<0||s>=this.length)throw new TypeError("index out of range");if(this.#t=t,this.#s=e,this.#n=s,this.#r=i,this.#n===0){if(this.isUNC()){let[r,o,h,a,...l]=this.#t,[u,c,d,f,...m]=this.#s;l[0]===""&&(l.shift(),m.shift());let p=[r,o,h,a,""].join("/"),w=[u,c,d,f,""].join("/");this.#t=[p,...l],this.#s=[w,...m],this.length=this.#t.length}else if(this.isDrive()||this.isAbsolute()){let[r,...o]=this.#t,[h,...a]=this.#s;o[0]===""&&(o.shift(),a.shift());let l=r+"/",u=h+"/";this.#t=[l,...o],this.#s=[u,...a],this.length=this.#t.length}}}[Ni](){return"Pattern <"+this.#s.slice(this.#n).join("/")+">"}pattern(){return this.#t[this.#n]}isString(){return typeof this.#t[this.#n]=="string"}isGlobstar(){return this.#t[this.#n]===A}isRegExp(){return this.#t[this.#n]instanceof RegExp}globString(){return this.#S=this.#S||(this.#n===0?this.isAbsolute()?this.#s[0]+this.#s.slice(1).join("/"):this.#s.join("/"):this.#s.slice(this.#n).join("/"))}hasMore(){return this.length>this.#n+1}rest(){return this.#o!==void 0?this.#o:this.hasMore()?(this.#o=new n(this.#t,this.#s,this.#n+1,this.#r),this.#o.#h=this.#h,this.#o.#c=this.#c,this.#o.#w=this.#w,this.#o):this.#o=null}isUNC(){let t=this.#t;return this.#c!==void 0?this.#c:this.#c=this.#r==="win32"&&this.#n===0&&t[0]===""&&t[1]===""&&typeof t[2]=="string"&&!!t[2]&&typeof t[3]=="string"&&!!t[3]}isDrive(){let t=this.#t;return this.#w!==void 0?this.#w:this.#w=this.#r==="win32"&&this.#n===0&&this.length>1&&typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0])}isAbsolute(){let t=this.#t;return this.#h!==void 0?this.#h:this.#h=t[0]===""&&t.length>1||this.isDrive()||this.isUNC()}root(){let t=this.#t[0];return typeof t=="string"&&this.isAbsolute()&&this.#n===0?t:""}checkFollowGlobstar(){return!(this.#n===0||!this.isGlobstar()||!this.#u)}markFollowGlobstar(){return this.#n===0||!this.isGlobstar()||!this.#u?!1:(this.#u=!1,!0)}};var _i=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",ot=class{relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(t,{nobrace:e,nocase:s,noext:i,noglobstar:r,platform:o=_i}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=o,this.mmopts={dot:!0,nobrace:e,nocase:s,noext:i,noglobstar:r,optimizationLevel:2,platform:o,nocomment:!0,nonegate:!0};for(let h of t)this.add(h)}add(t){let e=new D(t,this.mmopts);for(let s=0;s<e.set.length;s++){let i=e.set[s],r=e.globParts[s];if(!i||!r)throw new Error("invalid pattern object");for(;i[0]==="."&&r[0]===".";)i.shift(),r.shift();let o=new nt(i,r,0,this.platform),h=new D(o.globString(),this.mmopts),a=r[r.length-1]==="**",l=o.isAbsolute();l?this.absolute.push(h):this.relative.push(h),a&&(l?this.absoluteChildren.push(h):this.relativeChildren.push(h))}}ignored(t){let e=t.fullpath(),s=`${e}/`,i=t.relative()||".",r=`${i}/`;for(let o of this.relative)if(o.match(i)||o.match(r))return!0;for(let o of this.absolute)if(o.match(e)||o.match(s))return!0;return!1}childrenIgnored(t){let e=t.fullpath()+"/",s=(t.relative()||".")+"/";for(let i of this.relativeChildren)if(i.match(s))return!0;for(let i of this.absoluteChildren)if(i.match(e))return!0;return!1}};var oe=class n{store;constructor(t=new Map){this.store=t}copy(){return new n(new Map(this.store))}hasWalked(t,e){return this.store.get(t.fullpath())?.has(e.globString())}storeWalked(t,e){let s=t.fullpath(),i=this.store.get(s);i?i.add(e.globString()):this.store.set(s,new Set([e.globString()]))}},he=class{store=new Map;add(t,e,s){let i=(e?2:0)|(s?1:0),r=this.store.get(t);this.store.set(t,r===void 0?i:i&r)}entries(){return[...this.store.entries()].map(([t,e])=>[t,!!(e&2),!!(e&1)])}},ae=class{store=new Map;add(t,e){if(!t.canReaddir())return;let s=this.store.get(t);s?s.find(i=>i.globString()===e.globString())||s.push(e):this.store.set(t,[e])}get(t){let e=this.store.get(t);if(!e)throw new Error("attempting to walk unknown path");return e}entries(){return this.keys().map(t=>[t,this.store.get(t)])}keys(){return[...this.store.keys()].filter(t=>t.canReaddir())}},Et=class n{hasWalkedCache;matches=new he;subwalks=new ae;patterns;follow;dot;opts;constructor(t,e){this.opts=t,this.follow=!!t.follow,this.dot=!!t.dot,this.hasWalkedCache=e?e.copy():new oe}processPatterns(t,e){this.patterns=e;let s=e.map(i=>[t,i]);for(let[i,r]of s){this.hasWalkedCache.storeWalked(i,r);let o=r.root(),h=r.isAbsolute()&&this.opts.absolute!==!1;if(o){i=i.resolve(o==="/"&&this.opts.root!==void 0?this.opts.root:o);let c=r.rest();if(c)r=c;else{this.matches.add(i,!0,!1);continue}}if(i.isENOENT())continue;let a,l,u=!1;for(;typeof(a=r.pattern())=="string"&&(l=r.rest());)i=i.resolve(a),r=l,u=!0;if(a=r.pattern(),l=r.rest(),u){if(this.hasWalkedCache.hasWalked(i,r))continue;this.hasWalkedCache.storeWalked(i,r)}if(typeof a=="string"){let c=a===".."||a===""||a===".";this.matches.add(i.resolve(a),h,c);continue}else if(a===A){(!i.isSymbolicLink()||this.follow||r.checkFollowGlobstar())&&this.subwalks.add(i,r);let c=l?.pattern(),d=l?.rest();if(!l||(c===""||c===".")&&!d)this.matches.add(i,h,c===""||c===".");else if(c===".."){let f=i.parent||i;d?this.hasWalkedCache.hasWalked(f,d)||this.subwalks.add(f,d):this.matches.add(f,h,!0)}}else a instanceof RegExp&&this.subwalks.add(i,r)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new n(this.opts,this.hasWalkedCache)}filterEntries(t,e){let s=this.subwalks.get(t),i=this.child();for(let r of e)for(let o of s){let h=o.isAbsolute(),a=o.pattern(),l=o.rest();a===A?i.testGlobstar(r,o,l,h):a instanceof RegExp?i.testRegExp(r,a,l,h):i.testString(r,a,l,h)}return i}testGlobstar(t,e,s,i){if((this.dot||!t.name.startsWith("."))&&(e.hasMore()||this.matches.add(t,i,!1),t.canReaddir()&&(this.follow||!t.isSymbolicLink()?this.subwalks.add(t,e):t.isSymbolicLink()&&(s&&e.checkFollowGlobstar()?this.subwalks.add(t,s):e.markFollowGlobstar()&&this.subwalks.add(t,e)))),s){let r=s.pattern();if(typeof r=="string"&&r!==".."&&r!==""&&r!==".")this.testString(t,r,s.rest(),i);else if(r===".."){let o=t.parent||t;this.subwalks.add(o,s)}else r instanceof RegExp&&this.testRegExp(t,r,s.rest(),i)}}testRegExp(t,e,s,i){e.test(t.name)&&(s?this.subwalks.add(t,s):this.matches.add(t,i,!1))}testString(t,e,s,i){t.isNamed(e)&&(s?this.subwalks.add(t,s):this.matches.add(t,i,!1))}};var Li=(n,t)=>typeof n=="string"?new ot([n],t):Array.isArray(n)?new ot(n,t):n,zt=class{path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#t=[];#s;#n;signal;maxDepth;includeChildMatches;constructor(t,e,s){if(this.patterns=t,this.path=e,this.opts=s,this.#n=!s.posix&&s.platform==="win32"?"\\":"/",this.includeChildMatches=s.includeChildMatches!==!1,(s.ignore||!this.includeChildMatches)&&(this.#s=Li(s.ignore??[],s),!this.includeChildMatches&&typeof this.#s.add!="function")){let i="cannot ignore child matches, ignore lacks add() method.";throw new Error(i)}this.maxDepth=s.maxDepth||1/0,s.signal&&(this.signal=s.signal,this.signal.addEventListener("abort",()=>{this.#t.length=0}))}#r(t){return this.seen.has(t)||!!this.#s?.ignored?.(t)}#o(t){return!!this.#s?.childrenIgnored?.(t)}pause(){this.paused=!0}resume(){if(this.signal?.aborted)return;this.paused=!1;let t;for(;!this.paused&&(t=this.#t.shift());)t()}onResume(t){this.signal?.aborted||(this.paused?this.#t.push(t):t())}async matchCheck(t,e){if(e&&this.opts.nodir)return;let s;if(this.opts.realpath){if(s=t.realpathCached()||await t.realpath(),!s)return;t=s}let r=t.isUnknown()||this.opts.stat?await t.lstat():t;if(this.opts.follow&&this.opts.nodir&&r?.isSymbolicLink()){let o=await r.realpath();o&&(o.isUnknown()||this.opts.stat)&&await o.lstat()}return this.matchCheckTest(r,e)}matchCheckTest(t,e){return t&&(this.maxDepth===1/0||t.depth()<=this.maxDepth)&&(!e||t.canReaddir())&&(!this.opts.nodir||!t.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!t.isSymbolicLink()||!t.realpathCached()?.isDirectory())&&!this.#r(t)?t:void 0}matchCheckSync(t,e){if(e&&this.opts.nodir)return;let s;if(this.opts.realpath){if(s=t.realpathCached()||t.realpathSync(),!s)return;t=s}let r=t.isUnknown()||this.opts.stat?t.lstatSync():t;if(this.opts.follow&&this.opts.nodir&&r?.isSymbolicLink()){let o=r.realpathSync();o&&(o?.isUnknown()||this.opts.stat)&&o.lstatSync()}return this.matchCheckTest(r,e)}matchFinish(t,e){if(this.#r(t))return;if(!this.includeChildMatches&&this.#s?.add){let r=`${t.relativePosix()}/**`;this.#s.add(r)}let s=this.opts.absolute===void 0?e:this.opts.absolute;this.seen.add(t);let i=this.opts.mark&&t.isDirectory()?this.#n:"";if(this.opts.withFileTypes)this.matchEmit(t);else if(s){let r=this.opts.posix?t.fullpathPosix():t.fullpath();this.matchEmit(r+i)}else{let r=this.opts.posix?t.relativePosix():t.relative(),o=this.opts.dotRelative&&!r.startsWith(".."+this.#n)?"."+this.#n:"";this.matchEmit(r?o+r+i:"."+i)}}async match(t,e,s){let i=await this.matchCheck(t,s);i&&this.matchFinish(i,e)}matchSync(t,e,s){let i=this.matchCheckSync(t,s);i&&this.matchFinish(i,e)}walkCB(t,e,s){this.signal?.aborted&&s(),this.walkCB2(t,e,new Et(this.opts),s)}walkCB2(t,e,s,i){if(this.#o(t))return i();if(this.signal?.aborted&&i(),this.paused){this.onResume(()=>this.walkCB2(t,e,s,i));return}s.processPatterns(t,e);let r=1,o=()=>{--r===0&&i()};for(let[h,a,l]of s.matches.entries())this.#r(h)||(r++,this.match(h,a,l).then(()=>o()));for(let h of s.subwalkTargets()){if(this.maxDepth!==1/0&&h.depth()>=this.maxDepth)continue;r++;let a=h.readdirCached();h.calledReaddir()?this.walkCB3(h,a,s,o):h.readdirCB((l,u)=>this.walkCB3(h,u,s,o),!0)}o()}walkCB3(t,e,s,i){s=s.filterEntries(t,e);let r=1,o=()=>{--r===0&&i()};for(let[h,a,l]of s.matches.entries())this.#r(h)||(r++,this.match(h,a,l).then(()=>o()));for(let[h,a]of s.subwalks.entries())r++,this.walkCB2(h,a,s.child(),o);o()}walkCBSync(t,e,s){this.signal?.aborted&&s(),this.walkCB2Sync(t,e,new Et(this.opts),s)}walkCB2Sync(t,e,s,i){if(this.#o(t))return i();if(this.signal?.aborted&&i(),this.paused){this.onResume(()=>this.walkCB2Sync(t,e,s,i));return}s.processPatterns(t,e);let r=1,o=()=>{--r===0&&i()};for(let[h,a,l]of s.matches.entries())this.#r(h)||this.matchSync(h,a,l);for(let h of s.subwalkTargets()){if(this.maxDepth!==1/0&&h.depth()>=this.maxDepth)continue;r++;let a=h.readdirSync();this.walkCB3Sync(h,a,s,o)}o()}walkCB3Sync(t,e,s,i){s=s.filterEntries(t,e);let r=1,o=()=>{--r===0&&i()};for(let[h,a,l]of s.matches.entries())this.#r(h)||this.matchSync(h,a,l);for(let[h,a]of s.subwalks.entries())r++,this.walkCB2Sync(h,a,s.child(),o);o()}},xt=class extends zt{matches=new Set;constructor(t,e,s){super(t,e,s)}matchEmit(t){this.matches.add(t)}async walk(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&await this.path.lstat(),await new Promise((t,e)=>{this.walkCB(this.path,this.patterns,()=>{this.signal?.aborted?e(this.signal.reason):t(this.matches)})}),this.matches}walkSync(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>{if(this.signal?.aborted)throw this.signal.reason}),this.matches}},vt=class extends zt{results;constructor(t,e,s){super(t,e,s),this.results=new V({signal:this.signal,objectMode:!0}),this.results.on("drain",()=>this.resume()),this.results.on("resume",()=>this.resume())}matchEmit(t){this.results.write(t),this.results.flowing||this.pause()}stream(){let t=this.path;return t.isUnknown()?t.lstat().then(()=>{this.walkCB(t,this.patterns,()=>this.results.end())}):this.walkCB(t,this.patterns,()=>this.results.end()),this.results}streamSync(){return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>this.results.end()),this.results}};var Pi=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",I=class{absolute;cwd;root;dot;dotRelative;follow;ignore;magicalBraces;mark;matchBase;maxDepth;nobrace;nocase;nodir;noext;noglobstar;pattern;platform;realpath;scurry;stat;signal;windowsPathsNoEscape;withFileTypes;includeChildMatches;opts;patterns;constructor(t,e){if(!e)throw new TypeError("glob options required");if(this.withFileTypes=!!e.withFileTypes,this.signal=e.signal,this.follow=!!e.follow,this.dot=!!e.dot,this.dotRelative=!!e.dotRelative,this.nodir=!!e.nodir,this.mark=!!e.mark,e.cwd?(e.cwd instanceof URL||e.cwd.startsWith("file://"))&&(e.cwd=(0,node_url__WEBPACK_IMPORTED_MODULE_0__.fileURLToPath)(e.cwd)):this.cwd="",this.cwd=e.cwd||"",this.root=e.root,this.magicalBraces=!!e.magicalBraces,this.nobrace=!!e.nobrace,this.noext=!!e.noext,this.realpath=!!e.realpath,this.absolute=e.absolute,this.includeChildMatches=e.includeChildMatches!==!1,this.noglobstar=!!e.noglobstar,this.matchBase=!!e.matchBase,this.maxDepth=typeof e.maxDepth=="number"?e.maxDepth:1/0,this.stat=!!e.stat,this.ignore=e.ignore,this.withFileTypes&&this.absolute!==void 0)throw new Error("cannot set absolute and withFileTypes:true");if(typeof t=="string"&&(t=[t]),this.windowsPathsNoEscape=!!e.windowsPathsNoEscape||e.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(t=t.map(a=>a.replace(/\\/g,"/"))),this.matchBase){if(e.noglobstar)throw new TypeError("base matching requires globstar");t=t.map(a=>a.includes("/")?a:`./**/${a}`)}if(this.pattern=t,this.platform=e.platform||Pi,this.opts={...e,platform:this.platform},e.scurry){if(this.scurry=e.scurry,e.nocase!==void 0&&e.nocase!==e.scurry.nocase)throw new Error("nocase option contradicts provided scurry option")}else{let a=e.platform==="win32"?it:e.platform==="darwin"?St:e.platform?rt:Xe;this.scurry=new a(this.cwd,{nocase:e.nocase,fs:e.fs})}this.nocase=this.scurry.nocase;let s=this.platform==="darwin"||this.platform==="win32",i={braceExpandMax:1e4,...e,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:s,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug},r=this.pattern.map(a=>new D(a,i)),[o,h]=r.reduce((a,l)=>(a[0].push(...l.set),a[1].push(...l.globParts),a),[[],[]]);this.patterns=o.map((a,l)=>{let u=h[l];if(!u)throw new Error("invalid pattern object");return new nt(a,u,0,this.platform)})}async walk(){return[...await new xt(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walk()]}walkSync(){return[...new xt(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walkSync()]}stream(){return new vt(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).stream()}streamSync(){return new vt(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).streamSync()}iterateSync(){return this.streamSync()[Symbol.iterator]()}[Symbol.iterator](){return this.iterateSync()}iterate(){return this.stream()[Symbol.asyncIterator]()}[Symbol.asyncIterator](){return this.iterate()}};var le=(n,t={})=>{Array.isArray(n)||(n=[n]);for(let e of n)if(new D(e,t).hasMagic())return!0;return!1};function Bt(n,t={}){return new I(n,t).streamSync()}function Qe(n,t={}){return new I(n,t).stream()}function ts(n,t={}){return new I(n,t).walkSync()}async function Je(n,t={}){return new I(n,t).walk()}function Ut(n,t={}){return new I(n,t).iterateSync()}function es(n,t={}){return new I(n,t).iterate()}var ji=Bt,Ii=Object.assign(Qe,{sync:Bt}),zi=Ut,Bi=Object.assign(es,{sync:Ut}),Ui=Object.assign(ts,{stream:Bt,iterate:Ut}),Ze=Object.assign(Je,{glob:Je,globSync:ts,sync:Ui,globStream:Qe,stream:Ii,globStreamSync:Bt,streamSync:ji,globIterate:es,iterate:Bi,globIterateSync:Ut,iterateSync:zi,Glob:I,hasMagic:le,escape:tt,unescape:W});Ze.glob=Ze;
|
|
11787
|
-
//# sourceMappingURL=index.min.js.map
|
|
11788
|
-
|
|
11789
|
-
|
|
11790
14275
|
/***/ }),
|
|
11791
14276
|
|
|
11792
14277
|
/***/ 6378:
|
|
@@ -13226,6 +15711,922 @@ async function* tar(e) {
|
|
|
13226
15711
|
//# sourceMappingURL=multitars.mjs.map
|
|
13227
15712
|
|
|
13228
15713
|
|
|
15714
|
+
/***/ }),
|
|
15715
|
+
|
|
15716
|
+
/***/ 304:
|
|
15717
|
+
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|
15718
|
+
|
|
15719
|
+
"use strict";
|
|
15720
|
+
|
|
15721
|
+
// EXPORTS
|
|
15722
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
15723
|
+
TI: () => (/* binding */ glob)
|
|
15724
|
+
});
|
|
15725
|
+
|
|
15726
|
+
// UNUSED EXPORTS: convertPathToPattern, escapePath, globSync, isDynamicPattern
|
|
15727
|
+
|
|
15728
|
+
// EXTERNAL MODULE: external "fs"
|
|
15729
|
+
var external_fs_ = __webpack_require__(9896);
|
|
15730
|
+
var external_fs_namespaceObject = /*#__PURE__*/__webpack_require__.t(external_fs_, 2);
|
|
15731
|
+
// EXTERNAL MODULE: external "path"
|
|
15732
|
+
var external_path_ = __webpack_require__(6928);
|
|
15733
|
+
// EXTERNAL MODULE: external "url"
|
|
15734
|
+
var external_url_ = __webpack_require__(7016);
|
|
15735
|
+
// EXTERNAL MODULE: external "module"
|
|
15736
|
+
var external_module_ = __webpack_require__(3339);
|
|
15737
|
+
;// CONCATENATED MODULE: ../../node_modules/.pnpm/fdir@6.5.0_picomatch@4.0.7/node_modules/fdir/dist/index.mjs
|
|
15738
|
+
|
|
15739
|
+
|
|
15740
|
+
|
|
15741
|
+
|
|
15742
|
+
//#region rolldown:runtime
|
|
15743
|
+
var __require = /* @__PURE__ */ (0,external_module_.createRequire)(require("url").pathToFileURL(__filename).href);
|
|
15744
|
+
|
|
15745
|
+
//#endregion
|
|
15746
|
+
//#region src/utils.ts
|
|
15747
|
+
function cleanPath(path) {
|
|
15748
|
+
let normalized = (0,external_path_.normalize)(path);
|
|
15749
|
+
if (normalized.length > 1 && normalized[normalized.length - 1] === external_path_.sep) normalized = normalized.substring(0, normalized.length - 1);
|
|
15750
|
+
return normalized;
|
|
15751
|
+
}
|
|
15752
|
+
const SLASHES_REGEX = /[\\/]/g;
|
|
15753
|
+
function convertSlashes(path, separator) {
|
|
15754
|
+
return path.replace(SLASHES_REGEX, separator);
|
|
15755
|
+
}
|
|
15756
|
+
const WINDOWS_ROOT_DIR_REGEX = /^[a-z]:[\\/]$/i;
|
|
15757
|
+
function isRootDirectory(path) {
|
|
15758
|
+
return path === "/" || WINDOWS_ROOT_DIR_REGEX.test(path);
|
|
15759
|
+
}
|
|
15760
|
+
function normalizePath(path, options) {
|
|
15761
|
+
const { resolvePaths, normalizePath: normalizePath$1, pathSeparator } = options;
|
|
15762
|
+
const pathNeedsCleaning = process.platform === "win32" && path.includes("/") || path.startsWith(".");
|
|
15763
|
+
if (resolvePaths) path = (0,external_path_.resolve)(path);
|
|
15764
|
+
if (normalizePath$1 || pathNeedsCleaning) path = cleanPath(path);
|
|
15765
|
+
if (path === ".") return "";
|
|
15766
|
+
const needsSeperator = path[path.length - 1] !== pathSeparator;
|
|
15767
|
+
return convertSlashes(needsSeperator ? path + pathSeparator : path, pathSeparator);
|
|
15768
|
+
}
|
|
15769
|
+
|
|
15770
|
+
//#endregion
|
|
15771
|
+
//#region src/api/functions/join-path.ts
|
|
15772
|
+
function joinPathWithBasePath(filename, directoryPath) {
|
|
15773
|
+
return directoryPath + filename;
|
|
15774
|
+
}
|
|
15775
|
+
function joinPathWithRelativePath(root, options) {
|
|
15776
|
+
return function(filename, directoryPath) {
|
|
15777
|
+
const sameRoot = directoryPath.startsWith(root);
|
|
15778
|
+
if (sameRoot) return directoryPath.slice(root.length) + filename;
|
|
15779
|
+
else return convertSlashes((0,external_path_.relative)(root, directoryPath), options.pathSeparator) + options.pathSeparator + filename;
|
|
15780
|
+
};
|
|
15781
|
+
}
|
|
15782
|
+
function joinPath(filename) {
|
|
15783
|
+
return filename;
|
|
15784
|
+
}
|
|
15785
|
+
function joinDirectoryPath(filename, directoryPath, separator) {
|
|
15786
|
+
return directoryPath + filename + separator;
|
|
15787
|
+
}
|
|
15788
|
+
function build$7(root, options) {
|
|
15789
|
+
const { relativePaths, includeBasePath } = options;
|
|
15790
|
+
return relativePaths && root ? joinPathWithRelativePath(root, options) : includeBasePath ? joinPathWithBasePath : joinPath;
|
|
15791
|
+
}
|
|
15792
|
+
|
|
15793
|
+
//#endregion
|
|
15794
|
+
//#region src/api/functions/push-directory.ts
|
|
15795
|
+
function pushDirectoryWithRelativePath(root) {
|
|
15796
|
+
return function(directoryPath, paths) {
|
|
15797
|
+
paths.push(directoryPath.substring(root.length) || ".");
|
|
15798
|
+
};
|
|
15799
|
+
}
|
|
15800
|
+
function pushDirectoryFilterWithRelativePath(root) {
|
|
15801
|
+
return function(directoryPath, paths, filters) {
|
|
15802
|
+
const relativePath = directoryPath.substring(root.length) || ".";
|
|
15803
|
+
if (filters.every((filter) => filter(relativePath, true))) paths.push(relativePath);
|
|
15804
|
+
};
|
|
15805
|
+
}
|
|
15806
|
+
const pushDirectory = (directoryPath, paths) => {
|
|
15807
|
+
paths.push(directoryPath || ".");
|
|
15808
|
+
};
|
|
15809
|
+
const pushDirectoryFilter = (directoryPath, paths, filters) => {
|
|
15810
|
+
const path = directoryPath || ".";
|
|
15811
|
+
if (filters.every((filter) => filter(path, true))) paths.push(path);
|
|
15812
|
+
};
|
|
15813
|
+
const empty$2 = () => {};
|
|
15814
|
+
function build$6(root, options) {
|
|
15815
|
+
const { includeDirs, filters, relativePaths } = options;
|
|
15816
|
+
if (!includeDirs) return empty$2;
|
|
15817
|
+
if (relativePaths) return filters && filters.length ? pushDirectoryFilterWithRelativePath(root) : pushDirectoryWithRelativePath(root);
|
|
15818
|
+
return filters && filters.length ? pushDirectoryFilter : pushDirectory;
|
|
15819
|
+
}
|
|
15820
|
+
|
|
15821
|
+
//#endregion
|
|
15822
|
+
//#region src/api/functions/push-file.ts
|
|
15823
|
+
const pushFileFilterAndCount = (filename, _paths, counts, filters) => {
|
|
15824
|
+
if (filters.every((filter) => filter(filename, false))) counts.files++;
|
|
15825
|
+
};
|
|
15826
|
+
const pushFileFilter = (filename, paths, _counts, filters) => {
|
|
15827
|
+
if (filters.every((filter) => filter(filename, false))) paths.push(filename);
|
|
15828
|
+
};
|
|
15829
|
+
const pushFileCount = (_filename, _paths, counts, _filters) => {
|
|
15830
|
+
counts.files++;
|
|
15831
|
+
};
|
|
15832
|
+
const pushFile = (filename, paths) => {
|
|
15833
|
+
paths.push(filename);
|
|
15834
|
+
};
|
|
15835
|
+
const empty$1 = () => {};
|
|
15836
|
+
function build$5(options) {
|
|
15837
|
+
const { excludeFiles, filters, onlyCounts } = options;
|
|
15838
|
+
if (excludeFiles) return empty$1;
|
|
15839
|
+
if (filters && filters.length) return onlyCounts ? pushFileFilterAndCount : pushFileFilter;
|
|
15840
|
+
else if (onlyCounts) return pushFileCount;
|
|
15841
|
+
else return pushFile;
|
|
15842
|
+
}
|
|
15843
|
+
|
|
15844
|
+
//#endregion
|
|
15845
|
+
//#region src/api/functions/get-array.ts
|
|
15846
|
+
const getArray = (paths) => {
|
|
15847
|
+
return paths;
|
|
15848
|
+
};
|
|
15849
|
+
const getArrayGroup = () => {
|
|
15850
|
+
return [""].slice(0, 0);
|
|
15851
|
+
};
|
|
15852
|
+
function build$4(options) {
|
|
15853
|
+
return options.group ? getArrayGroup : getArray;
|
|
15854
|
+
}
|
|
15855
|
+
|
|
15856
|
+
//#endregion
|
|
15857
|
+
//#region src/api/functions/group-files.ts
|
|
15858
|
+
const groupFiles = (groups, directory, files) => {
|
|
15859
|
+
groups.push({
|
|
15860
|
+
directory,
|
|
15861
|
+
files,
|
|
15862
|
+
dir: directory
|
|
15863
|
+
});
|
|
15864
|
+
};
|
|
15865
|
+
const empty = () => {};
|
|
15866
|
+
function build$3(options) {
|
|
15867
|
+
return options.group ? groupFiles : empty;
|
|
15868
|
+
}
|
|
15869
|
+
|
|
15870
|
+
//#endregion
|
|
15871
|
+
//#region src/api/functions/resolve-symlink.ts
|
|
15872
|
+
const resolveSymlinksAsync = function(path, state, callback$1) {
|
|
15873
|
+
const { queue, fs, options: { suppressErrors } } = state;
|
|
15874
|
+
queue.enqueue();
|
|
15875
|
+
fs.realpath(path, (error, resolvedPath) => {
|
|
15876
|
+
if (error) return queue.dequeue(suppressErrors ? null : error, state);
|
|
15877
|
+
fs.stat(resolvedPath, (error$1, stat) => {
|
|
15878
|
+
if (error$1) return queue.dequeue(suppressErrors ? null : error$1, state);
|
|
15879
|
+
if (stat.isDirectory() && isRecursive(path, resolvedPath, state)) return queue.dequeue(null, state);
|
|
15880
|
+
callback$1(stat, resolvedPath);
|
|
15881
|
+
queue.dequeue(null, state);
|
|
15882
|
+
});
|
|
15883
|
+
});
|
|
15884
|
+
};
|
|
15885
|
+
const resolveSymlinks = function(path, state, callback$1) {
|
|
15886
|
+
const { queue, fs, options: { suppressErrors } } = state;
|
|
15887
|
+
queue.enqueue();
|
|
15888
|
+
try {
|
|
15889
|
+
const resolvedPath = fs.realpathSync(path);
|
|
15890
|
+
const stat = fs.statSync(resolvedPath);
|
|
15891
|
+
if (stat.isDirectory() && isRecursive(path, resolvedPath, state)) return;
|
|
15892
|
+
callback$1(stat, resolvedPath);
|
|
15893
|
+
} catch (e) {
|
|
15894
|
+
if (!suppressErrors) throw e;
|
|
15895
|
+
}
|
|
15896
|
+
};
|
|
15897
|
+
function build$2(options, isSynchronous) {
|
|
15898
|
+
if (!options.resolveSymlinks || options.excludeSymlinks) return null;
|
|
15899
|
+
return isSynchronous ? resolveSymlinks : resolveSymlinksAsync;
|
|
15900
|
+
}
|
|
15901
|
+
function isRecursive(path, resolved, state) {
|
|
15902
|
+
if (state.options.useRealPaths) return isRecursiveUsingRealPaths(resolved, state);
|
|
15903
|
+
let parent = (0,external_path_.dirname)(path);
|
|
15904
|
+
let depth = 1;
|
|
15905
|
+
while (parent !== state.root && depth < 2) {
|
|
15906
|
+
const resolvedPath = state.symlinks.get(parent);
|
|
15907
|
+
const isSameRoot = !!resolvedPath && (resolvedPath === resolved || resolvedPath.startsWith(resolved) || resolved.startsWith(resolvedPath));
|
|
15908
|
+
if (isSameRoot) depth++;
|
|
15909
|
+
else parent = (0,external_path_.dirname)(parent);
|
|
15910
|
+
}
|
|
15911
|
+
state.symlinks.set(path, resolved);
|
|
15912
|
+
return depth > 1;
|
|
15913
|
+
}
|
|
15914
|
+
function isRecursiveUsingRealPaths(resolved, state) {
|
|
15915
|
+
return state.visited.includes(resolved + state.options.pathSeparator);
|
|
15916
|
+
}
|
|
15917
|
+
|
|
15918
|
+
//#endregion
|
|
15919
|
+
//#region src/api/functions/invoke-callback.ts
|
|
15920
|
+
const onlyCountsSync = (state) => {
|
|
15921
|
+
return state.counts;
|
|
15922
|
+
};
|
|
15923
|
+
const groupsSync = (state) => {
|
|
15924
|
+
return state.groups;
|
|
15925
|
+
};
|
|
15926
|
+
const defaultSync = (state) => {
|
|
15927
|
+
return state.paths;
|
|
15928
|
+
};
|
|
15929
|
+
const limitFilesSync = (state) => {
|
|
15930
|
+
return state.paths.slice(0, state.options.maxFiles);
|
|
15931
|
+
};
|
|
15932
|
+
const onlyCountsAsync = (state, error, callback$1) => {
|
|
15933
|
+
report(error, callback$1, state.counts, state.options.suppressErrors);
|
|
15934
|
+
return null;
|
|
15935
|
+
};
|
|
15936
|
+
const defaultAsync = (state, error, callback$1) => {
|
|
15937
|
+
report(error, callback$1, state.paths, state.options.suppressErrors);
|
|
15938
|
+
return null;
|
|
15939
|
+
};
|
|
15940
|
+
const limitFilesAsync = (state, error, callback$1) => {
|
|
15941
|
+
report(error, callback$1, state.paths.slice(0, state.options.maxFiles), state.options.suppressErrors);
|
|
15942
|
+
return null;
|
|
15943
|
+
};
|
|
15944
|
+
const groupsAsync = (state, error, callback$1) => {
|
|
15945
|
+
report(error, callback$1, state.groups, state.options.suppressErrors);
|
|
15946
|
+
return null;
|
|
15947
|
+
};
|
|
15948
|
+
function report(error, callback$1, output, suppressErrors) {
|
|
15949
|
+
if (error && !suppressErrors) callback$1(error, output);
|
|
15950
|
+
else callback$1(null, output);
|
|
15951
|
+
}
|
|
15952
|
+
function build$1(options, isSynchronous) {
|
|
15953
|
+
const { onlyCounts, group, maxFiles } = options;
|
|
15954
|
+
if (onlyCounts) return isSynchronous ? onlyCountsSync : onlyCountsAsync;
|
|
15955
|
+
else if (group) return isSynchronous ? groupsSync : groupsAsync;
|
|
15956
|
+
else if (maxFiles) return isSynchronous ? limitFilesSync : limitFilesAsync;
|
|
15957
|
+
else return isSynchronous ? defaultSync : defaultAsync;
|
|
15958
|
+
}
|
|
15959
|
+
|
|
15960
|
+
//#endregion
|
|
15961
|
+
//#region src/api/functions/walk-directory.ts
|
|
15962
|
+
const readdirOpts = { withFileTypes: true };
|
|
15963
|
+
const walkAsync = (state, crawlPath, directoryPath, currentDepth, callback$1) => {
|
|
15964
|
+
state.queue.enqueue();
|
|
15965
|
+
if (currentDepth < 0) return state.queue.dequeue(null, state);
|
|
15966
|
+
const { fs } = state;
|
|
15967
|
+
state.visited.push(crawlPath);
|
|
15968
|
+
state.counts.directories++;
|
|
15969
|
+
fs.readdir(crawlPath || ".", readdirOpts, (error, entries = []) => {
|
|
15970
|
+
callback$1(entries, directoryPath, currentDepth);
|
|
15971
|
+
state.queue.dequeue(state.options.suppressErrors ? null : error, state);
|
|
15972
|
+
});
|
|
15973
|
+
};
|
|
15974
|
+
const walkSync = (state, crawlPath, directoryPath, currentDepth, callback$1) => {
|
|
15975
|
+
const { fs } = state;
|
|
15976
|
+
if (currentDepth < 0) return;
|
|
15977
|
+
state.visited.push(crawlPath);
|
|
15978
|
+
state.counts.directories++;
|
|
15979
|
+
let entries = [];
|
|
15980
|
+
try {
|
|
15981
|
+
entries = fs.readdirSync(crawlPath || ".", readdirOpts);
|
|
15982
|
+
} catch (e) {
|
|
15983
|
+
if (!state.options.suppressErrors) throw e;
|
|
15984
|
+
}
|
|
15985
|
+
callback$1(entries, directoryPath, currentDepth);
|
|
15986
|
+
};
|
|
15987
|
+
function build(isSynchronous) {
|
|
15988
|
+
return isSynchronous ? walkSync : walkAsync;
|
|
15989
|
+
}
|
|
15990
|
+
|
|
15991
|
+
//#endregion
|
|
15992
|
+
//#region src/api/queue.ts
|
|
15993
|
+
/**
|
|
15994
|
+
* This is a custom stateless queue to track concurrent async fs calls.
|
|
15995
|
+
* It increments a counter whenever a call is queued and decrements it
|
|
15996
|
+
* as soon as it completes. When the counter hits 0, it calls onQueueEmpty.
|
|
15997
|
+
*/
|
|
15998
|
+
var Queue = class {
|
|
15999
|
+
count = 0;
|
|
16000
|
+
constructor(onQueueEmpty) {
|
|
16001
|
+
this.onQueueEmpty = onQueueEmpty;
|
|
16002
|
+
}
|
|
16003
|
+
enqueue() {
|
|
16004
|
+
this.count++;
|
|
16005
|
+
return this.count;
|
|
16006
|
+
}
|
|
16007
|
+
dequeue(error, output) {
|
|
16008
|
+
if (this.onQueueEmpty && (--this.count <= 0 || error)) {
|
|
16009
|
+
this.onQueueEmpty(error, output);
|
|
16010
|
+
if (error) {
|
|
16011
|
+
output.controller.abort();
|
|
16012
|
+
this.onQueueEmpty = void 0;
|
|
16013
|
+
}
|
|
16014
|
+
}
|
|
16015
|
+
}
|
|
16016
|
+
};
|
|
16017
|
+
|
|
16018
|
+
//#endregion
|
|
16019
|
+
//#region src/api/counter.ts
|
|
16020
|
+
var Counter = class {
|
|
16021
|
+
_files = 0;
|
|
16022
|
+
_directories = 0;
|
|
16023
|
+
set files(num) {
|
|
16024
|
+
this._files = num;
|
|
16025
|
+
}
|
|
16026
|
+
get files() {
|
|
16027
|
+
return this._files;
|
|
16028
|
+
}
|
|
16029
|
+
set directories(num) {
|
|
16030
|
+
this._directories = num;
|
|
16031
|
+
}
|
|
16032
|
+
get directories() {
|
|
16033
|
+
return this._directories;
|
|
16034
|
+
}
|
|
16035
|
+
/**
|
|
16036
|
+
* @deprecated use `directories` instead
|
|
16037
|
+
*/
|
|
16038
|
+
/* c8 ignore next 3 */
|
|
16039
|
+
get dirs() {
|
|
16040
|
+
return this._directories;
|
|
16041
|
+
}
|
|
16042
|
+
};
|
|
16043
|
+
|
|
16044
|
+
//#endregion
|
|
16045
|
+
//#region src/api/aborter.ts
|
|
16046
|
+
/**
|
|
16047
|
+
* AbortController is not supported on Node 14 so we use this until we can drop
|
|
16048
|
+
* support for Node 14.
|
|
16049
|
+
*/
|
|
16050
|
+
var Aborter = class {
|
|
16051
|
+
aborted = false;
|
|
16052
|
+
abort() {
|
|
16053
|
+
this.aborted = true;
|
|
16054
|
+
}
|
|
16055
|
+
};
|
|
16056
|
+
|
|
16057
|
+
//#endregion
|
|
16058
|
+
//#region src/api/walker.ts
|
|
16059
|
+
var Walker = class {
|
|
16060
|
+
root;
|
|
16061
|
+
isSynchronous;
|
|
16062
|
+
state;
|
|
16063
|
+
joinPath;
|
|
16064
|
+
pushDirectory;
|
|
16065
|
+
pushFile;
|
|
16066
|
+
getArray;
|
|
16067
|
+
groupFiles;
|
|
16068
|
+
resolveSymlink;
|
|
16069
|
+
walkDirectory;
|
|
16070
|
+
callbackInvoker;
|
|
16071
|
+
constructor(root, options, callback$1) {
|
|
16072
|
+
this.isSynchronous = !callback$1;
|
|
16073
|
+
this.callbackInvoker = build$1(options, this.isSynchronous);
|
|
16074
|
+
this.root = normalizePath(root, options);
|
|
16075
|
+
this.state = {
|
|
16076
|
+
root: isRootDirectory(this.root) ? this.root : this.root.slice(0, -1),
|
|
16077
|
+
paths: [""].slice(0, 0),
|
|
16078
|
+
groups: [],
|
|
16079
|
+
counts: new Counter(),
|
|
16080
|
+
options,
|
|
16081
|
+
queue: new Queue((error, state) => this.callbackInvoker(state, error, callback$1)),
|
|
16082
|
+
symlinks: /* @__PURE__ */ new Map(),
|
|
16083
|
+
visited: [""].slice(0, 0),
|
|
16084
|
+
controller: new Aborter(),
|
|
16085
|
+
fs: options.fs || external_fs_namespaceObject
|
|
16086
|
+
};
|
|
16087
|
+
this.joinPath = build$7(this.root, options);
|
|
16088
|
+
this.pushDirectory = build$6(this.root, options);
|
|
16089
|
+
this.pushFile = build$5(options);
|
|
16090
|
+
this.getArray = build$4(options);
|
|
16091
|
+
this.groupFiles = build$3(options);
|
|
16092
|
+
this.resolveSymlink = build$2(options, this.isSynchronous);
|
|
16093
|
+
this.walkDirectory = build(this.isSynchronous);
|
|
16094
|
+
}
|
|
16095
|
+
start() {
|
|
16096
|
+
this.pushDirectory(this.root, this.state.paths, this.state.options.filters);
|
|
16097
|
+
this.walkDirectory(this.state, this.root, this.root, this.state.options.maxDepth, this.walk);
|
|
16098
|
+
return this.isSynchronous ? this.callbackInvoker(this.state, null) : null;
|
|
16099
|
+
}
|
|
16100
|
+
walk = (entries, directoryPath, depth) => {
|
|
16101
|
+
const { paths, options: { filters, resolveSymlinks: resolveSymlinks$1, excludeSymlinks, exclude, maxFiles, signal, useRealPaths, pathSeparator }, controller } = this.state;
|
|
16102
|
+
if (controller.aborted || signal && signal.aborted || maxFiles && paths.length > maxFiles) return;
|
|
16103
|
+
const files = this.getArray(this.state.paths);
|
|
16104
|
+
for (let i = 0; i < entries.length; ++i) {
|
|
16105
|
+
const entry = entries[i];
|
|
16106
|
+
if (entry.isFile() || entry.isSymbolicLink() && !resolveSymlinks$1 && !excludeSymlinks) {
|
|
16107
|
+
const filename = this.joinPath(entry.name, directoryPath);
|
|
16108
|
+
this.pushFile(filename, files, this.state.counts, filters);
|
|
16109
|
+
} else if (entry.isDirectory()) {
|
|
16110
|
+
let path = joinDirectoryPath(entry.name, directoryPath, this.state.options.pathSeparator);
|
|
16111
|
+
if (exclude && exclude(entry.name, path)) continue;
|
|
16112
|
+
this.pushDirectory(path, paths, filters);
|
|
16113
|
+
this.walkDirectory(this.state, path, path, depth - 1, this.walk);
|
|
16114
|
+
} else if (this.resolveSymlink && entry.isSymbolicLink()) {
|
|
16115
|
+
let path = joinPathWithBasePath(entry.name, directoryPath);
|
|
16116
|
+
this.resolveSymlink(path, this.state, (stat, resolvedPath) => {
|
|
16117
|
+
if (stat.isDirectory()) {
|
|
16118
|
+
resolvedPath = normalizePath(resolvedPath, this.state.options);
|
|
16119
|
+
if (exclude && exclude(entry.name, useRealPaths ? resolvedPath : path + pathSeparator)) return;
|
|
16120
|
+
this.walkDirectory(this.state, resolvedPath, useRealPaths ? resolvedPath : path + pathSeparator, depth - 1, this.walk);
|
|
16121
|
+
} else {
|
|
16122
|
+
resolvedPath = useRealPaths ? resolvedPath : path;
|
|
16123
|
+
const filename = (0,external_path_.basename)(resolvedPath);
|
|
16124
|
+
const directoryPath$1 = normalizePath((0,external_path_.dirname)(resolvedPath), this.state.options);
|
|
16125
|
+
resolvedPath = this.joinPath(filename, directoryPath$1);
|
|
16126
|
+
this.pushFile(resolvedPath, files, this.state.counts, filters);
|
|
16127
|
+
}
|
|
16128
|
+
});
|
|
16129
|
+
}
|
|
16130
|
+
}
|
|
16131
|
+
this.groupFiles(this.state.groups, directoryPath, files);
|
|
16132
|
+
};
|
|
16133
|
+
};
|
|
16134
|
+
|
|
16135
|
+
//#endregion
|
|
16136
|
+
//#region src/api/async.ts
|
|
16137
|
+
function promise(root, options) {
|
|
16138
|
+
return new Promise((resolve$1, reject) => {
|
|
16139
|
+
callback(root, options, (err, output) => {
|
|
16140
|
+
if (err) return reject(err);
|
|
16141
|
+
resolve$1(output);
|
|
16142
|
+
});
|
|
16143
|
+
});
|
|
16144
|
+
}
|
|
16145
|
+
function callback(root, options, callback$1) {
|
|
16146
|
+
let walker = new Walker(root, options, callback$1);
|
|
16147
|
+
walker.start();
|
|
16148
|
+
}
|
|
16149
|
+
|
|
16150
|
+
//#endregion
|
|
16151
|
+
//#region src/api/sync.ts
|
|
16152
|
+
function sync(root, options) {
|
|
16153
|
+
const walker = new Walker(root, options);
|
|
16154
|
+
return walker.start();
|
|
16155
|
+
}
|
|
16156
|
+
|
|
16157
|
+
//#endregion
|
|
16158
|
+
//#region src/builder/api-builder.ts
|
|
16159
|
+
var APIBuilder = class {
|
|
16160
|
+
constructor(root, options) {
|
|
16161
|
+
this.root = root;
|
|
16162
|
+
this.options = options;
|
|
16163
|
+
}
|
|
16164
|
+
withPromise() {
|
|
16165
|
+
return promise(this.root, this.options);
|
|
16166
|
+
}
|
|
16167
|
+
withCallback(cb) {
|
|
16168
|
+
callback(this.root, this.options, cb);
|
|
16169
|
+
}
|
|
16170
|
+
sync() {
|
|
16171
|
+
return sync(this.root, this.options);
|
|
16172
|
+
}
|
|
16173
|
+
};
|
|
16174
|
+
|
|
16175
|
+
//#endregion
|
|
16176
|
+
//#region src/builder/index.ts
|
|
16177
|
+
let pm = null;
|
|
16178
|
+
/* c8 ignore next 6 */
|
|
16179
|
+
try {
|
|
16180
|
+
__require.resolve("picomatch");
|
|
16181
|
+
pm = __require("picomatch");
|
|
16182
|
+
} catch {}
|
|
16183
|
+
var Builder = class {
|
|
16184
|
+
globCache = {};
|
|
16185
|
+
options = {
|
|
16186
|
+
maxDepth: Infinity,
|
|
16187
|
+
suppressErrors: true,
|
|
16188
|
+
pathSeparator: external_path_.sep,
|
|
16189
|
+
filters: []
|
|
16190
|
+
};
|
|
16191
|
+
globFunction;
|
|
16192
|
+
constructor(options) {
|
|
16193
|
+
this.options = {
|
|
16194
|
+
...this.options,
|
|
16195
|
+
...options
|
|
16196
|
+
};
|
|
16197
|
+
this.globFunction = this.options.globFunction;
|
|
16198
|
+
}
|
|
16199
|
+
group() {
|
|
16200
|
+
this.options.group = true;
|
|
16201
|
+
return this;
|
|
16202
|
+
}
|
|
16203
|
+
withPathSeparator(separator) {
|
|
16204
|
+
this.options.pathSeparator = separator;
|
|
16205
|
+
return this;
|
|
16206
|
+
}
|
|
16207
|
+
withBasePath() {
|
|
16208
|
+
this.options.includeBasePath = true;
|
|
16209
|
+
return this;
|
|
16210
|
+
}
|
|
16211
|
+
withRelativePaths() {
|
|
16212
|
+
this.options.relativePaths = true;
|
|
16213
|
+
return this;
|
|
16214
|
+
}
|
|
16215
|
+
withDirs() {
|
|
16216
|
+
this.options.includeDirs = true;
|
|
16217
|
+
return this;
|
|
16218
|
+
}
|
|
16219
|
+
withMaxDepth(depth) {
|
|
16220
|
+
this.options.maxDepth = depth;
|
|
16221
|
+
return this;
|
|
16222
|
+
}
|
|
16223
|
+
withMaxFiles(limit) {
|
|
16224
|
+
this.options.maxFiles = limit;
|
|
16225
|
+
return this;
|
|
16226
|
+
}
|
|
16227
|
+
withFullPaths() {
|
|
16228
|
+
this.options.resolvePaths = true;
|
|
16229
|
+
this.options.includeBasePath = true;
|
|
16230
|
+
return this;
|
|
16231
|
+
}
|
|
16232
|
+
withErrors() {
|
|
16233
|
+
this.options.suppressErrors = false;
|
|
16234
|
+
return this;
|
|
16235
|
+
}
|
|
16236
|
+
withSymlinks({ resolvePaths = true } = {}) {
|
|
16237
|
+
this.options.resolveSymlinks = true;
|
|
16238
|
+
this.options.useRealPaths = resolvePaths;
|
|
16239
|
+
return this.withFullPaths();
|
|
16240
|
+
}
|
|
16241
|
+
withAbortSignal(signal) {
|
|
16242
|
+
this.options.signal = signal;
|
|
16243
|
+
return this;
|
|
16244
|
+
}
|
|
16245
|
+
normalize() {
|
|
16246
|
+
this.options.normalizePath = true;
|
|
16247
|
+
return this;
|
|
16248
|
+
}
|
|
16249
|
+
filter(predicate) {
|
|
16250
|
+
this.options.filters.push(predicate);
|
|
16251
|
+
return this;
|
|
16252
|
+
}
|
|
16253
|
+
onlyDirs() {
|
|
16254
|
+
this.options.excludeFiles = true;
|
|
16255
|
+
this.options.includeDirs = true;
|
|
16256
|
+
return this;
|
|
16257
|
+
}
|
|
16258
|
+
exclude(predicate) {
|
|
16259
|
+
this.options.exclude = predicate;
|
|
16260
|
+
return this;
|
|
16261
|
+
}
|
|
16262
|
+
onlyCounts() {
|
|
16263
|
+
this.options.onlyCounts = true;
|
|
16264
|
+
return this;
|
|
16265
|
+
}
|
|
16266
|
+
crawl(root) {
|
|
16267
|
+
return new APIBuilder(root || ".", this.options);
|
|
16268
|
+
}
|
|
16269
|
+
withGlobFunction(fn) {
|
|
16270
|
+
this.globFunction = fn;
|
|
16271
|
+
return this;
|
|
16272
|
+
}
|
|
16273
|
+
/**
|
|
16274
|
+
* @deprecated Pass options using the constructor instead:
|
|
16275
|
+
* ```ts
|
|
16276
|
+
* new fdir(options).crawl("/path/to/root");
|
|
16277
|
+
* ```
|
|
16278
|
+
* This method will be removed in v7.0
|
|
16279
|
+
*/
|
|
16280
|
+
/* c8 ignore next 4 */
|
|
16281
|
+
crawlWithOptions(root, options) {
|
|
16282
|
+
this.options = {
|
|
16283
|
+
...this.options,
|
|
16284
|
+
...options
|
|
16285
|
+
};
|
|
16286
|
+
return new APIBuilder(root || ".", this.options);
|
|
16287
|
+
}
|
|
16288
|
+
glob(...patterns) {
|
|
16289
|
+
if (this.globFunction) return this.globWithOptions(patterns);
|
|
16290
|
+
return this.globWithOptions(patterns, ...[{ dot: true }]);
|
|
16291
|
+
}
|
|
16292
|
+
globWithOptions(patterns, ...options) {
|
|
16293
|
+
const globFn = this.globFunction || pm;
|
|
16294
|
+
/* c8 ignore next 5 */
|
|
16295
|
+
if (!globFn) throw new Error("Please specify a glob function to use glob matching.");
|
|
16296
|
+
var isMatch = this.globCache[patterns.join("\0")];
|
|
16297
|
+
if (!isMatch) {
|
|
16298
|
+
isMatch = globFn(patterns, ...options);
|
|
16299
|
+
this.globCache[patterns.join("\0")] = isMatch;
|
|
16300
|
+
}
|
|
16301
|
+
this.options.filters.push((path) => isMatch(path));
|
|
16302
|
+
return this;
|
|
16303
|
+
}
|
|
16304
|
+
};
|
|
16305
|
+
|
|
16306
|
+
//#endregion
|
|
16307
|
+
|
|
16308
|
+
// EXTERNAL MODULE: ../../node_modules/.pnpm/picomatch@4.0.7/node_modules/picomatch/index.js
|
|
16309
|
+
var picomatch = __webpack_require__(9528);
|
|
16310
|
+
;// CONCATENATED MODULE: ../../node_modules/.pnpm/tinyglobby@0.2.15/node_modules/tinyglobby/dist/index.mjs
|
|
16311
|
+
|
|
16312
|
+
|
|
16313
|
+
|
|
16314
|
+
|
|
16315
|
+
|
|
16316
|
+
|
|
16317
|
+
//#region src/utils.ts
|
|
16318
|
+
const isReadonlyArray = Array.isArray;
|
|
16319
|
+
const isWin = process.platform === "win32";
|
|
16320
|
+
const ONLY_PARENT_DIRECTORIES = /^(\/?\.\.)+$/;
|
|
16321
|
+
function getPartialMatcher(patterns, options = {}) {
|
|
16322
|
+
const patternsCount = patterns.length;
|
|
16323
|
+
const patternsParts = Array(patternsCount);
|
|
16324
|
+
const matchers = Array(patternsCount);
|
|
16325
|
+
const globstarEnabled = !options.noglobstar;
|
|
16326
|
+
for (let i = 0; i < patternsCount; i++) {
|
|
16327
|
+
const parts = splitPattern(patterns[i]);
|
|
16328
|
+
patternsParts[i] = parts;
|
|
16329
|
+
const partsCount = parts.length;
|
|
16330
|
+
const partMatchers = Array(partsCount);
|
|
16331
|
+
for (let j = 0; j < partsCount; j++) partMatchers[j] = picomatch(parts[j], options);
|
|
16332
|
+
matchers[i] = partMatchers;
|
|
16333
|
+
}
|
|
16334
|
+
return (input) => {
|
|
16335
|
+
const inputParts = input.split("/");
|
|
16336
|
+
if (inputParts[0] === ".." && ONLY_PARENT_DIRECTORIES.test(input)) return true;
|
|
16337
|
+
for (let i = 0; i < patterns.length; i++) {
|
|
16338
|
+
const patternParts = patternsParts[i];
|
|
16339
|
+
const matcher = matchers[i];
|
|
16340
|
+
const inputPatternCount = inputParts.length;
|
|
16341
|
+
const minParts = Math.min(inputPatternCount, patternParts.length);
|
|
16342
|
+
let j = 0;
|
|
16343
|
+
while (j < minParts) {
|
|
16344
|
+
const part = patternParts[j];
|
|
16345
|
+
if (part.includes("/")) return true;
|
|
16346
|
+
const match = matcher[j](inputParts[j]);
|
|
16347
|
+
if (!match) break;
|
|
16348
|
+
if (globstarEnabled && part === "**") return true;
|
|
16349
|
+
j++;
|
|
16350
|
+
}
|
|
16351
|
+
if (j === inputPatternCount) return true;
|
|
16352
|
+
}
|
|
16353
|
+
return false;
|
|
16354
|
+
};
|
|
16355
|
+
}
|
|
16356
|
+
/* node:coverage ignore next 2 */
|
|
16357
|
+
const WIN32_ROOT_DIR = /^[A-Z]:\/$/i;
|
|
16358
|
+
const isRoot = isWin ? (p) => WIN32_ROOT_DIR.test(p) : (p) => p === "/";
|
|
16359
|
+
function buildFormat(cwd, root, absolute) {
|
|
16360
|
+
if (cwd === root || root.startsWith(`${cwd}/`)) {
|
|
16361
|
+
if (absolute) {
|
|
16362
|
+
const start = isRoot(cwd) ? cwd.length : cwd.length + 1;
|
|
16363
|
+
return (p, isDir) => p.slice(start, isDir ? -1 : void 0) || ".";
|
|
16364
|
+
}
|
|
16365
|
+
const prefix = root.slice(cwd.length + 1);
|
|
16366
|
+
if (prefix) return (p, isDir) => {
|
|
16367
|
+
if (p === ".") return prefix;
|
|
16368
|
+
const result = `${prefix}/${p}`;
|
|
16369
|
+
return isDir ? result.slice(0, -1) : result;
|
|
16370
|
+
};
|
|
16371
|
+
return (p, isDir) => isDir && p !== "." ? p.slice(0, -1) : p;
|
|
16372
|
+
}
|
|
16373
|
+
if (absolute) return (p) => external_path_.posix.relative(cwd, p) || ".";
|
|
16374
|
+
return (p) => external_path_.posix.relative(cwd, `${root}/${p}`) || ".";
|
|
16375
|
+
}
|
|
16376
|
+
function buildRelative(cwd, root) {
|
|
16377
|
+
if (root.startsWith(`${cwd}/`)) {
|
|
16378
|
+
const prefix = root.slice(cwd.length + 1);
|
|
16379
|
+
return (p) => `${prefix}/${p}`;
|
|
16380
|
+
}
|
|
16381
|
+
return (p) => {
|
|
16382
|
+
const result = external_path_.posix.relative(cwd, `${root}/${p}`);
|
|
16383
|
+
if (p.endsWith("/") && result !== "") return `${result}/`;
|
|
16384
|
+
return result || ".";
|
|
16385
|
+
};
|
|
16386
|
+
}
|
|
16387
|
+
const splitPatternOptions = { parts: true };
|
|
16388
|
+
function splitPattern(path$1) {
|
|
16389
|
+
var _result$parts;
|
|
16390
|
+
const result = picomatch.scan(path$1, splitPatternOptions);
|
|
16391
|
+
return ((_result$parts = result.parts) === null || _result$parts === void 0 ? void 0 : _result$parts.length) ? result.parts : [path$1];
|
|
16392
|
+
}
|
|
16393
|
+
const ESCAPED_WIN32_BACKSLASHES = /\\(?![()[\]{}!+@])/g;
|
|
16394
|
+
function convertPosixPathToPattern(path$1) {
|
|
16395
|
+
return escapePosixPath(path$1);
|
|
16396
|
+
}
|
|
16397
|
+
function convertWin32PathToPattern(path$1) {
|
|
16398
|
+
return escapeWin32Path(path$1).replace(ESCAPED_WIN32_BACKSLASHES, "/");
|
|
16399
|
+
}
|
|
16400
|
+
/**
|
|
16401
|
+
* Converts a path to a pattern depending on the platform.
|
|
16402
|
+
* Identical to {@link escapePath} on POSIX systems.
|
|
16403
|
+
* @see {@link https://superchupu.dev/tinyglobby/documentation#convertPathToPattern}
|
|
16404
|
+
*/
|
|
16405
|
+
/* node:coverage ignore next 3 */
|
|
16406
|
+
const convertPathToPattern = (/* unused pure expression or super */ null && (isWin ? convertWin32PathToPattern : convertPosixPathToPattern));
|
|
16407
|
+
const POSIX_UNESCAPED_GLOB_SYMBOLS = /(?<!\\)([()[\]{}*?|]|^!|[!+@](?=\()|\\(?![()[\]{}!*+?@|]))/g;
|
|
16408
|
+
const WIN32_UNESCAPED_GLOB_SYMBOLS = /(?<!\\)([()[\]{}]|^!|[!+@](?=\())/g;
|
|
16409
|
+
const escapePosixPath = (path$1) => path$1.replace(POSIX_UNESCAPED_GLOB_SYMBOLS, "\\$&");
|
|
16410
|
+
const escapeWin32Path = (path$1) => path$1.replace(WIN32_UNESCAPED_GLOB_SYMBOLS, "\\$&");
|
|
16411
|
+
/**
|
|
16412
|
+
* Escapes a path's special characters depending on the platform.
|
|
16413
|
+
* @see {@link https://superchupu.dev/tinyglobby/documentation#escapePath}
|
|
16414
|
+
*/
|
|
16415
|
+
/* node:coverage ignore next */
|
|
16416
|
+
const escapePath = isWin ? escapeWin32Path : escapePosixPath;
|
|
16417
|
+
/**
|
|
16418
|
+
* Checks if a pattern has dynamic parts.
|
|
16419
|
+
*
|
|
16420
|
+
* Has a few minor differences with [`fast-glob`](https://github.com/mrmlnc/fast-glob) for better accuracy:
|
|
16421
|
+
*
|
|
16422
|
+
* - Doesn't necessarily return `false` on patterns that include `\`.
|
|
16423
|
+
* - Returns `true` if the pattern includes parentheses, regardless of them representing one single pattern or not.
|
|
16424
|
+
* - Returns `true` for unfinished glob extensions i.e. `(h`, `+(h`.
|
|
16425
|
+
* - Returns `true` for unfinished brace expansions as long as they include `,` or `..`.
|
|
16426
|
+
*
|
|
16427
|
+
* @see {@link https://superchupu.dev/tinyglobby/documentation#isDynamicPattern}
|
|
16428
|
+
*/
|
|
16429
|
+
function isDynamicPattern(pattern, options) {
|
|
16430
|
+
if ((options === null || options === void 0 ? void 0 : options.caseSensitiveMatch) === false) return true;
|
|
16431
|
+
const scan = picomatch.scan(pattern);
|
|
16432
|
+
return scan.isGlob || scan.negated;
|
|
16433
|
+
}
|
|
16434
|
+
function log(...tasks) {
|
|
16435
|
+
console.log(`[tinyglobby ${(/* @__PURE__ */ new Date()).toLocaleTimeString("es")}]`, ...tasks);
|
|
16436
|
+
}
|
|
16437
|
+
|
|
16438
|
+
//#endregion
|
|
16439
|
+
//#region src/index.ts
|
|
16440
|
+
const PARENT_DIRECTORY = /^(\/?\.\.)+/;
|
|
16441
|
+
const ESCAPING_BACKSLASHES = /\\(?=[()[\]{}!*+?@|])/g;
|
|
16442
|
+
const BACKSLASHES = /\\/g;
|
|
16443
|
+
function normalizePattern(pattern, expandDirectories, cwd, props, isIgnore) {
|
|
16444
|
+
let result = pattern;
|
|
16445
|
+
if (pattern.endsWith("/")) result = pattern.slice(0, -1);
|
|
16446
|
+
if (!result.endsWith("*") && expandDirectories) result += "/**";
|
|
16447
|
+
const escapedCwd = escapePath(cwd);
|
|
16448
|
+
if (external_path_.isAbsolute(result.replace(ESCAPING_BACKSLASHES, ""))) result = external_path_.posix.relative(escapedCwd, result);
|
|
16449
|
+
else result = external_path_.posix.normalize(result);
|
|
16450
|
+
const parentDirectoryMatch = PARENT_DIRECTORY.exec(result);
|
|
16451
|
+
const parts = splitPattern(result);
|
|
16452
|
+
if (parentDirectoryMatch === null || parentDirectoryMatch === void 0 ? void 0 : parentDirectoryMatch[0]) {
|
|
16453
|
+
const n = (parentDirectoryMatch[0].length + 1) / 3;
|
|
16454
|
+
let i = 0;
|
|
16455
|
+
const cwdParts = escapedCwd.split("/");
|
|
16456
|
+
while (i < n && parts[i + n] === cwdParts[cwdParts.length + i - n]) {
|
|
16457
|
+
result = result.slice(0, (n - i - 1) * 3) + result.slice((n - i) * 3 + parts[i + n].length + 1) || ".";
|
|
16458
|
+
i++;
|
|
16459
|
+
}
|
|
16460
|
+
const potentialRoot = external_path_.posix.join(cwd, parentDirectoryMatch[0].slice(i * 3));
|
|
16461
|
+
if (!potentialRoot.startsWith(".") && props.root.length > potentialRoot.length) {
|
|
16462
|
+
props.root = potentialRoot;
|
|
16463
|
+
props.depthOffset = -n + i;
|
|
16464
|
+
}
|
|
16465
|
+
}
|
|
16466
|
+
if (!isIgnore && props.depthOffset >= 0) {
|
|
16467
|
+
var _props$commonPath;
|
|
16468
|
+
(_props$commonPath = props.commonPath) !== null && _props$commonPath !== void 0 || (props.commonPath = parts);
|
|
16469
|
+
const newCommonPath = [];
|
|
16470
|
+
const length = Math.min(props.commonPath.length, parts.length);
|
|
16471
|
+
for (let i = 0; i < length; i++) {
|
|
16472
|
+
const part = parts[i];
|
|
16473
|
+
if (part === "**" && !parts[i + 1]) {
|
|
16474
|
+
newCommonPath.pop();
|
|
16475
|
+
break;
|
|
16476
|
+
}
|
|
16477
|
+
if (part !== props.commonPath[i] || isDynamicPattern(part) || i === parts.length - 1) break;
|
|
16478
|
+
newCommonPath.push(part);
|
|
16479
|
+
}
|
|
16480
|
+
props.depthOffset = newCommonPath.length;
|
|
16481
|
+
props.commonPath = newCommonPath;
|
|
16482
|
+
props.root = newCommonPath.length > 0 ? external_path_.posix.join(cwd, ...newCommonPath) : cwd;
|
|
16483
|
+
}
|
|
16484
|
+
return result;
|
|
16485
|
+
}
|
|
16486
|
+
function processPatterns({ patterns = ["**/*"], ignore = [], expandDirectories = true }, cwd, props) {
|
|
16487
|
+
if (typeof patterns === "string") patterns = [patterns];
|
|
16488
|
+
if (typeof ignore === "string") ignore = [ignore];
|
|
16489
|
+
const matchPatterns = [];
|
|
16490
|
+
const ignorePatterns = [];
|
|
16491
|
+
for (const pattern of ignore) {
|
|
16492
|
+
if (!pattern) continue;
|
|
16493
|
+
if (pattern[0] !== "!" || pattern[1] === "(") ignorePatterns.push(normalizePattern(pattern, expandDirectories, cwd, props, true));
|
|
16494
|
+
}
|
|
16495
|
+
for (const pattern of patterns) {
|
|
16496
|
+
if (!pattern) continue;
|
|
16497
|
+
if (pattern[0] !== "!" || pattern[1] === "(") matchPatterns.push(normalizePattern(pattern, expandDirectories, cwd, props, false));
|
|
16498
|
+
else if (pattern[1] !== "!" || pattern[2] === "(") ignorePatterns.push(normalizePattern(pattern.slice(1), expandDirectories, cwd, props, true));
|
|
16499
|
+
}
|
|
16500
|
+
return {
|
|
16501
|
+
match: matchPatterns,
|
|
16502
|
+
ignore: ignorePatterns
|
|
16503
|
+
};
|
|
16504
|
+
}
|
|
16505
|
+
function formatPaths(paths, relative) {
|
|
16506
|
+
for (let i = paths.length - 1; i >= 0; i--) {
|
|
16507
|
+
const path$1 = paths[i];
|
|
16508
|
+
paths[i] = relative(path$1);
|
|
16509
|
+
}
|
|
16510
|
+
return paths;
|
|
16511
|
+
}
|
|
16512
|
+
function normalizeCwd(cwd) {
|
|
16513
|
+
if (!cwd) return process.cwd().replace(BACKSLASHES, "/");
|
|
16514
|
+
if (cwd instanceof URL) return (0,external_url_.fileURLToPath)(cwd).replace(BACKSLASHES, "/");
|
|
16515
|
+
return external_path_.resolve(cwd).replace(BACKSLASHES, "/");
|
|
16516
|
+
}
|
|
16517
|
+
function getCrawler(patterns, inputOptions = {}) {
|
|
16518
|
+
const options = process.env.TINYGLOBBY_DEBUG ? {
|
|
16519
|
+
...inputOptions,
|
|
16520
|
+
debug: true
|
|
16521
|
+
} : inputOptions;
|
|
16522
|
+
const cwd = normalizeCwd(options.cwd);
|
|
16523
|
+
if (options.debug) log("globbing with:", {
|
|
16524
|
+
patterns,
|
|
16525
|
+
options,
|
|
16526
|
+
cwd
|
|
16527
|
+
});
|
|
16528
|
+
if (Array.isArray(patterns) && patterns.length === 0) return [{
|
|
16529
|
+
sync: () => [],
|
|
16530
|
+
withPromise: async () => []
|
|
16531
|
+
}, false];
|
|
16532
|
+
const props = {
|
|
16533
|
+
root: cwd,
|
|
16534
|
+
commonPath: null,
|
|
16535
|
+
depthOffset: 0
|
|
16536
|
+
};
|
|
16537
|
+
const processed = processPatterns({
|
|
16538
|
+
...options,
|
|
16539
|
+
patterns
|
|
16540
|
+
}, cwd, props);
|
|
16541
|
+
if (options.debug) log("internal processing patterns:", processed);
|
|
16542
|
+
const matchOptions = {
|
|
16543
|
+
dot: options.dot,
|
|
16544
|
+
nobrace: options.braceExpansion === false,
|
|
16545
|
+
nocase: options.caseSensitiveMatch === false,
|
|
16546
|
+
noextglob: options.extglob === false,
|
|
16547
|
+
noglobstar: options.globstar === false,
|
|
16548
|
+
posix: true
|
|
16549
|
+
};
|
|
16550
|
+
const matcher = picomatch(processed.match, {
|
|
16551
|
+
...matchOptions,
|
|
16552
|
+
ignore: processed.ignore
|
|
16553
|
+
});
|
|
16554
|
+
const ignore = picomatch(processed.ignore, matchOptions);
|
|
16555
|
+
const partialMatcher = getPartialMatcher(processed.match, matchOptions);
|
|
16556
|
+
const format = buildFormat(cwd, props.root, options.absolute);
|
|
16557
|
+
const formatExclude = options.absolute ? format : buildFormat(cwd, props.root, true);
|
|
16558
|
+
const fdirOptions = {
|
|
16559
|
+
filters: [options.debug ? (p, isDirectory) => {
|
|
16560
|
+
const path$1 = format(p, isDirectory);
|
|
16561
|
+
const matches = matcher(path$1);
|
|
16562
|
+
if (matches) log(`matched ${path$1}`);
|
|
16563
|
+
return matches;
|
|
16564
|
+
} : (p, isDirectory) => matcher(format(p, isDirectory))],
|
|
16565
|
+
exclude: options.debug ? (_, p) => {
|
|
16566
|
+
const relativePath = formatExclude(p, true);
|
|
16567
|
+
const skipped = relativePath !== "." && !partialMatcher(relativePath) || ignore(relativePath);
|
|
16568
|
+
if (skipped) log(`skipped ${p}`);
|
|
16569
|
+
else log(`crawling ${p}`);
|
|
16570
|
+
return skipped;
|
|
16571
|
+
} : (_, p) => {
|
|
16572
|
+
const relativePath = formatExclude(p, true);
|
|
16573
|
+
return relativePath !== "." && !partialMatcher(relativePath) || ignore(relativePath);
|
|
16574
|
+
},
|
|
16575
|
+
fs: options.fs ? {
|
|
16576
|
+
readdir: options.fs.readdir || external_fs_.readdir,
|
|
16577
|
+
readdirSync: options.fs.readdirSync || external_fs_.readdirSync,
|
|
16578
|
+
realpath: options.fs.realpath || external_fs_.realpath,
|
|
16579
|
+
realpathSync: options.fs.realpathSync || external_fs_.realpathSync,
|
|
16580
|
+
stat: options.fs.stat || external_fs_.stat,
|
|
16581
|
+
statSync: options.fs.statSync || external_fs_.statSync
|
|
16582
|
+
} : void 0,
|
|
16583
|
+
pathSeparator: "/",
|
|
16584
|
+
relativePaths: true,
|
|
16585
|
+
resolveSymlinks: true,
|
|
16586
|
+
signal: options.signal
|
|
16587
|
+
};
|
|
16588
|
+
if (options.deep !== void 0) fdirOptions.maxDepth = Math.round(options.deep - props.depthOffset);
|
|
16589
|
+
if (options.absolute) {
|
|
16590
|
+
fdirOptions.relativePaths = false;
|
|
16591
|
+
fdirOptions.resolvePaths = true;
|
|
16592
|
+
fdirOptions.includeBasePath = true;
|
|
16593
|
+
}
|
|
16594
|
+
if (options.followSymbolicLinks === false) {
|
|
16595
|
+
fdirOptions.resolveSymlinks = false;
|
|
16596
|
+
fdirOptions.excludeSymlinks = true;
|
|
16597
|
+
}
|
|
16598
|
+
if (options.onlyDirectories) {
|
|
16599
|
+
fdirOptions.excludeFiles = true;
|
|
16600
|
+
fdirOptions.includeDirs = true;
|
|
16601
|
+
} else if (options.onlyFiles === false) fdirOptions.includeDirs = true;
|
|
16602
|
+
props.root = props.root.replace(BACKSLASHES, "");
|
|
16603
|
+
const root = props.root;
|
|
16604
|
+
if (options.debug) log("internal properties:", props);
|
|
16605
|
+
const relative = cwd !== root && !options.absolute && buildRelative(cwd, props.root);
|
|
16606
|
+
return [new Builder(fdirOptions).crawl(root), relative];
|
|
16607
|
+
}
|
|
16608
|
+
async function glob(patternsOrOptions, options) {
|
|
16609
|
+
if (patternsOrOptions && (options === null || options === void 0 ? void 0 : options.patterns)) throw new Error("Cannot pass patterns as both an argument and an option");
|
|
16610
|
+
const isModern = isReadonlyArray(patternsOrOptions) || typeof patternsOrOptions === "string";
|
|
16611
|
+
const opts = isModern ? options : patternsOrOptions;
|
|
16612
|
+
const patterns = isModern ? patternsOrOptions : patternsOrOptions.patterns;
|
|
16613
|
+
const [crawler, relative] = getCrawler(patterns, opts);
|
|
16614
|
+
if (!relative) return crawler.withPromise();
|
|
16615
|
+
return formatPaths(await crawler.withPromise(), relative);
|
|
16616
|
+
}
|
|
16617
|
+
function globSync(patternsOrOptions, options) {
|
|
16618
|
+
if (patternsOrOptions && (options === null || options === void 0 ? void 0 : options.patterns)) throw new Error("Cannot pass patterns as both an argument and an option");
|
|
16619
|
+
const isModern = isReadonlyArray(patternsOrOptions) || typeof patternsOrOptions === "string";
|
|
16620
|
+
const opts = isModern ? options : patternsOrOptions;
|
|
16621
|
+
const patterns = isModern ? patternsOrOptions : patternsOrOptions.patterns;
|
|
16622
|
+
const [crawler, relative] = getCrawler(patterns, opts);
|
|
16623
|
+
if (!relative) return crawler.sync();
|
|
16624
|
+
return formatPaths(crawler.sync(), relative);
|
|
16625
|
+
}
|
|
16626
|
+
|
|
16627
|
+
//#endregion
|
|
16628
|
+
|
|
16629
|
+
|
|
13229
16630
|
/***/ }),
|
|
13230
16631
|
|
|
13231
16632
|
/***/ 7256:
|