heading-case 0.0.0 → 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/bin.js +4 -0
- package/dist/dict.d.ts +1 -0
- package/dist/index.d.ts +4 -1
- package/dist/index.js +2995 -1
- package/package.json +9 -4
- package/dist/index.cjs +0 -7
package/dist/index.js
CHANGED
|
@@ -1 +1,2995 @@
|
|
|
1
|
-
|
|
1
|
+
import * as __WEBPACK_EXTERNAL_MODULE_fs__ from "fs";
|
|
2
|
+
import * as __WEBPACK_EXTERNAL_MODULE_path__ from "path";
|
|
3
|
+
import * as __WEBPACK_EXTERNAL_MODULE_node_fs__ from "node:fs";
|
|
4
|
+
import * as __WEBPACK_EXTERNAL_MODULE_process__ from "process";
|
|
5
|
+
import * as __WEBPACK_EXTERNAL_MODULE_os__ from "os";
|
|
6
|
+
import * as __WEBPACK_EXTERNAL_MODULE_tty__ from "tty";
|
|
7
|
+
var __webpack_modules__ = {
|
|
8
|
+
"./node_modules/.pnpm/fdir@6.4.2_picomatch@4.0.2/node_modules/fdir/dist/api/async.js": function(__unused_webpack_module, exports, __webpack_require__) {
|
|
9
|
+
Object.defineProperty(exports, "__esModule", {
|
|
10
|
+
value: true
|
|
11
|
+
});
|
|
12
|
+
exports.callback = exports.promise = void 0;
|
|
13
|
+
const walker_1 = __webpack_require__("./node_modules/.pnpm/fdir@6.4.2_picomatch@4.0.2/node_modules/fdir/dist/api/walker.js");
|
|
14
|
+
function promise(root, options) {
|
|
15
|
+
return new Promise((resolve, reject)=>{
|
|
16
|
+
callback(root, options, (err, output)=>{
|
|
17
|
+
if (err) return reject(err);
|
|
18
|
+
resolve(output);
|
|
19
|
+
});
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
exports.promise = promise;
|
|
23
|
+
function callback(root, options, callback) {
|
|
24
|
+
let walker = new walker_1.Walker(root, options, callback);
|
|
25
|
+
walker.start();
|
|
26
|
+
}
|
|
27
|
+
exports.callback = callback;
|
|
28
|
+
},
|
|
29
|
+
"./node_modules/.pnpm/fdir@6.4.2_picomatch@4.0.2/node_modules/fdir/dist/api/counter.js": function(__unused_webpack_module, exports) {
|
|
30
|
+
Object.defineProperty(exports, "__esModule", {
|
|
31
|
+
value: true
|
|
32
|
+
});
|
|
33
|
+
exports.Counter = void 0;
|
|
34
|
+
class Counter {
|
|
35
|
+
_files = 0;
|
|
36
|
+
_directories = 0;
|
|
37
|
+
set files(num) {
|
|
38
|
+
this._files = num;
|
|
39
|
+
}
|
|
40
|
+
get files() {
|
|
41
|
+
return this._files;
|
|
42
|
+
}
|
|
43
|
+
set directories(num) {
|
|
44
|
+
this._directories = num;
|
|
45
|
+
}
|
|
46
|
+
get directories() {
|
|
47
|
+
return this._directories;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* @deprecated use `directories` instead
|
|
51
|
+
*/ /* c8 ignore next 3 */ get dirs() {
|
|
52
|
+
return this._directories;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
exports.Counter = Counter;
|
|
56
|
+
},
|
|
57
|
+
"./node_modules/.pnpm/fdir@6.4.2_picomatch@4.0.2/node_modules/fdir/dist/api/functions/get-array.js": function(__unused_webpack_module, exports) {
|
|
58
|
+
Object.defineProperty(exports, "__esModule", {
|
|
59
|
+
value: true
|
|
60
|
+
});
|
|
61
|
+
exports.build = void 0;
|
|
62
|
+
const getArray = (paths)=>paths;
|
|
63
|
+
const getArrayGroup = ()=>[
|
|
64
|
+
""
|
|
65
|
+
].slice(0, 0);
|
|
66
|
+
function build(options) {
|
|
67
|
+
return options.group ? getArrayGroup : getArray;
|
|
68
|
+
}
|
|
69
|
+
exports.build = build;
|
|
70
|
+
},
|
|
71
|
+
"./node_modules/.pnpm/fdir@6.4.2_picomatch@4.0.2/node_modules/fdir/dist/api/functions/group-files.js": function(__unused_webpack_module, exports) {
|
|
72
|
+
Object.defineProperty(exports, "__esModule", {
|
|
73
|
+
value: true
|
|
74
|
+
});
|
|
75
|
+
exports.build = void 0;
|
|
76
|
+
const groupFiles = (groups, directory, files)=>{
|
|
77
|
+
groups.push({
|
|
78
|
+
directory,
|
|
79
|
+
files,
|
|
80
|
+
dir: directory
|
|
81
|
+
});
|
|
82
|
+
};
|
|
83
|
+
const empty = ()=>{};
|
|
84
|
+
function build(options) {
|
|
85
|
+
return options.group ? groupFiles : empty;
|
|
86
|
+
}
|
|
87
|
+
exports.build = build;
|
|
88
|
+
},
|
|
89
|
+
"./node_modules/.pnpm/fdir@6.4.2_picomatch@4.0.2/node_modules/fdir/dist/api/functions/invoke-callback.js": function(__unused_webpack_module, exports) {
|
|
90
|
+
Object.defineProperty(exports, "__esModule", {
|
|
91
|
+
value: true
|
|
92
|
+
});
|
|
93
|
+
exports.build = void 0;
|
|
94
|
+
const onlyCountsSync = (state)=>state.counts;
|
|
95
|
+
const groupsSync = (state)=>state.groups;
|
|
96
|
+
const defaultSync = (state)=>state.paths;
|
|
97
|
+
const limitFilesSync = (state)=>state.paths.slice(0, state.options.maxFiles);
|
|
98
|
+
const onlyCountsAsync = (state, error, callback)=>{
|
|
99
|
+
report(error, callback, state.counts, state.options.suppressErrors);
|
|
100
|
+
return null;
|
|
101
|
+
};
|
|
102
|
+
const defaultAsync = (state, error, callback)=>{
|
|
103
|
+
report(error, callback, state.paths, state.options.suppressErrors);
|
|
104
|
+
return null;
|
|
105
|
+
};
|
|
106
|
+
const limitFilesAsync = (state, error, callback)=>{
|
|
107
|
+
report(error, callback, state.paths.slice(0, state.options.maxFiles), state.options.suppressErrors);
|
|
108
|
+
return null;
|
|
109
|
+
};
|
|
110
|
+
const groupsAsync = (state, error, callback)=>{
|
|
111
|
+
report(error, callback, state.groups, state.options.suppressErrors);
|
|
112
|
+
return null;
|
|
113
|
+
};
|
|
114
|
+
function report(error, callback, output, suppressErrors) {
|
|
115
|
+
callback(error && !suppressErrors ? error : null, output);
|
|
116
|
+
}
|
|
117
|
+
function build(options, isSynchronous) {
|
|
118
|
+
const { onlyCounts, group, maxFiles } = options;
|
|
119
|
+
if (onlyCounts) return isSynchronous ? onlyCountsSync : onlyCountsAsync;
|
|
120
|
+
if (group) return isSynchronous ? groupsSync : groupsAsync;
|
|
121
|
+
if (maxFiles) return isSynchronous ? limitFilesSync : limitFilesAsync;
|
|
122
|
+
else return isSynchronous ? defaultSync : defaultAsync;
|
|
123
|
+
}
|
|
124
|
+
exports.build = build;
|
|
125
|
+
},
|
|
126
|
+
"./node_modules/.pnpm/fdir@6.4.2_picomatch@4.0.2/node_modules/fdir/dist/api/functions/join-path.js": function(__unused_webpack_module, exports, __webpack_require__) {
|
|
127
|
+
Object.defineProperty(exports, "__esModule", {
|
|
128
|
+
value: true
|
|
129
|
+
});
|
|
130
|
+
exports.build = exports.joinDirectoryPath = exports.joinPathWithBasePath = void 0;
|
|
131
|
+
const path_1 = __webpack_require__("path");
|
|
132
|
+
const utils_1 = __webpack_require__("./node_modules/.pnpm/fdir@6.4.2_picomatch@4.0.2/node_modules/fdir/dist/utils.js");
|
|
133
|
+
function joinPathWithBasePath(filename, directoryPath) {
|
|
134
|
+
return directoryPath + filename;
|
|
135
|
+
}
|
|
136
|
+
exports.joinPathWithBasePath = joinPathWithBasePath;
|
|
137
|
+
function joinPathWithRelativePath(root, options) {
|
|
138
|
+
return function(filename, directoryPath) {
|
|
139
|
+
const sameRoot = directoryPath.startsWith(root);
|
|
140
|
+
if (sameRoot) return directoryPath.replace(root, "") + filename;
|
|
141
|
+
return (0, utils_1.convertSlashes)((0, path_1.relative)(root, directoryPath), options.pathSeparator) + options.pathSeparator + filename;
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
function joinPath(filename) {
|
|
145
|
+
return filename;
|
|
146
|
+
}
|
|
147
|
+
function joinDirectoryPath(filename, directoryPath, separator) {
|
|
148
|
+
return directoryPath + filename + separator;
|
|
149
|
+
}
|
|
150
|
+
exports.joinDirectoryPath = joinDirectoryPath;
|
|
151
|
+
function build(root, options) {
|
|
152
|
+
const { relativePaths, includeBasePath } = options;
|
|
153
|
+
return relativePaths && root ? joinPathWithRelativePath(root, options) : includeBasePath ? joinPathWithBasePath : joinPath;
|
|
154
|
+
}
|
|
155
|
+
exports.build = build;
|
|
156
|
+
},
|
|
157
|
+
"./node_modules/.pnpm/fdir@6.4.2_picomatch@4.0.2/node_modules/fdir/dist/api/functions/push-directory.js": function(__unused_webpack_module, exports) {
|
|
158
|
+
Object.defineProperty(exports, "__esModule", {
|
|
159
|
+
value: true
|
|
160
|
+
});
|
|
161
|
+
exports.build = void 0;
|
|
162
|
+
function pushDirectoryWithRelativePath(root) {
|
|
163
|
+
return function(directoryPath, paths) {
|
|
164
|
+
paths.push(directoryPath.substring(root.length) || ".");
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
function pushDirectoryFilterWithRelativePath(root) {
|
|
168
|
+
return function(directoryPath, paths, filters) {
|
|
169
|
+
const relativePath = directoryPath.substring(root.length) || ".";
|
|
170
|
+
if (filters.every((filter)=>filter(relativePath, true))) paths.push(relativePath);
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
const pushDirectory = (directoryPath, paths)=>{
|
|
174
|
+
paths.push(directoryPath || ".");
|
|
175
|
+
};
|
|
176
|
+
const pushDirectoryFilter = (directoryPath, paths, filters)=>{
|
|
177
|
+
const path = directoryPath || ".";
|
|
178
|
+
if (filters.every((filter)=>filter(path, true))) paths.push(path);
|
|
179
|
+
};
|
|
180
|
+
const empty = ()=>{};
|
|
181
|
+
function build(root, options) {
|
|
182
|
+
const { includeDirs, filters, relativePaths } = options;
|
|
183
|
+
if (!includeDirs) return empty;
|
|
184
|
+
if (relativePaths) return filters && filters.length ? pushDirectoryFilterWithRelativePath(root) : pushDirectoryWithRelativePath(root);
|
|
185
|
+
return filters && filters.length ? pushDirectoryFilter : pushDirectory;
|
|
186
|
+
}
|
|
187
|
+
exports.build = build;
|
|
188
|
+
},
|
|
189
|
+
"./node_modules/.pnpm/fdir@6.4.2_picomatch@4.0.2/node_modules/fdir/dist/api/functions/push-file.js": function(__unused_webpack_module, exports) {
|
|
190
|
+
Object.defineProperty(exports, "__esModule", {
|
|
191
|
+
value: true
|
|
192
|
+
});
|
|
193
|
+
exports.build = void 0;
|
|
194
|
+
const pushFileFilterAndCount = (filename, _paths, counts, filters)=>{
|
|
195
|
+
if (filters.every((filter)=>filter(filename, false))) counts.files++;
|
|
196
|
+
};
|
|
197
|
+
const pushFileFilter = (filename, paths, _counts, filters)=>{
|
|
198
|
+
if (filters.every((filter)=>filter(filename, false))) paths.push(filename);
|
|
199
|
+
};
|
|
200
|
+
const pushFileCount = (_filename, _paths, counts, _filters)=>{
|
|
201
|
+
counts.files++;
|
|
202
|
+
};
|
|
203
|
+
const pushFile = (filename, paths)=>{
|
|
204
|
+
paths.push(filename);
|
|
205
|
+
};
|
|
206
|
+
const empty = ()=>{};
|
|
207
|
+
function build(options) {
|
|
208
|
+
const { excludeFiles, filters, onlyCounts } = options;
|
|
209
|
+
if (excludeFiles) return empty;
|
|
210
|
+
if (filters && filters.length) return onlyCounts ? pushFileFilterAndCount : pushFileFilter;
|
|
211
|
+
if (onlyCounts) return pushFileCount;
|
|
212
|
+
return pushFile;
|
|
213
|
+
}
|
|
214
|
+
exports.build = build;
|
|
215
|
+
},
|
|
216
|
+
"./node_modules/.pnpm/fdir@6.4.2_picomatch@4.0.2/node_modules/fdir/dist/api/functions/resolve-symlink.js": function(__unused_webpack_module, exports, __webpack_require__) {
|
|
217
|
+
var __importDefault = this && this.__importDefault || function(mod) {
|
|
218
|
+
return mod && mod.__esModule ? mod : {
|
|
219
|
+
default: mod
|
|
220
|
+
};
|
|
221
|
+
};
|
|
222
|
+
Object.defineProperty(exports, "__esModule", {
|
|
223
|
+
value: true
|
|
224
|
+
});
|
|
225
|
+
exports.build = void 0;
|
|
226
|
+
const fs_1 = __importDefault(__webpack_require__("fs"));
|
|
227
|
+
const path_1 = __webpack_require__("path");
|
|
228
|
+
const resolveSymlinksAsync = function(path, state, callback) {
|
|
229
|
+
const { queue, options: { suppressErrors } } = state;
|
|
230
|
+
queue.enqueue();
|
|
231
|
+
fs_1.default.realpath(path, (error, resolvedPath)=>{
|
|
232
|
+
if (error) return queue.dequeue(suppressErrors ? null : error, state);
|
|
233
|
+
fs_1.default.stat(resolvedPath, (error, stat)=>{
|
|
234
|
+
if (error) return queue.dequeue(suppressErrors ? null : error, state);
|
|
235
|
+
if (stat.isDirectory() && isRecursive(path, resolvedPath, state)) return queue.dequeue(null, state);
|
|
236
|
+
callback(stat, resolvedPath);
|
|
237
|
+
queue.dequeue(null, state);
|
|
238
|
+
});
|
|
239
|
+
});
|
|
240
|
+
};
|
|
241
|
+
const resolveSymlinks = function(path, state, callback) {
|
|
242
|
+
const { queue, options: { suppressErrors } } = state;
|
|
243
|
+
queue.enqueue();
|
|
244
|
+
try {
|
|
245
|
+
const resolvedPath = fs_1.default.realpathSync(path);
|
|
246
|
+
const stat = fs_1.default.statSync(resolvedPath);
|
|
247
|
+
if (stat.isDirectory() && isRecursive(path, resolvedPath, state)) return;
|
|
248
|
+
callback(stat, resolvedPath);
|
|
249
|
+
} catch (e) {
|
|
250
|
+
if (!suppressErrors) throw e;
|
|
251
|
+
}
|
|
252
|
+
};
|
|
253
|
+
function build(options, isSynchronous) {
|
|
254
|
+
if (!options.resolveSymlinks || options.excludeSymlinks) return null;
|
|
255
|
+
return isSynchronous ? resolveSymlinks : resolveSymlinksAsync;
|
|
256
|
+
}
|
|
257
|
+
exports.build = build;
|
|
258
|
+
function isRecursive(path, resolved, state) {
|
|
259
|
+
if (state.options.useRealPaths) return isRecursiveUsingRealPaths(resolved, state);
|
|
260
|
+
let parent = (0, path_1.dirname)(path);
|
|
261
|
+
let depth = 1;
|
|
262
|
+
while(parent !== state.root && depth < 2){
|
|
263
|
+
const resolvedPath = state.symlinks.get(parent);
|
|
264
|
+
const isSameRoot = !!resolvedPath && (resolvedPath === resolved || resolvedPath.startsWith(resolved) || resolved.startsWith(resolvedPath));
|
|
265
|
+
if (isSameRoot) depth++;
|
|
266
|
+
else parent = (0, path_1.dirname)(parent);
|
|
267
|
+
}
|
|
268
|
+
state.symlinks.set(path, resolved);
|
|
269
|
+
return depth > 1;
|
|
270
|
+
}
|
|
271
|
+
function isRecursiveUsingRealPaths(resolved, state) {
|
|
272
|
+
return state.visited.includes(resolved + state.options.pathSeparator);
|
|
273
|
+
}
|
|
274
|
+
},
|
|
275
|
+
"./node_modules/.pnpm/fdir@6.4.2_picomatch@4.0.2/node_modules/fdir/dist/api/functions/walk-directory.js": function(__unused_webpack_module, exports, __webpack_require__) {
|
|
276
|
+
var __importDefault = this && this.__importDefault || function(mod) {
|
|
277
|
+
return mod && mod.__esModule ? mod : {
|
|
278
|
+
default: mod
|
|
279
|
+
};
|
|
280
|
+
};
|
|
281
|
+
Object.defineProperty(exports, "__esModule", {
|
|
282
|
+
value: true
|
|
283
|
+
});
|
|
284
|
+
exports.build = void 0;
|
|
285
|
+
const fs_1 = __importDefault(__webpack_require__("fs"));
|
|
286
|
+
const readdirOpts = {
|
|
287
|
+
withFileTypes: true
|
|
288
|
+
};
|
|
289
|
+
const walkAsync = (state, crawlPath, directoryPath, currentDepth, callback)=>{
|
|
290
|
+
if (currentDepth < 0) return state.queue.dequeue(null, state);
|
|
291
|
+
state.visited.push(crawlPath);
|
|
292
|
+
state.counts.directories++;
|
|
293
|
+
state.queue.enqueue();
|
|
294
|
+
// Perf: Node >= 10 introduced withFileTypes that helps us
|
|
295
|
+
// skip an extra fs.stat call.
|
|
296
|
+
fs_1.default.readdir(crawlPath || ".", readdirOpts, (error, entries = [])=>{
|
|
297
|
+
callback(entries, directoryPath, currentDepth);
|
|
298
|
+
state.queue.dequeue(state.options.suppressErrors ? null : error, state);
|
|
299
|
+
});
|
|
300
|
+
};
|
|
301
|
+
const walkSync = (state, crawlPath, directoryPath, currentDepth, callback)=>{
|
|
302
|
+
if (currentDepth < 0) return;
|
|
303
|
+
state.visited.push(crawlPath);
|
|
304
|
+
state.counts.directories++;
|
|
305
|
+
let entries = [];
|
|
306
|
+
try {
|
|
307
|
+
entries = fs_1.default.readdirSync(crawlPath || ".", readdirOpts);
|
|
308
|
+
} catch (e) {
|
|
309
|
+
if (!state.options.suppressErrors) throw e;
|
|
310
|
+
}
|
|
311
|
+
callback(entries, directoryPath, currentDepth);
|
|
312
|
+
};
|
|
313
|
+
function build(isSynchronous) {
|
|
314
|
+
return isSynchronous ? walkSync : walkAsync;
|
|
315
|
+
}
|
|
316
|
+
exports.build = build;
|
|
317
|
+
},
|
|
318
|
+
"./node_modules/.pnpm/fdir@6.4.2_picomatch@4.0.2/node_modules/fdir/dist/api/queue.js": function(__unused_webpack_module, exports) {
|
|
319
|
+
Object.defineProperty(exports, "__esModule", {
|
|
320
|
+
value: true
|
|
321
|
+
});
|
|
322
|
+
exports.Queue = void 0;
|
|
323
|
+
/**
|
|
324
|
+
* This is a custom stateless queue to track concurrent async fs calls.
|
|
325
|
+
* It increments a counter whenever a call is queued and decrements it
|
|
326
|
+
* as soon as it completes. When the counter hits 0, it calls onQueueEmpty.
|
|
327
|
+
*/ class Queue {
|
|
328
|
+
onQueueEmpty;
|
|
329
|
+
count = 0;
|
|
330
|
+
constructor(onQueueEmpty){
|
|
331
|
+
this.onQueueEmpty = onQueueEmpty;
|
|
332
|
+
}
|
|
333
|
+
enqueue() {
|
|
334
|
+
this.count++;
|
|
335
|
+
}
|
|
336
|
+
dequeue(error, output) {
|
|
337
|
+
if (--this.count <= 0 || error) this.onQueueEmpty(error, output);
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
exports.Queue = Queue;
|
|
341
|
+
},
|
|
342
|
+
"./node_modules/.pnpm/fdir@6.4.2_picomatch@4.0.2/node_modules/fdir/dist/api/sync.js": function(__unused_webpack_module, exports, __webpack_require__) {
|
|
343
|
+
Object.defineProperty(exports, "__esModule", {
|
|
344
|
+
value: true
|
|
345
|
+
});
|
|
346
|
+
exports.sync = void 0;
|
|
347
|
+
const walker_1 = __webpack_require__("./node_modules/.pnpm/fdir@6.4.2_picomatch@4.0.2/node_modules/fdir/dist/api/walker.js");
|
|
348
|
+
function sync(root, options) {
|
|
349
|
+
const walker = new walker_1.Walker(root, options);
|
|
350
|
+
return walker.start();
|
|
351
|
+
}
|
|
352
|
+
exports.sync = sync;
|
|
353
|
+
},
|
|
354
|
+
"./node_modules/.pnpm/fdir@6.4.2_picomatch@4.0.2/node_modules/fdir/dist/api/walker.js": function(__unused_webpack_module, exports, __webpack_require__) {
|
|
355
|
+
var __createBinding = this && this.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
356
|
+
if (void 0 === k2) k2 = k;
|
|
357
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
358
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) desc = {
|
|
359
|
+
enumerable: true,
|
|
360
|
+
get: function() {
|
|
361
|
+
return m[k];
|
|
362
|
+
}
|
|
363
|
+
};
|
|
364
|
+
Object.defineProperty(o, k2, desc);
|
|
365
|
+
} : function(o, m, k, k2) {
|
|
366
|
+
if (void 0 === k2) k2 = k;
|
|
367
|
+
o[k2] = m[k];
|
|
368
|
+
});
|
|
369
|
+
var __setModuleDefault = this && this.__setModuleDefault || (Object.create ? function(o, v) {
|
|
370
|
+
Object.defineProperty(o, "default", {
|
|
371
|
+
enumerable: true,
|
|
372
|
+
value: v
|
|
373
|
+
});
|
|
374
|
+
} : function(o, v) {
|
|
375
|
+
o["default"] = v;
|
|
376
|
+
});
|
|
377
|
+
var __importStar = this && this.__importStar || function(mod) {
|
|
378
|
+
if (mod && mod.__esModule) return mod;
|
|
379
|
+
var result = {};
|
|
380
|
+
if (null != mod) {
|
|
381
|
+
for(var k in mod)if ("default" !== k && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
382
|
+
}
|
|
383
|
+
__setModuleDefault(result, mod);
|
|
384
|
+
return result;
|
|
385
|
+
};
|
|
386
|
+
Object.defineProperty(exports, "__esModule", {
|
|
387
|
+
value: true
|
|
388
|
+
});
|
|
389
|
+
exports.Walker = void 0;
|
|
390
|
+
const path_1 = __webpack_require__("path");
|
|
391
|
+
const utils_1 = __webpack_require__("./node_modules/.pnpm/fdir@6.4.2_picomatch@4.0.2/node_modules/fdir/dist/utils.js");
|
|
392
|
+
const joinPath = __importStar(__webpack_require__("./node_modules/.pnpm/fdir@6.4.2_picomatch@4.0.2/node_modules/fdir/dist/api/functions/join-path.js"));
|
|
393
|
+
const pushDirectory = __importStar(__webpack_require__("./node_modules/.pnpm/fdir@6.4.2_picomatch@4.0.2/node_modules/fdir/dist/api/functions/push-directory.js"));
|
|
394
|
+
const pushFile = __importStar(__webpack_require__("./node_modules/.pnpm/fdir@6.4.2_picomatch@4.0.2/node_modules/fdir/dist/api/functions/push-file.js"));
|
|
395
|
+
const getArray = __importStar(__webpack_require__("./node_modules/.pnpm/fdir@6.4.2_picomatch@4.0.2/node_modules/fdir/dist/api/functions/get-array.js"));
|
|
396
|
+
const groupFiles = __importStar(__webpack_require__("./node_modules/.pnpm/fdir@6.4.2_picomatch@4.0.2/node_modules/fdir/dist/api/functions/group-files.js"));
|
|
397
|
+
const resolveSymlink = __importStar(__webpack_require__("./node_modules/.pnpm/fdir@6.4.2_picomatch@4.0.2/node_modules/fdir/dist/api/functions/resolve-symlink.js"));
|
|
398
|
+
const invokeCallback = __importStar(__webpack_require__("./node_modules/.pnpm/fdir@6.4.2_picomatch@4.0.2/node_modules/fdir/dist/api/functions/invoke-callback.js"));
|
|
399
|
+
const walkDirectory = __importStar(__webpack_require__("./node_modules/.pnpm/fdir@6.4.2_picomatch@4.0.2/node_modules/fdir/dist/api/functions/walk-directory.js"));
|
|
400
|
+
const queue_1 = __webpack_require__("./node_modules/.pnpm/fdir@6.4.2_picomatch@4.0.2/node_modules/fdir/dist/api/queue.js");
|
|
401
|
+
const counter_1 = __webpack_require__("./node_modules/.pnpm/fdir@6.4.2_picomatch@4.0.2/node_modules/fdir/dist/api/counter.js");
|
|
402
|
+
class Walker {
|
|
403
|
+
root;
|
|
404
|
+
isSynchronous;
|
|
405
|
+
state;
|
|
406
|
+
joinPath;
|
|
407
|
+
pushDirectory;
|
|
408
|
+
pushFile;
|
|
409
|
+
getArray;
|
|
410
|
+
groupFiles;
|
|
411
|
+
resolveSymlink;
|
|
412
|
+
walkDirectory;
|
|
413
|
+
callbackInvoker;
|
|
414
|
+
constructor(root, options, callback){
|
|
415
|
+
this.isSynchronous = !callback;
|
|
416
|
+
this.callbackInvoker = invokeCallback.build(options, this.isSynchronous);
|
|
417
|
+
this.root = (0, utils_1.normalizePath)(root, options);
|
|
418
|
+
this.state = {
|
|
419
|
+
root: this.root.slice(0, -1),
|
|
420
|
+
// Perf: we explicitly tell the compiler to optimize for String arrays
|
|
421
|
+
paths: [
|
|
422
|
+
""
|
|
423
|
+
].slice(0, 0),
|
|
424
|
+
groups: [],
|
|
425
|
+
counts: new counter_1.Counter(),
|
|
426
|
+
options,
|
|
427
|
+
queue: new queue_1.Queue((error, state)=>this.callbackInvoker(state, error, callback)),
|
|
428
|
+
symlinks: new Map(),
|
|
429
|
+
visited: [
|
|
430
|
+
""
|
|
431
|
+
].slice(0, 0)
|
|
432
|
+
};
|
|
433
|
+
/*
|
|
434
|
+
* Perf: We conditionally change functions according to options. This gives a slight
|
|
435
|
+
* performance boost. Since these functions are so small, they are automatically inlined
|
|
436
|
+
* by the javascript engine so there's no function call overhead (in most cases).
|
|
437
|
+
*/ this.joinPath = joinPath.build(this.root, options);
|
|
438
|
+
this.pushDirectory = pushDirectory.build(this.root, options);
|
|
439
|
+
this.pushFile = pushFile.build(options);
|
|
440
|
+
this.getArray = getArray.build(options);
|
|
441
|
+
this.groupFiles = groupFiles.build(options);
|
|
442
|
+
this.resolveSymlink = resolveSymlink.build(options, this.isSynchronous);
|
|
443
|
+
this.walkDirectory = walkDirectory.build(this.isSynchronous);
|
|
444
|
+
}
|
|
445
|
+
start() {
|
|
446
|
+
this.walkDirectory(this.state, this.root, this.root, this.state.options.maxDepth, this.walk);
|
|
447
|
+
return this.isSynchronous ? this.callbackInvoker(this.state, null) : null;
|
|
448
|
+
}
|
|
449
|
+
walk = (entries, directoryPath, depth)=>{
|
|
450
|
+
const { paths, options: { filters, resolveSymlinks, excludeSymlinks, exclude, maxFiles, signal, useRealPaths, pathSeparator } } = this.state;
|
|
451
|
+
if (signal && signal.aborted || maxFiles && paths.length > maxFiles) return;
|
|
452
|
+
this.pushDirectory(directoryPath, paths, filters);
|
|
453
|
+
const files = this.getArray(this.state.paths);
|
|
454
|
+
for(let i = 0; i < entries.length; ++i){
|
|
455
|
+
const entry = entries[i];
|
|
456
|
+
if (entry.isFile() || entry.isSymbolicLink() && !resolveSymlinks && !excludeSymlinks) {
|
|
457
|
+
const filename = this.joinPath(entry.name, directoryPath);
|
|
458
|
+
this.pushFile(filename, files, this.state.counts, filters);
|
|
459
|
+
} else if (entry.isDirectory()) {
|
|
460
|
+
let path = joinPath.joinDirectoryPath(entry.name, directoryPath, this.state.options.pathSeparator);
|
|
461
|
+
if (exclude && exclude(entry.name, path)) continue;
|
|
462
|
+
this.walkDirectory(this.state, path, path, depth - 1, this.walk);
|
|
463
|
+
} else if (entry.isSymbolicLink() && this.resolveSymlink) {
|
|
464
|
+
let path = joinPath.joinPathWithBasePath(entry.name, directoryPath);
|
|
465
|
+
this.resolveSymlink(path, this.state, (stat, resolvedPath)=>{
|
|
466
|
+
if (stat.isDirectory()) {
|
|
467
|
+
resolvedPath = (0, utils_1.normalizePath)(resolvedPath, this.state.options);
|
|
468
|
+
if (exclude && exclude(entry.name, resolvedPath)) return;
|
|
469
|
+
this.walkDirectory(this.state, resolvedPath, useRealPaths ? resolvedPath : path + pathSeparator, depth - 1, this.walk);
|
|
470
|
+
} else {
|
|
471
|
+
resolvedPath = useRealPaths ? resolvedPath : path;
|
|
472
|
+
const filename = (0, path_1.basename)(resolvedPath);
|
|
473
|
+
const directoryPath = (0, utils_1.normalizePath)((0, path_1.dirname)(resolvedPath), this.state.options);
|
|
474
|
+
resolvedPath = this.joinPath(filename, directoryPath);
|
|
475
|
+
this.pushFile(resolvedPath, files, this.state.counts, filters);
|
|
476
|
+
}
|
|
477
|
+
});
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
this.groupFiles(this.state.groups, directoryPath, files);
|
|
481
|
+
};
|
|
482
|
+
}
|
|
483
|
+
exports.Walker = Walker;
|
|
484
|
+
},
|
|
485
|
+
"./node_modules/.pnpm/fdir@6.4.2_picomatch@4.0.2/node_modules/fdir/dist/builder/api-builder.js": function(__unused_webpack_module, exports, __webpack_require__) {
|
|
486
|
+
Object.defineProperty(exports, "__esModule", {
|
|
487
|
+
value: true
|
|
488
|
+
});
|
|
489
|
+
exports.APIBuilder = void 0;
|
|
490
|
+
const async_1 = __webpack_require__("./node_modules/.pnpm/fdir@6.4.2_picomatch@4.0.2/node_modules/fdir/dist/api/async.js");
|
|
491
|
+
const sync_1 = __webpack_require__("./node_modules/.pnpm/fdir@6.4.2_picomatch@4.0.2/node_modules/fdir/dist/api/sync.js");
|
|
492
|
+
class APIBuilder {
|
|
493
|
+
root;
|
|
494
|
+
options;
|
|
495
|
+
constructor(root, options){
|
|
496
|
+
this.root = root;
|
|
497
|
+
this.options = options;
|
|
498
|
+
}
|
|
499
|
+
withPromise() {
|
|
500
|
+
return (0, async_1.promise)(this.root, this.options);
|
|
501
|
+
}
|
|
502
|
+
withCallback(cb) {
|
|
503
|
+
(0, async_1.callback)(this.root, this.options, cb);
|
|
504
|
+
}
|
|
505
|
+
sync() {
|
|
506
|
+
return (0, sync_1.sync)(this.root, this.options);
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
exports.APIBuilder = APIBuilder;
|
|
510
|
+
},
|
|
511
|
+
"./node_modules/.pnpm/fdir@6.4.2_picomatch@4.0.2/node_modules/fdir/dist/builder/index.js": function(__unused_webpack_module, exports, __webpack_require__) {
|
|
512
|
+
Object.defineProperty(exports, "__esModule", {
|
|
513
|
+
value: true
|
|
514
|
+
});
|
|
515
|
+
exports.Builder = void 0;
|
|
516
|
+
const path_1 = __webpack_require__("path");
|
|
517
|
+
const api_builder_1 = __webpack_require__("./node_modules/.pnpm/fdir@6.4.2_picomatch@4.0.2/node_modules/fdir/dist/builder/api-builder.js");
|
|
518
|
+
var pm = null;
|
|
519
|
+
/* c8 ignore next 6 */ try {
|
|
520
|
+
require.resolve("picomatch");
|
|
521
|
+
pm = __webpack_require__("./node_modules/.pnpm/picomatch@4.0.2/node_modules/picomatch/index.js");
|
|
522
|
+
} catch (_e) {
|
|
523
|
+
// do nothing
|
|
524
|
+
}
|
|
525
|
+
class Builder {
|
|
526
|
+
globCache = {};
|
|
527
|
+
options = {
|
|
528
|
+
maxDepth: 1 / 0,
|
|
529
|
+
suppressErrors: true,
|
|
530
|
+
pathSeparator: path_1.sep,
|
|
531
|
+
filters: []
|
|
532
|
+
};
|
|
533
|
+
globFunction;
|
|
534
|
+
constructor(options){
|
|
535
|
+
this.options = {
|
|
536
|
+
...this.options,
|
|
537
|
+
...options
|
|
538
|
+
};
|
|
539
|
+
this.globFunction = this.options.globFunction;
|
|
540
|
+
}
|
|
541
|
+
group() {
|
|
542
|
+
this.options.group = true;
|
|
543
|
+
return this;
|
|
544
|
+
}
|
|
545
|
+
withPathSeparator(separator) {
|
|
546
|
+
this.options.pathSeparator = separator;
|
|
547
|
+
return this;
|
|
548
|
+
}
|
|
549
|
+
withBasePath() {
|
|
550
|
+
this.options.includeBasePath = true;
|
|
551
|
+
return this;
|
|
552
|
+
}
|
|
553
|
+
withRelativePaths() {
|
|
554
|
+
this.options.relativePaths = true;
|
|
555
|
+
return this;
|
|
556
|
+
}
|
|
557
|
+
withDirs() {
|
|
558
|
+
this.options.includeDirs = true;
|
|
559
|
+
return this;
|
|
560
|
+
}
|
|
561
|
+
withMaxDepth(depth) {
|
|
562
|
+
this.options.maxDepth = depth;
|
|
563
|
+
return this;
|
|
564
|
+
}
|
|
565
|
+
withMaxFiles(limit) {
|
|
566
|
+
this.options.maxFiles = limit;
|
|
567
|
+
return this;
|
|
568
|
+
}
|
|
569
|
+
withFullPaths() {
|
|
570
|
+
this.options.resolvePaths = true;
|
|
571
|
+
this.options.includeBasePath = true;
|
|
572
|
+
return this;
|
|
573
|
+
}
|
|
574
|
+
withErrors() {
|
|
575
|
+
this.options.suppressErrors = false;
|
|
576
|
+
return this;
|
|
577
|
+
}
|
|
578
|
+
withSymlinks({ resolvePaths = true } = {}) {
|
|
579
|
+
this.options.resolveSymlinks = true;
|
|
580
|
+
this.options.useRealPaths = resolvePaths;
|
|
581
|
+
return this.withFullPaths();
|
|
582
|
+
}
|
|
583
|
+
withAbortSignal(signal) {
|
|
584
|
+
this.options.signal = signal;
|
|
585
|
+
return this;
|
|
586
|
+
}
|
|
587
|
+
normalize() {
|
|
588
|
+
this.options.normalizePath = true;
|
|
589
|
+
return this;
|
|
590
|
+
}
|
|
591
|
+
filter(predicate) {
|
|
592
|
+
this.options.filters.push(predicate);
|
|
593
|
+
return this;
|
|
594
|
+
}
|
|
595
|
+
onlyDirs() {
|
|
596
|
+
this.options.excludeFiles = true;
|
|
597
|
+
this.options.includeDirs = true;
|
|
598
|
+
return this;
|
|
599
|
+
}
|
|
600
|
+
exclude(predicate) {
|
|
601
|
+
this.options.exclude = predicate;
|
|
602
|
+
return this;
|
|
603
|
+
}
|
|
604
|
+
onlyCounts() {
|
|
605
|
+
this.options.onlyCounts = true;
|
|
606
|
+
return this;
|
|
607
|
+
}
|
|
608
|
+
crawl(root) {
|
|
609
|
+
return new api_builder_1.APIBuilder(root || ".", this.options);
|
|
610
|
+
}
|
|
611
|
+
withGlobFunction(fn) {
|
|
612
|
+
// cast this since we don't have the new type params yet
|
|
613
|
+
this.globFunction = fn;
|
|
614
|
+
return this;
|
|
615
|
+
}
|
|
616
|
+
/**
|
|
617
|
+
* @deprecated Pass options using the constructor instead:
|
|
618
|
+
* ```ts
|
|
619
|
+
* new fdir(options).crawl("/path/to/root");
|
|
620
|
+
* ```
|
|
621
|
+
* This method will be removed in v7.0
|
|
622
|
+
*/ /* c8 ignore next 4 */ crawlWithOptions(root, options) {
|
|
623
|
+
this.options = {
|
|
624
|
+
...this.options,
|
|
625
|
+
...options
|
|
626
|
+
};
|
|
627
|
+
return new api_builder_1.APIBuilder(root || ".", this.options);
|
|
628
|
+
}
|
|
629
|
+
glob(...patterns) {
|
|
630
|
+
if (this.globFunction) return this.globWithOptions(patterns);
|
|
631
|
+
return this.globWithOptions(patterns, {
|
|
632
|
+
dot: true
|
|
633
|
+
});
|
|
634
|
+
}
|
|
635
|
+
globWithOptions(patterns, ...options) {
|
|
636
|
+
const globFn = this.globFunction || pm;
|
|
637
|
+
/* c8 ignore next 5 */ if (!globFn) throw new Error('Please specify a glob function to use glob matching.');
|
|
638
|
+
var isMatch = this.globCache[patterns.join("\0")];
|
|
639
|
+
if (!isMatch) {
|
|
640
|
+
isMatch = globFn(patterns, ...options);
|
|
641
|
+
this.globCache[patterns.join("\0")] = isMatch;
|
|
642
|
+
}
|
|
643
|
+
this.options.filters.push((path)=>isMatch(path));
|
|
644
|
+
return this;
|
|
645
|
+
}
|
|
646
|
+
}
|
|
647
|
+
exports.Builder = Builder;
|
|
648
|
+
},
|
|
649
|
+
"./node_modules/.pnpm/fdir@6.4.2_picomatch@4.0.2/node_modules/fdir/dist/index.js": function(__unused_webpack_module, exports, __webpack_require__) {
|
|
650
|
+
var __createBinding = this && this.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
651
|
+
if (void 0 === k2) k2 = k;
|
|
652
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
653
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) desc = {
|
|
654
|
+
enumerable: true,
|
|
655
|
+
get: function() {
|
|
656
|
+
return m[k];
|
|
657
|
+
}
|
|
658
|
+
};
|
|
659
|
+
Object.defineProperty(o, k2, desc);
|
|
660
|
+
} : function(o, m, k, k2) {
|
|
661
|
+
if (void 0 === k2) k2 = k;
|
|
662
|
+
o[k2] = m[k];
|
|
663
|
+
});
|
|
664
|
+
var __exportStar = this && this.__exportStar || function(m, exports) {
|
|
665
|
+
for(var p in m)if ("default" !== p && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
666
|
+
};
|
|
667
|
+
Object.defineProperty(exports, "__esModule", {
|
|
668
|
+
value: true
|
|
669
|
+
});
|
|
670
|
+
exports.fdir = void 0;
|
|
671
|
+
const builder_1 = __webpack_require__("./node_modules/.pnpm/fdir@6.4.2_picomatch@4.0.2/node_modules/fdir/dist/builder/index.js");
|
|
672
|
+
Object.defineProperty(exports, "fdir", {
|
|
673
|
+
enumerable: true,
|
|
674
|
+
get: function() {
|
|
675
|
+
return builder_1.Builder;
|
|
676
|
+
}
|
|
677
|
+
});
|
|
678
|
+
__exportStar(__webpack_require__("./node_modules/.pnpm/fdir@6.4.2_picomatch@4.0.2/node_modules/fdir/dist/types.js"), exports);
|
|
679
|
+
},
|
|
680
|
+
"./node_modules/.pnpm/fdir@6.4.2_picomatch@4.0.2/node_modules/fdir/dist/types.js": function(__unused_webpack_module, exports) {
|
|
681
|
+
Object.defineProperty(exports, "__esModule", {
|
|
682
|
+
value: true
|
|
683
|
+
});
|
|
684
|
+
},
|
|
685
|
+
"./node_modules/.pnpm/fdir@6.4.2_picomatch@4.0.2/node_modules/fdir/dist/utils.js": function(__unused_webpack_module, exports, __webpack_require__) {
|
|
686
|
+
Object.defineProperty(exports, "__esModule", {
|
|
687
|
+
value: true
|
|
688
|
+
});
|
|
689
|
+
exports.normalizePath = exports.convertSlashes = exports.cleanPath = void 0;
|
|
690
|
+
const path_1 = __webpack_require__("path");
|
|
691
|
+
function cleanPath(path) {
|
|
692
|
+
let normalized = (0, path_1.normalize)(path);
|
|
693
|
+
// we have to remove the last path separator
|
|
694
|
+
// to account for / root path
|
|
695
|
+
if (normalized.length > 1 && normalized[normalized.length - 1] === path_1.sep) normalized = normalized.substring(0, normalized.length - 1);
|
|
696
|
+
return normalized;
|
|
697
|
+
}
|
|
698
|
+
exports.cleanPath = cleanPath;
|
|
699
|
+
const SLASHES_REGEX = /[\\/]/g;
|
|
700
|
+
function convertSlashes(path, separator) {
|
|
701
|
+
return path.replace(SLASHES_REGEX, separator);
|
|
702
|
+
}
|
|
703
|
+
exports.convertSlashes = convertSlashes;
|
|
704
|
+
function normalizePath(path, options) {
|
|
705
|
+
const { resolvePaths, normalizePath, pathSeparator } = options;
|
|
706
|
+
const pathNeedsCleaning = "win32" === process.platform && path.includes("/") || path.startsWith(".");
|
|
707
|
+
if (resolvePaths) path = (0, path_1.resolve)(path);
|
|
708
|
+
if (normalizePath || pathNeedsCleaning) path = cleanPath(path);
|
|
709
|
+
if ("." === path) return "";
|
|
710
|
+
const needsSeperator = path[path.length - 1] !== pathSeparator;
|
|
711
|
+
return convertSlashes(needsSeperator ? path + pathSeparator : path, pathSeparator);
|
|
712
|
+
}
|
|
713
|
+
exports.normalizePath = normalizePath;
|
|
714
|
+
},
|
|
715
|
+
"./node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js": function(module) {
|
|
716
|
+
let p = process || {}, argv = p.argv || [], env = p.env || {};
|
|
717
|
+
let isColorSupported = !(!!env.NO_COLOR || argv.includes("--no-color")) && (!!env.FORCE_COLOR || argv.includes("--color") || "win32" === p.platform || (p.stdout || {}).isTTY && "dumb" !== env.TERM || !!env.CI);
|
|
718
|
+
let formatter = (open, close, replace = open)=>(input)=>{
|
|
719
|
+
let string = "" + input, index = string.indexOf(close, open.length);
|
|
720
|
+
return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close;
|
|
721
|
+
};
|
|
722
|
+
let replaceClose = (string, close, replace, index)=>{
|
|
723
|
+
let result = "", cursor = 0;
|
|
724
|
+
do {
|
|
725
|
+
result += string.substring(cursor, index) + replace;
|
|
726
|
+
cursor = index + close.length;
|
|
727
|
+
index = string.indexOf(close, cursor);
|
|
728
|
+
}while (~index);
|
|
729
|
+
return result + string.substring(cursor);
|
|
730
|
+
};
|
|
731
|
+
let createColors = (enabled = isColorSupported)=>{
|
|
732
|
+
let f = enabled ? formatter : ()=>String;
|
|
733
|
+
return {
|
|
734
|
+
isColorSupported: enabled,
|
|
735
|
+
reset: f("\x1b[0m", "\x1b[0m"),
|
|
736
|
+
bold: f("\x1b[1m", "\x1b[22m", "\x1b[22m\x1b[1m"),
|
|
737
|
+
dim: f("\x1b[2m", "\x1b[22m", "\x1b[22m\x1b[2m"),
|
|
738
|
+
italic: f("\x1b[3m", "\x1b[23m"),
|
|
739
|
+
underline: f("\x1b[4m", "\x1b[24m"),
|
|
740
|
+
inverse: f("\x1b[7m", "\x1b[27m"),
|
|
741
|
+
hidden: f("\x1b[8m", "\x1b[28m"),
|
|
742
|
+
strikethrough: f("\x1b[9m", "\x1b[29m"),
|
|
743
|
+
black: f("\x1b[30m", "\x1b[39m"),
|
|
744
|
+
red: f("\x1b[31m", "\x1b[39m"),
|
|
745
|
+
green: f("\x1b[32m", "\x1b[39m"),
|
|
746
|
+
yellow: f("\x1b[33m", "\x1b[39m"),
|
|
747
|
+
blue: f("\x1b[34m", "\x1b[39m"),
|
|
748
|
+
magenta: f("\x1b[35m", "\x1b[39m"),
|
|
749
|
+
cyan: f("\x1b[36m", "\x1b[39m"),
|
|
750
|
+
white: f("\x1b[37m", "\x1b[39m"),
|
|
751
|
+
gray: f("\x1b[90m", "\x1b[39m"),
|
|
752
|
+
bgBlack: f("\x1b[40m", "\x1b[49m"),
|
|
753
|
+
bgRed: f("\x1b[41m", "\x1b[49m"),
|
|
754
|
+
bgGreen: f("\x1b[42m", "\x1b[49m"),
|
|
755
|
+
bgYellow: f("\x1b[43m", "\x1b[49m"),
|
|
756
|
+
bgBlue: f("\x1b[44m", "\x1b[49m"),
|
|
757
|
+
bgMagenta: f("\x1b[45m", "\x1b[49m"),
|
|
758
|
+
bgCyan: f("\x1b[46m", "\x1b[49m"),
|
|
759
|
+
bgWhite: f("\x1b[47m", "\x1b[49m"),
|
|
760
|
+
blackBright: f("\x1b[90m", "\x1b[39m"),
|
|
761
|
+
redBright: f("\x1b[91m", "\x1b[39m"),
|
|
762
|
+
greenBright: f("\x1b[92m", "\x1b[39m"),
|
|
763
|
+
yellowBright: f("\x1b[93m", "\x1b[39m"),
|
|
764
|
+
blueBright: f("\x1b[94m", "\x1b[39m"),
|
|
765
|
+
magentaBright: f("\x1b[95m", "\x1b[39m"),
|
|
766
|
+
cyanBright: f("\x1b[96m", "\x1b[39m"),
|
|
767
|
+
whiteBright: f("\x1b[97m", "\x1b[39m"),
|
|
768
|
+
bgBlackBright: f("\x1b[100m", "\x1b[49m"),
|
|
769
|
+
bgRedBright: f("\x1b[101m", "\x1b[49m"),
|
|
770
|
+
bgGreenBright: f("\x1b[102m", "\x1b[49m"),
|
|
771
|
+
bgYellowBright: f("\x1b[103m", "\x1b[49m"),
|
|
772
|
+
bgBlueBright: f("\x1b[104m", "\x1b[49m"),
|
|
773
|
+
bgMagentaBright: f("\x1b[105m", "\x1b[49m"),
|
|
774
|
+
bgCyanBright: f("\x1b[106m", "\x1b[49m"),
|
|
775
|
+
bgWhiteBright: f("\x1b[107m", "\x1b[49m")
|
|
776
|
+
};
|
|
777
|
+
};
|
|
778
|
+
module.exports = createColors();
|
|
779
|
+
module.exports.createColors = createColors;
|
|
780
|
+
},
|
|
781
|
+
"./node_modules/.pnpm/picomatch@4.0.2/node_modules/picomatch/index.js": function(module, __unused_webpack_exports, __webpack_require__) {
|
|
782
|
+
const pico = __webpack_require__("./node_modules/.pnpm/picomatch@4.0.2/node_modules/picomatch/lib/picomatch.js");
|
|
783
|
+
const utils = __webpack_require__("./node_modules/.pnpm/picomatch@4.0.2/node_modules/picomatch/lib/utils.js");
|
|
784
|
+
function picomatch(glob, options, returnState = false) {
|
|
785
|
+
// default to os.platform()
|
|
786
|
+
if (options && (null === options.windows || void 0 === options.windows)) // don't mutate the original options object
|
|
787
|
+
options = {
|
|
788
|
+
...options,
|
|
789
|
+
windows: utils.isWindows()
|
|
790
|
+
};
|
|
791
|
+
return pico(glob, options, returnState);
|
|
792
|
+
}
|
|
793
|
+
Object.assign(picomatch, pico);
|
|
794
|
+
module.exports = picomatch;
|
|
795
|
+
},
|
|
796
|
+
"./node_modules/.pnpm/picomatch@4.0.2/node_modules/picomatch/lib/constants.js": function(module) {
|
|
797
|
+
const WIN_SLASH = '\\\\/';
|
|
798
|
+
const WIN_NO_SLASH = `[^${WIN_SLASH}]`;
|
|
799
|
+
/**
|
|
800
|
+
* Posix glob regex
|
|
801
|
+
*/ const DOT_LITERAL = '\\.';
|
|
802
|
+
const PLUS_LITERAL = '\\+';
|
|
803
|
+
const QMARK_LITERAL = '\\?';
|
|
804
|
+
const SLASH_LITERAL = '\\/';
|
|
805
|
+
const ONE_CHAR = '(?=.)';
|
|
806
|
+
const QMARK = '[^/]';
|
|
807
|
+
const END_ANCHOR = `(?:${SLASH_LITERAL}|$)`;
|
|
808
|
+
const START_ANCHOR = `(?:^|${SLASH_LITERAL})`;
|
|
809
|
+
const DOTS_SLASH = `${DOT_LITERAL}{1,2}${END_ANCHOR}`;
|
|
810
|
+
const NO_DOT = `(?!${DOT_LITERAL})`;
|
|
811
|
+
const NO_DOTS = `(?!${START_ANCHOR}${DOTS_SLASH})`;
|
|
812
|
+
const NO_DOT_SLASH = `(?!${DOT_LITERAL}{0,1}${END_ANCHOR})`;
|
|
813
|
+
const NO_DOTS_SLASH = `(?!${DOTS_SLASH})`;
|
|
814
|
+
const QMARK_NO_DOT = `[^.${SLASH_LITERAL}]`;
|
|
815
|
+
const STAR = `${QMARK}*?`;
|
|
816
|
+
const SEP = '/';
|
|
817
|
+
const POSIX_CHARS = {
|
|
818
|
+
DOT_LITERAL,
|
|
819
|
+
PLUS_LITERAL,
|
|
820
|
+
QMARK_LITERAL,
|
|
821
|
+
SLASH_LITERAL,
|
|
822
|
+
ONE_CHAR,
|
|
823
|
+
QMARK,
|
|
824
|
+
END_ANCHOR,
|
|
825
|
+
DOTS_SLASH,
|
|
826
|
+
NO_DOT,
|
|
827
|
+
NO_DOTS,
|
|
828
|
+
NO_DOT_SLASH,
|
|
829
|
+
NO_DOTS_SLASH,
|
|
830
|
+
QMARK_NO_DOT,
|
|
831
|
+
STAR,
|
|
832
|
+
START_ANCHOR,
|
|
833
|
+
SEP
|
|
834
|
+
};
|
|
835
|
+
/**
|
|
836
|
+
* Windows glob regex
|
|
837
|
+
*/ const WINDOWS_CHARS = {
|
|
838
|
+
...POSIX_CHARS,
|
|
839
|
+
SLASH_LITERAL: `[${WIN_SLASH}]`,
|
|
840
|
+
QMARK: WIN_NO_SLASH,
|
|
841
|
+
STAR: `${WIN_NO_SLASH}*?`,
|
|
842
|
+
DOTS_SLASH: `${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$)`,
|
|
843
|
+
NO_DOT: `(?!${DOT_LITERAL})`,
|
|
844
|
+
NO_DOTS: `(?!(?:^|[${WIN_SLASH}])${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,
|
|
845
|
+
NO_DOT_SLASH: `(?!${DOT_LITERAL}{0,1}(?:[${WIN_SLASH}]|$))`,
|
|
846
|
+
NO_DOTS_SLASH: `(?!${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,
|
|
847
|
+
QMARK_NO_DOT: `[^.${WIN_SLASH}]`,
|
|
848
|
+
START_ANCHOR: `(?:^|[${WIN_SLASH}])`,
|
|
849
|
+
END_ANCHOR: `(?:[${WIN_SLASH}]|$)`,
|
|
850
|
+
SEP: '\\'
|
|
851
|
+
};
|
|
852
|
+
/**
|
|
853
|
+
* POSIX Bracket Regex
|
|
854
|
+
*/ const POSIX_REGEX_SOURCE = {
|
|
855
|
+
alnum: 'a-zA-Z0-9',
|
|
856
|
+
alpha: 'a-zA-Z',
|
|
857
|
+
ascii: '\\x00-\\x7F',
|
|
858
|
+
blank: ' \\t',
|
|
859
|
+
cntrl: '\\x00-\\x1F\\x7F',
|
|
860
|
+
digit: '0-9',
|
|
861
|
+
graph: '\\x21-\\x7E',
|
|
862
|
+
lower: 'a-z',
|
|
863
|
+
print: '\\x20-\\x7E ',
|
|
864
|
+
punct: '\\-!"#$%&\'()\\*+,./:;<=>?@[\\]^_`{|}~',
|
|
865
|
+
space: ' \\t\\r\\n\\v\\f',
|
|
866
|
+
upper: 'A-Z',
|
|
867
|
+
word: 'A-Za-z0-9_',
|
|
868
|
+
xdigit: 'A-Fa-f0-9'
|
|
869
|
+
};
|
|
870
|
+
module.exports = {
|
|
871
|
+
MAX_LENGTH: 65536,
|
|
872
|
+
POSIX_REGEX_SOURCE,
|
|
873
|
+
// regular expressions
|
|
874
|
+
REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g,
|
|
875
|
+
REGEX_NON_SPECIAL_CHARS: /^[^@![\].,$*+?^{}()|\\/]+/,
|
|
876
|
+
REGEX_SPECIAL_CHARS: /[-*+?.^${}(|)[\]]/,
|
|
877
|
+
REGEX_SPECIAL_CHARS_BACKREF: /(\\?)((\W)(\3*))/g,
|
|
878
|
+
REGEX_SPECIAL_CHARS_GLOBAL: /([-*+?.^${}(|)[\]])/g,
|
|
879
|
+
REGEX_REMOVE_BACKSLASH: /(?:\[.*?[^\\]\]|\\(?=.))/g,
|
|
880
|
+
// Replace globs with equivalent patterns to reduce parsing time.
|
|
881
|
+
REPLACEMENTS: {
|
|
882
|
+
'***': '*',
|
|
883
|
+
'**/**': '**',
|
|
884
|
+
'**/**/**': '**'
|
|
885
|
+
},
|
|
886
|
+
// Digits
|
|
887
|
+
CHAR_0: 48,
|
|
888
|
+
/* 0 */ CHAR_9: 57,
|
|
889
|
+
/* 9 */ // Alphabet chars.
|
|
890
|
+
CHAR_UPPERCASE_A: 65,
|
|
891
|
+
/* A */ CHAR_LOWERCASE_A: 97,
|
|
892
|
+
/* a */ CHAR_UPPERCASE_Z: 90,
|
|
893
|
+
/* Z */ CHAR_LOWERCASE_Z: 122,
|
|
894
|
+
/* z */ CHAR_LEFT_PARENTHESES: 40,
|
|
895
|
+
/* ( */ CHAR_RIGHT_PARENTHESES: 41,
|
|
896
|
+
/* ) */ CHAR_ASTERISK: 42,
|
|
897
|
+
/* * */ // Non-alphabetic chars.
|
|
898
|
+
CHAR_AMPERSAND: 38,
|
|
899
|
+
/* & */ CHAR_AT: 64,
|
|
900
|
+
/* @ */ CHAR_BACKWARD_SLASH: 92,
|
|
901
|
+
/* \ */ CHAR_CARRIAGE_RETURN: 13,
|
|
902
|
+
/* \r */ CHAR_CIRCUMFLEX_ACCENT: 94,
|
|
903
|
+
/* ^ */ CHAR_COLON: 58,
|
|
904
|
+
/* : */ CHAR_COMMA: 44,
|
|
905
|
+
/* , */ CHAR_DOT: 46,
|
|
906
|
+
/* . */ CHAR_DOUBLE_QUOTE: 34,
|
|
907
|
+
/* " */ CHAR_EQUAL: 61,
|
|
908
|
+
/* = */ CHAR_EXCLAMATION_MARK: 33,
|
|
909
|
+
/* ! */ CHAR_FORM_FEED: 12,
|
|
910
|
+
/* \f */ CHAR_FORWARD_SLASH: 47,
|
|
911
|
+
/* / */ CHAR_GRAVE_ACCENT: 96,
|
|
912
|
+
/* ` */ CHAR_HASH: 35,
|
|
913
|
+
/* # */ CHAR_HYPHEN_MINUS: 45,
|
|
914
|
+
/* - */ CHAR_LEFT_ANGLE_BRACKET: 60,
|
|
915
|
+
/* < */ CHAR_LEFT_CURLY_BRACE: 123,
|
|
916
|
+
/* { */ CHAR_LEFT_SQUARE_BRACKET: 91,
|
|
917
|
+
/* [ */ CHAR_LINE_FEED: 10,
|
|
918
|
+
/* \n */ CHAR_NO_BREAK_SPACE: 160,
|
|
919
|
+
/* \u00A0 */ CHAR_PERCENT: 37,
|
|
920
|
+
/* % */ CHAR_PLUS: 43,
|
|
921
|
+
/* + */ CHAR_QUESTION_MARK: 63,
|
|
922
|
+
/* ? */ CHAR_RIGHT_ANGLE_BRACKET: 62,
|
|
923
|
+
/* > */ CHAR_RIGHT_CURLY_BRACE: 125,
|
|
924
|
+
/* } */ CHAR_RIGHT_SQUARE_BRACKET: 93,
|
|
925
|
+
/* ] */ CHAR_SEMICOLON: 59,
|
|
926
|
+
/* ; */ CHAR_SINGLE_QUOTE: 39,
|
|
927
|
+
/* ' */ CHAR_SPACE: 32,
|
|
928
|
+
/* */ CHAR_TAB: 9,
|
|
929
|
+
/* \t */ CHAR_UNDERSCORE: 95,
|
|
930
|
+
/* _ */ CHAR_VERTICAL_LINE: 124,
|
|
931
|
+
/* | */ CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279,
|
|
932
|
+
/* \uFEFF */ /**
|
|
933
|
+
* Create EXTGLOB_CHARS
|
|
934
|
+
*/ extglobChars (chars) {
|
|
935
|
+
return {
|
|
936
|
+
'!': {
|
|
937
|
+
type: 'negate',
|
|
938
|
+
open: '(?:(?!(?:',
|
|
939
|
+
close: `))${chars.STAR})`
|
|
940
|
+
},
|
|
941
|
+
'?': {
|
|
942
|
+
type: 'qmark',
|
|
943
|
+
open: '(?:',
|
|
944
|
+
close: ')?'
|
|
945
|
+
},
|
|
946
|
+
'+': {
|
|
947
|
+
type: 'plus',
|
|
948
|
+
open: '(?:',
|
|
949
|
+
close: ')+'
|
|
950
|
+
},
|
|
951
|
+
'*': {
|
|
952
|
+
type: 'star',
|
|
953
|
+
open: '(?:',
|
|
954
|
+
close: ')*'
|
|
955
|
+
},
|
|
956
|
+
'@': {
|
|
957
|
+
type: 'at',
|
|
958
|
+
open: '(?:',
|
|
959
|
+
close: ')'
|
|
960
|
+
}
|
|
961
|
+
};
|
|
962
|
+
},
|
|
963
|
+
/**
|
|
964
|
+
* Create GLOB_CHARS
|
|
965
|
+
*/ globChars (win32) {
|
|
966
|
+
return true === win32 ? WINDOWS_CHARS : POSIX_CHARS;
|
|
967
|
+
}
|
|
968
|
+
};
|
|
969
|
+
},
|
|
970
|
+
"./node_modules/.pnpm/picomatch@4.0.2/node_modules/picomatch/lib/parse.js": function(module, __unused_webpack_exports, __webpack_require__) {
|
|
971
|
+
const constants = __webpack_require__("./node_modules/.pnpm/picomatch@4.0.2/node_modules/picomatch/lib/constants.js");
|
|
972
|
+
const utils = __webpack_require__("./node_modules/.pnpm/picomatch@4.0.2/node_modules/picomatch/lib/utils.js");
|
|
973
|
+
/**
|
|
974
|
+
* Constants
|
|
975
|
+
*/ const { MAX_LENGTH, POSIX_REGEX_SOURCE, REGEX_NON_SPECIAL_CHARS, REGEX_SPECIAL_CHARS_BACKREF, REPLACEMENTS } = constants;
|
|
976
|
+
/**
|
|
977
|
+
* Helpers
|
|
978
|
+
*/ const expandRange = (args, options)=>{
|
|
979
|
+
if ('function' == typeof options.expandRange) return options.expandRange(...args, options);
|
|
980
|
+
args.sort();
|
|
981
|
+
const value = `[${args.join('-')}]`;
|
|
982
|
+
try {
|
|
983
|
+
/* eslint-disable-next-line no-new */ new RegExp(value);
|
|
984
|
+
} catch (ex) {
|
|
985
|
+
return args.map((v)=>utils.escapeRegex(v)).join('..');
|
|
986
|
+
}
|
|
987
|
+
return value;
|
|
988
|
+
};
|
|
989
|
+
/**
|
|
990
|
+
* Create the message for a syntax error
|
|
991
|
+
*/ const syntaxError = (type, char)=>`Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`;
|
|
992
|
+
/**
|
|
993
|
+
* Parse the given input string.
|
|
994
|
+
* @param {String} input
|
|
995
|
+
* @param {Object} options
|
|
996
|
+
* @return {Object}
|
|
997
|
+
*/ const parse = (input, options)=>{
|
|
998
|
+
if ('string' != typeof input) throw new TypeError('Expected a string');
|
|
999
|
+
input = REPLACEMENTS[input] || input;
|
|
1000
|
+
const opts = {
|
|
1001
|
+
...options
|
|
1002
|
+
};
|
|
1003
|
+
const max = 'number' == typeof opts.maxLength ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
|
|
1004
|
+
let len = input.length;
|
|
1005
|
+
if (len > max) throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
|
|
1006
|
+
const bos = {
|
|
1007
|
+
type: 'bos',
|
|
1008
|
+
value: '',
|
|
1009
|
+
output: opts.prepend || ''
|
|
1010
|
+
};
|
|
1011
|
+
const tokens = [
|
|
1012
|
+
bos
|
|
1013
|
+
];
|
|
1014
|
+
const capture = opts.capture ? '' : '?:';
|
|
1015
|
+
// create constants based on platform, for windows or posix
|
|
1016
|
+
const PLATFORM_CHARS = constants.globChars(opts.windows);
|
|
1017
|
+
const EXTGLOB_CHARS = constants.extglobChars(PLATFORM_CHARS);
|
|
1018
|
+
const { DOT_LITERAL, PLUS_LITERAL, SLASH_LITERAL, ONE_CHAR, DOTS_SLASH, NO_DOT, NO_DOT_SLASH, NO_DOTS_SLASH, QMARK, QMARK_NO_DOT, STAR, START_ANCHOR } = PLATFORM_CHARS;
|
|
1019
|
+
const globstar = (opts)=>`(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
|
|
1020
|
+
const nodot = opts.dot ? '' : NO_DOT;
|
|
1021
|
+
const qmarkNoDot = opts.dot ? QMARK : QMARK_NO_DOT;
|
|
1022
|
+
let star = true === opts.bash ? globstar(opts) : STAR;
|
|
1023
|
+
if (opts.capture) star = `(${star})`;
|
|
1024
|
+
// minimatch options support
|
|
1025
|
+
if ('boolean' == typeof opts.noext) opts.noextglob = opts.noext;
|
|
1026
|
+
const state = {
|
|
1027
|
+
input,
|
|
1028
|
+
index: -1,
|
|
1029
|
+
start: 0,
|
|
1030
|
+
dot: true === opts.dot,
|
|
1031
|
+
consumed: '',
|
|
1032
|
+
output: '',
|
|
1033
|
+
prefix: '',
|
|
1034
|
+
backtrack: false,
|
|
1035
|
+
negated: false,
|
|
1036
|
+
brackets: 0,
|
|
1037
|
+
braces: 0,
|
|
1038
|
+
parens: 0,
|
|
1039
|
+
quotes: 0,
|
|
1040
|
+
globstar: false,
|
|
1041
|
+
tokens
|
|
1042
|
+
};
|
|
1043
|
+
input = utils.removePrefix(input, state);
|
|
1044
|
+
len = input.length;
|
|
1045
|
+
const extglobs = [];
|
|
1046
|
+
const braces = [];
|
|
1047
|
+
const stack = [];
|
|
1048
|
+
let prev = bos;
|
|
1049
|
+
let value;
|
|
1050
|
+
/**
|
|
1051
|
+
* Tokenizing helpers
|
|
1052
|
+
*/ const eos = ()=>state.index === len - 1;
|
|
1053
|
+
const peek = state.peek = (n = 1)=>input[state.index + n];
|
|
1054
|
+
const advance = state.advance = ()=>input[++state.index] || '';
|
|
1055
|
+
const remaining = ()=>input.slice(state.index + 1);
|
|
1056
|
+
const consume = (value = '', num = 0)=>{
|
|
1057
|
+
state.consumed += value;
|
|
1058
|
+
state.index += num;
|
|
1059
|
+
};
|
|
1060
|
+
const append = (token)=>{
|
|
1061
|
+
state.output += null != token.output ? token.output : token.value;
|
|
1062
|
+
consume(token.value);
|
|
1063
|
+
};
|
|
1064
|
+
const negate = ()=>{
|
|
1065
|
+
let count = 1;
|
|
1066
|
+
while('!' === peek() && ('(' !== peek(2) || '?' === peek(3))){
|
|
1067
|
+
advance();
|
|
1068
|
+
state.start++;
|
|
1069
|
+
count++;
|
|
1070
|
+
}
|
|
1071
|
+
if (count % 2 === 0) return false;
|
|
1072
|
+
state.negated = true;
|
|
1073
|
+
state.start++;
|
|
1074
|
+
return true;
|
|
1075
|
+
};
|
|
1076
|
+
const increment = (type)=>{
|
|
1077
|
+
state[type]++;
|
|
1078
|
+
stack.push(type);
|
|
1079
|
+
};
|
|
1080
|
+
const decrement = (type)=>{
|
|
1081
|
+
state[type]--;
|
|
1082
|
+
stack.pop();
|
|
1083
|
+
};
|
|
1084
|
+
/**
|
|
1085
|
+
* Push tokens onto the tokens array. This helper speeds up
|
|
1086
|
+
* tokenizing by 1) helping us avoid backtracking as much as possible,
|
|
1087
|
+
* and 2) helping us avoid creating extra tokens when consecutive
|
|
1088
|
+
* characters are plain text. This improves performance and simplifies
|
|
1089
|
+
* lookbehinds.
|
|
1090
|
+
*/ const push = (tok)=>{
|
|
1091
|
+
if ('globstar' === prev.type) {
|
|
1092
|
+
const isBrace = state.braces > 0 && ('comma' === tok.type || 'brace' === tok.type);
|
|
1093
|
+
const isExtglob = true === tok.extglob || extglobs.length && ('pipe' === tok.type || 'paren' === tok.type);
|
|
1094
|
+
if ('slash' !== tok.type && 'paren' !== tok.type && !isBrace && !isExtglob) {
|
|
1095
|
+
state.output = state.output.slice(0, -prev.output.length);
|
|
1096
|
+
prev.type = 'star';
|
|
1097
|
+
prev.value = '*';
|
|
1098
|
+
prev.output = star;
|
|
1099
|
+
state.output += prev.output;
|
|
1100
|
+
}
|
|
1101
|
+
}
|
|
1102
|
+
if (extglobs.length && 'paren' !== tok.type) extglobs[extglobs.length - 1].inner += tok.value;
|
|
1103
|
+
if (tok.value || tok.output) append(tok);
|
|
1104
|
+
if (prev && 'text' === prev.type && 'text' === tok.type) {
|
|
1105
|
+
prev.output = (prev.output || prev.value) + tok.value;
|
|
1106
|
+
prev.value += tok.value;
|
|
1107
|
+
return;
|
|
1108
|
+
}
|
|
1109
|
+
tok.prev = prev;
|
|
1110
|
+
tokens.push(tok);
|
|
1111
|
+
prev = tok;
|
|
1112
|
+
};
|
|
1113
|
+
const extglobOpen = (type, value)=>{
|
|
1114
|
+
const token = {
|
|
1115
|
+
...EXTGLOB_CHARS[value],
|
|
1116
|
+
conditions: 1,
|
|
1117
|
+
inner: ''
|
|
1118
|
+
};
|
|
1119
|
+
token.prev = prev;
|
|
1120
|
+
token.parens = state.parens;
|
|
1121
|
+
token.output = state.output;
|
|
1122
|
+
const output = (opts.capture ? '(' : '') + token.open;
|
|
1123
|
+
increment('parens');
|
|
1124
|
+
push({
|
|
1125
|
+
type,
|
|
1126
|
+
value,
|
|
1127
|
+
output: state.output ? '' : ONE_CHAR
|
|
1128
|
+
});
|
|
1129
|
+
push({
|
|
1130
|
+
type: 'paren',
|
|
1131
|
+
extglob: true,
|
|
1132
|
+
value: advance(),
|
|
1133
|
+
output
|
|
1134
|
+
});
|
|
1135
|
+
extglobs.push(token);
|
|
1136
|
+
};
|
|
1137
|
+
const extglobClose = (token)=>{
|
|
1138
|
+
let output = token.close + (opts.capture ? ')' : '');
|
|
1139
|
+
let rest;
|
|
1140
|
+
if ('negate' === token.type) {
|
|
1141
|
+
let extglobStar = star;
|
|
1142
|
+
if (token.inner && token.inner.length > 1 && token.inner.includes('/')) extglobStar = globstar(opts);
|
|
1143
|
+
if (extglobStar !== star || eos() || /^\)+$/.test(remaining())) output = token.close = `)$))${extglobStar}`;
|
|
1144
|
+
if (token.inner.includes('*') && (rest = remaining()) && /^\.[^\\/.]+$/.test(rest)) {
|
|
1145
|
+
// Any non-magical string (`.ts`) or even nested expression (`.{ts,tsx}`) can follow after the closing parenthesis.
|
|
1146
|
+
// In this case, we need to parse the string and use it in the output of the original pattern.
|
|
1147
|
+
// Suitable patterns: `/!(*.d).ts`, `/!(*.d).{ts,tsx}`, `**/!(*-dbg).@(js)`.
|
|
1148
|
+
//
|
|
1149
|
+
// Disabling the `fastpaths` option due to a problem with parsing strings as `.ts` in the pattern like `**/!(*.d).ts`.
|
|
1150
|
+
const expression = parse(rest, {
|
|
1151
|
+
...options,
|
|
1152
|
+
fastpaths: false
|
|
1153
|
+
}).output;
|
|
1154
|
+
output = token.close = `)${expression})${extglobStar})`;
|
|
1155
|
+
}
|
|
1156
|
+
if ('bos' === token.prev.type) state.negatedExtglob = true;
|
|
1157
|
+
}
|
|
1158
|
+
push({
|
|
1159
|
+
type: 'paren',
|
|
1160
|
+
extglob: true,
|
|
1161
|
+
value,
|
|
1162
|
+
output
|
|
1163
|
+
});
|
|
1164
|
+
decrement('parens');
|
|
1165
|
+
};
|
|
1166
|
+
/**
|
|
1167
|
+
* Fast paths
|
|
1168
|
+
*/ if (false !== opts.fastpaths && !/(^[*!]|[/()[\]{}"])/.test(input)) {
|
|
1169
|
+
let backslashes = false;
|
|
1170
|
+
let output = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (m, esc, chars, first, rest, index)=>{
|
|
1171
|
+
if ('\\' === first) {
|
|
1172
|
+
backslashes = true;
|
|
1173
|
+
return m;
|
|
1174
|
+
}
|
|
1175
|
+
if ('?' === first) {
|
|
1176
|
+
if (esc) return esc + first + (rest ? QMARK.repeat(rest.length) : '');
|
|
1177
|
+
if (0 === index) return qmarkNoDot + (rest ? QMARK.repeat(rest.length) : '');
|
|
1178
|
+
return QMARK.repeat(chars.length);
|
|
1179
|
+
}
|
|
1180
|
+
if ('.' === first) return DOT_LITERAL.repeat(chars.length);
|
|
1181
|
+
if ('*' === first) {
|
|
1182
|
+
if (esc) return esc + first + (rest ? star : '');
|
|
1183
|
+
return star;
|
|
1184
|
+
}
|
|
1185
|
+
return esc ? m : `\\${m}`;
|
|
1186
|
+
});
|
|
1187
|
+
if (true === backslashes) output = true === opts.unescape ? output.replace(/\\/g, '') : output.replace(/\\+/g, (m)=>m.length % 2 === 0 ? '\\\\' : m ? '\\' : '');
|
|
1188
|
+
if (output === input && true === opts.contains) {
|
|
1189
|
+
state.output = input;
|
|
1190
|
+
return state;
|
|
1191
|
+
}
|
|
1192
|
+
state.output = utils.wrapOutput(output, state, options);
|
|
1193
|
+
return state;
|
|
1194
|
+
}
|
|
1195
|
+
/**
|
|
1196
|
+
* Tokenize input until we reach end-of-string
|
|
1197
|
+
*/ while(!eos()){
|
|
1198
|
+
value = advance();
|
|
1199
|
+
if ('\u0000' === value) continue;
|
|
1200
|
+
/**
|
|
1201
|
+
* Escaped characters
|
|
1202
|
+
*/ if ('\\' === value) {
|
|
1203
|
+
const next = peek();
|
|
1204
|
+
if ('/' === next && true !== opts.bash) continue;
|
|
1205
|
+
if ('.' === next || ';' === next) continue;
|
|
1206
|
+
if (!next) {
|
|
1207
|
+
value += '\\';
|
|
1208
|
+
push({
|
|
1209
|
+
type: 'text',
|
|
1210
|
+
value
|
|
1211
|
+
});
|
|
1212
|
+
continue;
|
|
1213
|
+
}
|
|
1214
|
+
// collapse slashes to reduce potential for exploits
|
|
1215
|
+
const match = /^\\+/.exec(remaining());
|
|
1216
|
+
let slashes = 0;
|
|
1217
|
+
if (match && match[0].length > 2) {
|
|
1218
|
+
slashes = match[0].length;
|
|
1219
|
+
state.index += slashes;
|
|
1220
|
+
if (slashes % 2 !== 0) value += '\\';
|
|
1221
|
+
}
|
|
1222
|
+
if (true === opts.unescape) value = advance();
|
|
1223
|
+
else value += advance();
|
|
1224
|
+
if (0 === state.brackets) {
|
|
1225
|
+
push({
|
|
1226
|
+
type: 'text',
|
|
1227
|
+
value
|
|
1228
|
+
});
|
|
1229
|
+
continue;
|
|
1230
|
+
}
|
|
1231
|
+
}
|
|
1232
|
+
/**
|
|
1233
|
+
* If we're inside a regex character class, continue
|
|
1234
|
+
* until we reach the closing bracket.
|
|
1235
|
+
*/ if (state.brackets > 0 && (']' !== value || '[' === prev.value || '[^' === prev.value)) {
|
|
1236
|
+
if (false !== opts.posix && ':' === value) {
|
|
1237
|
+
const inner = prev.value.slice(1);
|
|
1238
|
+
if (inner.includes('[')) {
|
|
1239
|
+
prev.posix = true;
|
|
1240
|
+
if (inner.includes(':')) {
|
|
1241
|
+
const idx = prev.value.lastIndexOf('[');
|
|
1242
|
+
const pre = prev.value.slice(0, idx);
|
|
1243
|
+
const rest = prev.value.slice(idx + 2);
|
|
1244
|
+
const posix = POSIX_REGEX_SOURCE[rest];
|
|
1245
|
+
if (posix) {
|
|
1246
|
+
prev.value = pre + posix;
|
|
1247
|
+
state.backtrack = true;
|
|
1248
|
+
advance();
|
|
1249
|
+
if (!bos.output && 1 === tokens.indexOf(prev)) bos.output = ONE_CHAR;
|
|
1250
|
+
continue;
|
|
1251
|
+
}
|
|
1252
|
+
}
|
|
1253
|
+
}
|
|
1254
|
+
}
|
|
1255
|
+
if ('[' === value && ':' !== peek() || '-' === value && ']' === peek()) value = `\\${value}`;
|
|
1256
|
+
if (']' === value && ('[' === prev.value || '[^' === prev.value)) value = `\\${value}`;
|
|
1257
|
+
if (true === opts.posix && '!' === value && '[' === prev.value) value = '^';
|
|
1258
|
+
prev.value += value;
|
|
1259
|
+
append({
|
|
1260
|
+
value
|
|
1261
|
+
});
|
|
1262
|
+
continue;
|
|
1263
|
+
}
|
|
1264
|
+
/**
|
|
1265
|
+
* If we're inside a quoted string, continue
|
|
1266
|
+
* until we reach the closing double quote.
|
|
1267
|
+
*/ if (1 === state.quotes && '"' !== value) {
|
|
1268
|
+
value = utils.escapeRegex(value);
|
|
1269
|
+
prev.value += value;
|
|
1270
|
+
append({
|
|
1271
|
+
value
|
|
1272
|
+
});
|
|
1273
|
+
continue;
|
|
1274
|
+
}
|
|
1275
|
+
/**
|
|
1276
|
+
* Double quotes
|
|
1277
|
+
*/ if ('"' === value) {
|
|
1278
|
+
state.quotes = 1 === state.quotes ? 0 : 1;
|
|
1279
|
+
if (true === opts.keepQuotes) push({
|
|
1280
|
+
type: 'text',
|
|
1281
|
+
value
|
|
1282
|
+
});
|
|
1283
|
+
continue;
|
|
1284
|
+
}
|
|
1285
|
+
/**
|
|
1286
|
+
* Parentheses
|
|
1287
|
+
*/ if ('(' === value) {
|
|
1288
|
+
increment('parens');
|
|
1289
|
+
push({
|
|
1290
|
+
type: 'paren',
|
|
1291
|
+
value
|
|
1292
|
+
});
|
|
1293
|
+
continue;
|
|
1294
|
+
}
|
|
1295
|
+
if (')' === value) {
|
|
1296
|
+
if (0 === state.parens && true === opts.strictBrackets) throw new SyntaxError(syntaxError('opening', '('));
|
|
1297
|
+
const extglob = extglobs[extglobs.length - 1];
|
|
1298
|
+
if (extglob && state.parens === extglob.parens + 1) {
|
|
1299
|
+
extglobClose(extglobs.pop());
|
|
1300
|
+
continue;
|
|
1301
|
+
}
|
|
1302
|
+
push({
|
|
1303
|
+
type: 'paren',
|
|
1304
|
+
value,
|
|
1305
|
+
output: state.parens ? ')' : '\\)'
|
|
1306
|
+
});
|
|
1307
|
+
decrement('parens');
|
|
1308
|
+
continue;
|
|
1309
|
+
}
|
|
1310
|
+
/**
|
|
1311
|
+
* Square brackets
|
|
1312
|
+
*/ if ('[' === value) {
|
|
1313
|
+
if (true !== opts.nobracket && remaining().includes(']')) increment('brackets');
|
|
1314
|
+
else {
|
|
1315
|
+
if (true !== opts.nobracket && true === opts.strictBrackets) throw new SyntaxError(syntaxError('closing', ']'));
|
|
1316
|
+
value = `\\${value}`;
|
|
1317
|
+
}
|
|
1318
|
+
push({
|
|
1319
|
+
type: 'bracket',
|
|
1320
|
+
value
|
|
1321
|
+
});
|
|
1322
|
+
continue;
|
|
1323
|
+
}
|
|
1324
|
+
if (']' === value) {
|
|
1325
|
+
if (true === opts.nobracket || prev && 'bracket' === prev.type && 1 === prev.value.length) {
|
|
1326
|
+
push({
|
|
1327
|
+
type: 'text',
|
|
1328
|
+
value,
|
|
1329
|
+
output: `\\${value}`
|
|
1330
|
+
});
|
|
1331
|
+
continue;
|
|
1332
|
+
}
|
|
1333
|
+
if (0 === state.brackets) {
|
|
1334
|
+
if (true === opts.strictBrackets) throw new SyntaxError(syntaxError('opening', '['));
|
|
1335
|
+
push({
|
|
1336
|
+
type: 'text',
|
|
1337
|
+
value,
|
|
1338
|
+
output: `\\${value}`
|
|
1339
|
+
});
|
|
1340
|
+
continue;
|
|
1341
|
+
}
|
|
1342
|
+
decrement('brackets');
|
|
1343
|
+
const prevValue = prev.value.slice(1);
|
|
1344
|
+
if (true !== prev.posix && '^' === prevValue[0] && !prevValue.includes('/')) value = `/${value}`;
|
|
1345
|
+
prev.value += value;
|
|
1346
|
+
append({
|
|
1347
|
+
value
|
|
1348
|
+
});
|
|
1349
|
+
// when literal brackets are explicitly disabled
|
|
1350
|
+
// assume we should match with a regex character class
|
|
1351
|
+
if (false === opts.literalBrackets || utils.hasRegexChars(prevValue)) continue;
|
|
1352
|
+
const escaped = utils.escapeRegex(prev.value);
|
|
1353
|
+
state.output = state.output.slice(0, -prev.value.length);
|
|
1354
|
+
// when literal brackets are explicitly enabled
|
|
1355
|
+
// assume we should escape the brackets to match literal characters
|
|
1356
|
+
if (true === opts.literalBrackets) {
|
|
1357
|
+
state.output += escaped;
|
|
1358
|
+
prev.value = escaped;
|
|
1359
|
+
continue;
|
|
1360
|
+
}
|
|
1361
|
+
// when the user specifies nothing, try to match both
|
|
1362
|
+
prev.value = `(${capture}${escaped}|${prev.value})`;
|
|
1363
|
+
state.output += prev.value;
|
|
1364
|
+
continue;
|
|
1365
|
+
}
|
|
1366
|
+
/**
|
|
1367
|
+
* Braces
|
|
1368
|
+
*/ if ('{' === value && true !== opts.nobrace) {
|
|
1369
|
+
increment('braces');
|
|
1370
|
+
const open = {
|
|
1371
|
+
type: 'brace',
|
|
1372
|
+
value,
|
|
1373
|
+
output: '(',
|
|
1374
|
+
outputIndex: state.output.length,
|
|
1375
|
+
tokensIndex: state.tokens.length
|
|
1376
|
+
};
|
|
1377
|
+
braces.push(open);
|
|
1378
|
+
push(open);
|
|
1379
|
+
continue;
|
|
1380
|
+
}
|
|
1381
|
+
if ('}' === value) {
|
|
1382
|
+
const brace = braces[braces.length - 1];
|
|
1383
|
+
if (true === opts.nobrace || !brace) {
|
|
1384
|
+
push({
|
|
1385
|
+
type: 'text',
|
|
1386
|
+
value,
|
|
1387
|
+
output: value
|
|
1388
|
+
});
|
|
1389
|
+
continue;
|
|
1390
|
+
}
|
|
1391
|
+
let output = ')';
|
|
1392
|
+
if (true === brace.dots) {
|
|
1393
|
+
const arr = tokens.slice();
|
|
1394
|
+
const range = [];
|
|
1395
|
+
for(let i = arr.length - 1; i >= 0; i--){
|
|
1396
|
+
tokens.pop();
|
|
1397
|
+
if ('brace' === arr[i].type) break;
|
|
1398
|
+
if ('dots' !== arr[i].type) range.unshift(arr[i].value);
|
|
1399
|
+
}
|
|
1400
|
+
output = expandRange(range, opts);
|
|
1401
|
+
state.backtrack = true;
|
|
1402
|
+
}
|
|
1403
|
+
if (true !== brace.comma && true !== brace.dots) {
|
|
1404
|
+
const out = state.output.slice(0, brace.outputIndex);
|
|
1405
|
+
const toks = state.tokens.slice(brace.tokensIndex);
|
|
1406
|
+
brace.value = brace.output = '\\{';
|
|
1407
|
+
value = output = '\\}';
|
|
1408
|
+
state.output = out;
|
|
1409
|
+
for (const t of toks)state.output += t.output || t.value;
|
|
1410
|
+
}
|
|
1411
|
+
push({
|
|
1412
|
+
type: 'brace',
|
|
1413
|
+
value,
|
|
1414
|
+
output
|
|
1415
|
+
});
|
|
1416
|
+
decrement('braces');
|
|
1417
|
+
braces.pop();
|
|
1418
|
+
continue;
|
|
1419
|
+
}
|
|
1420
|
+
/**
|
|
1421
|
+
* Pipes
|
|
1422
|
+
*/ if ('|' === value) {
|
|
1423
|
+
if (extglobs.length > 0) extglobs[extglobs.length - 1].conditions++;
|
|
1424
|
+
push({
|
|
1425
|
+
type: 'text',
|
|
1426
|
+
value
|
|
1427
|
+
});
|
|
1428
|
+
continue;
|
|
1429
|
+
}
|
|
1430
|
+
/**
|
|
1431
|
+
* Commas
|
|
1432
|
+
*/ if (',' === value) {
|
|
1433
|
+
let output = value;
|
|
1434
|
+
const brace = braces[braces.length - 1];
|
|
1435
|
+
if (brace && 'braces' === stack[stack.length - 1]) {
|
|
1436
|
+
brace.comma = true;
|
|
1437
|
+
output = '|';
|
|
1438
|
+
}
|
|
1439
|
+
push({
|
|
1440
|
+
type: 'comma',
|
|
1441
|
+
value,
|
|
1442
|
+
output
|
|
1443
|
+
});
|
|
1444
|
+
continue;
|
|
1445
|
+
}
|
|
1446
|
+
/**
|
|
1447
|
+
* Slashes
|
|
1448
|
+
*/ if ('/' === value) {
|
|
1449
|
+
// if the beginning of the glob is "./", advance the start
|
|
1450
|
+
// to the current index, and don't add the "./" characters
|
|
1451
|
+
// to the state. This greatly simplifies lookbehinds when
|
|
1452
|
+
// checking for BOS characters like "!" and "." (not "./")
|
|
1453
|
+
if ('dot' === prev.type && state.index === state.start + 1) {
|
|
1454
|
+
state.start = state.index + 1;
|
|
1455
|
+
state.consumed = '';
|
|
1456
|
+
state.output = '';
|
|
1457
|
+
tokens.pop();
|
|
1458
|
+
prev = bos; // reset "prev" to the first token
|
|
1459
|
+
continue;
|
|
1460
|
+
}
|
|
1461
|
+
push({
|
|
1462
|
+
type: 'slash',
|
|
1463
|
+
value,
|
|
1464
|
+
output: SLASH_LITERAL
|
|
1465
|
+
});
|
|
1466
|
+
continue;
|
|
1467
|
+
}
|
|
1468
|
+
/**
|
|
1469
|
+
* Dots
|
|
1470
|
+
*/ if ('.' === value) {
|
|
1471
|
+
if (state.braces > 0 && 'dot' === prev.type) {
|
|
1472
|
+
if ('.' === prev.value) prev.output = DOT_LITERAL;
|
|
1473
|
+
const brace = braces[braces.length - 1];
|
|
1474
|
+
prev.type = 'dots';
|
|
1475
|
+
prev.output += value;
|
|
1476
|
+
prev.value += value;
|
|
1477
|
+
brace.dots = true;
|
|
1478
|
+
continue;
|
|
1479
|
+
}
|
|
1480
|
+
if (state.braces + state.parens === 0 && 'bos' !== prev.type && 'slash' !== prev.type) {
|
|
1481
|
+
push({
|
|
1482
|
+
type: 'text',
|
|
1483
|
+
value,
|
|
1484
|
+
output: DOT_LITERAL
|
|
1485
|
+
});
|
|
1486
|
+
continue;
|
|
1487
|
+
}
|
|
1488
|
+
push({
|
|
1489
|
+
type: 'dot',
|
|
1490
|
+
value,
|
|
1491
|
+
output: DOT_LITERAL
|
|
1492
|
+
});
|
|
1493
|
+
continue;
|
|
1494
|
+
}
|
|
1495
|
+
/**
|
|
1496
|
+
* Question marks
|
|
1497
|
+
*/ if ('?' === value) {
|
|
1498
|
+
const isGroup = prev && '(' === prev.value;
|
|
1499
|
+
if (!isGroup && true !== opts.noextglob && '(' === peek() && '?' !== peek(2)) {
|
|
1500
|
+
extglobOpen('qmark', value);
|
|
1501
|
+
continue;
|
|
1502
|
+
}
|
|
1503
|
+
if (prev && 'paren' === prev.type) {
|
|
1504
|
+
const next = peek();
|
|
1505
|
+
let output = value;
|
|
1506
|
+
if ('(' === prev.value && !/[!=<:]/.test(next) || '<' === next && !/<([!=]|\w+>)/.test(remaining())) output = `\\${value}`;
|
|
1507
|
+
push({
|
|
1508
|
+
type: 'text',
|
|
1509
|
+
value,
|
|
1510
|
+
output
|
|
1511
|
+
});
|
|
1512
|
+
continue;
|
|
1513
|
+
}
|
|
1514
|
+
if (true !== opts.dot && ('slash' === prev.type || 'bos' === prev.type)) {
|
|
1515
|
+
push({
|
|
1516
|
+
type: 'qmark',
|
|
1517
|
+
value,
|
|
1518
|
+
output: QMARK_NO_DOT
|
|
1519
|
+
});
|
|
1520
|
+
continue;
|
|
1521
|
+
}
|
|
1522
|
+
push({
|
|
1523
|
+
type: 'qmark',
|
|
1524
|
+
value,
|
|
1525
|
+
output: QMARK
|
|
1526
|
+
});
|
|
1527
|
+
continue;
|
|
1528
|
+
}
|
|
1529
|
+
/**
|
|
1530
|
+
* Exclamation
|
|
1531
|
+
*/ if ('!' === value) {
|
|
1532
|
+
if (true !== opts.noextglob && '(' === peek()) {
|
|
1533
|
+
if ('?' !== peek(2) || !/[!=<:]/.test(peek(3))) {
|
|
1534
|
+
extglobOpen('negate', value);
|
|
1535
|
+
continue;
|
|
1536
|
+
}
|
|
1537
|
+
}
|
|
1538
|
+
if (true !== opts.nonegate && 0 === state.index) {
|
|
1539
|
+
negate();
|
|
1540
|
+
continue;
|
|
1541
|
+
}
|
|
1542
|
+
}
|
|
1543
|
+
/**
|
|
1544
|
+
* Plus
|
|
1545
|
+
*/ if ('+' === value) {
|
|
1546
|
+
if (true !== opts.noextglob && '(' === peek() && '?' !== peek(2)) {
|
|
1547
|
+
extglobOpen('plus', value);
|
|
1548
|
+
continue;
|
|
1549
|
+
}
|
|
1550
|
+
if (prev && '(' === prev.value || false === opts.regex) {
|
|
1551
|
+
push({
|
|
1552
|
+
type: 'plus',
|
|
1553
|
+
value,
|
|
1554
|
+
output: PLUS_LITERAL
|
|
1555
|
+
});
|
|
1556
|
+
continue;
|
|
1557
|
+
}
|
|
1558
|
+
if (prev && ('bracket' === prev.type || 'paren' === prev.type || 'brace' === prev.type) || state.parens > 0) {
|
|
1559
|
+
push({
|
|
1560
|
+
type: 'plus',
|
|
1561
|
+
value
|
|
1562
|
+
});
|
|
1563
|
+
continue;
|
|
1564
|
+
}
|
|
1565
|
+
push({
|
|
1566
|
+
type: 'plus',
|
|
1567
|
+
value: PLUS_LITERAL
|
|
1568
|
+
});
|
|
1569
|
+
continue;
|
|
1570
|
+
}
|
|
1571
|
+
/**
|
|
1572
|
+
* Plain text
|
|
1573
|
+
*/ if ('@' === value) {
|
|
1574
|
+
if (true !== opts.noextglob && '(' === peek() && '?' !== peek(2)) {
|
|
1575
|
+
push({
|
|
1576
|
+
type: 'at',
|
|
1577
|
+
extglob: true,
|
|
1578
|
+
value,
|
|
1579
|
+
output: ''
|
|
1580
|
+
});
|
|
1581
|
+
continue;
|
|
1582
|
+
}
|
|
1583
|
+
push({
|
|
1584
|
+
type: 'text',
|
|
1585
|
+
value
|
|
1586
|
+
});
|
|
1587
|
+
continue;
|
|
1588
|
+
}
|
|
1589
|
+
/**
|
|
1590
|
+
* Plain text
|
|
1591
|
+
*/ if ('*' !== value) {
|
|
1592
|
+
if ('$' === value || '^' === value) value = `\\${value}`;
|
|
1593
|
+
const match = REGEX_NON_SPECIAL_CHARS.exec(remaining());
|
|
1594
|
+
if (match) {
|
|
1595
|
+
value += match[0];
|
|
1596
|
+
state.index += match[0].length;
|
|
1597
|
+
}
|
|
1598
|
+
push({
|
|
1599
|
+
type: 'text',
|
|
1600
|
+
value
|
|
1601
|
+
});
|
|
1602
|
+
continue;
|
|
1603
|
+
}
|
|
1604
|
+
/**
|
|
1605
|
+
* Stars
|
|
1606
|
+
*/ if (prev && ('globstar' === prev.type || true === prev.star)) {
|
|
1607
|
+
prev.type = 'star';
|
|
1608
|
+
prev.star = true;
|
|
1609
|
+
prev.value += value;
|
|
1610
|
+
prev.output = star;
|
|
1611
|
+
state.backtrack = true;
|
|
1612
|
+
state.globstar = true;
|
|
1613
|
+
consume(value);
|
|
1614
|
+
continue;
|
|
1615
|
+
}
|
|
1616
|
+
let rest = remaining();
|
|
1617
|
+
if (true !== opts.noextglob && /^\([^?]/.test(rest)) {
|
|
1618
|
+
extglobOpen('star', value);
|
|
1619
|
+
continue;
|
|
1620
|
+
}
|
|
1621
|
+
if ('star' === prev.type) {
|
|
1622
|
+
if (true === opts.noglobstar) {
|
|
1623
|
+
consume(value);
|
|
1624
|
+
continue;
|
|
1625
|
+
}
|
|
1626
|
+
const prior = prev.prev;
|
|
1627
|
+
const before = prior.prev;
|
|
1628
|
+
const isStart = 'slash' === prior.type || 'bos' === prior.type;
|
|
1629
|
+
const afterStar = before && ('star' === before.type || 'globstar' === before.type);
|
|
1630
|
+
if (true === opts.bash && (!isStart || rest[0] && '/' !== rest[0])) {
|
|
1631
|
+
push({
|
|
1632
|
+
type: 'star',
|
|
1633
|
+
value,
|
|
1634
|
+
output: ''
|
|
1635
|
+
});
|
|
1636
|
+
continue;
|
|
1637
|
+
}
|
|
1638
|
+
const isBrace = state.braces > 0 && ('comma' === prior.type || 'brace' === prior.type);
|
|
1639
|
+
const isExtglob = extglobs.length && ('pipe' === prior.type || 'paren' === prior.type);
|
|
1640
|
+
if (!isStart && 'paren' !== prior.type && !isBrace && !isExtglob) {
|
|
1641
|
+
push({
|
|
1642
|
+
type: 'star',
|
|
1643
|
+
value,
|
|
1644
|
+
output: ''
|
|
1645
|
+
});
|
|
1646
|
+
continue;
|
|
1647
|
+
}
|
|
1648
|
+
// strip consecutive `/**/`
|
|
1649
|
+
while('/**' === rest.slice(0, 3)){
|
|
1650
|
+
const after = input[state.index + 4];
|
|
1651
|
+
if (after && '/' !== after) break;
|
|
1652
|
+
rest = rest.slice(3);
|
|
1653
|
+
consume('/**', 3);
|
|
1654
|
+
}
|
|
1655
|
+
if ('bos' === prior.type && eos()) {
|
|
1656
|
+
prev.type = 'globstar';
|
|
1657
|
+
prev.value += value;
|
|
1658
|
+
prev.output = globstar(opts);
|
|
1659
|
+
state.output = prev.output;
|
|
1660
|
+
state.globstar = true;
|
|
1661
|
+
consume(value);
|
|
1662
|
+
continue;
|
|
1663
|
+
}
|
|
1664
|
+
if ('slash' === prior.type && 'bos' !== prior.prev.type && !afterStar && eos()) {
|
|
1665
|
+
state.output = state.output.slice(0, -(prior.output + prev.output).length);
|
|
1666
|
+
prior.output = `(?:${prior.output}`;
|
|
1667
|
+
prev.type = 'globstar';
|
|
1668
|
+
prev.output = globstar(opts) + (opts.strictSlashes ? ')' : '|$)');
|
|
1669
|
+
prev.value += value;
|
|
1670
|
+
state.globstar = true;
|
|
1671
|
+
state.output += prior.output + prev.output;
|
|
1672
|
+
consume(value);
|
|
1673
|
+
continue;
|
|
1674
|
+
}
|
|
1675
|
+
if ('slash' === prior.type && 'bos' !== prior.prev.type && '/' === rest[0]) {
|
|
1676
|
+
const end = void 0 !== rest[1] ? '|$' : '';
|
|
1677
|
+
state.output = state.output.slice(0, -(prior.output + prev.output).length);
|
|
1678
|
+
prior.output = `(?:${prior.output}`;
|
|
1679
|
+
prev.type = 'globstar';
|
|
1680
|
+
prev.output = `${globstar(opts)}${SLASH_LITERAL}|${SLASH_LITERAL}${end})`;
|
|
1681
|
+
prev.value += value;
|
|
1682
|
+
state.output += prior.output + prev.output;
|
|
1683
|
+
state.globstar = true;
|
|
1684
|
+
consume(value + advance());
|
|
1685
|
+
push({
|
|
1686
|
+
type: 'slash',
|
|
1687
|
+
value: '/',
|
|
1688
|
+
output: ''
|
|
1689
|
+
});
|
|
1690
|
+
continue;
|
|
1691
|
+
}
|
|
1692
|
+
if ('bos' === prior.type && '/' === rest[0]) {
|
|
1693
|
+
prev.type = 'globstar';
|
|
1694
|
+
prev.value += value;
|
|
1695
|
+
prev.output = `(?:^|${SLASH_LITERAL}|${globstar(opts)}${SLASH_LITERAL})`;
|
|
1696
|
+
state.output = prev.output;
|
|
1697
|
+
state.globstar = true;
|
|
1698
|
+
consume(value + advance());
|
|
1699
|
+
push({
|
|
1700
|
+
type: 'slash',
|
|
1701
|
+
value: '/',
|
|
1702
|
+
output: ''
|
|
1703
|
+
});
|
|
1704
|
+
continue;
|
|
1705
|
+
}
|
|
1706
|
+
// remove single star from output
|
|
1707
|
+
state.output = state.output.slice(0, -prev.output.length);
|
|
1708
|
+
// reset previous token to globstar
|
|
1709
|
+
prev.type = 'globstar';
|
|
1710
|
+
prev.output = globstar(opts);
|
|
1711
|
+
prev.value += value;
|
|
1712
|
+
// reset output with globstar
|
|
1713
|
+
state.output += prev.output;
|
|
1714
|
+
state.globstar = true;
|
|
1715
|
+
consume(value);
|
|
1716
|
+
continue;
|
|
1717
|
+
}
|
|
1718
|
+
const token = {
|
|
1719
|
+
type: 'star',
|
|
1720
|
+
value,
|
|
1721
|
+
output: star
|
|
1722
|
+
};
|
|
1723
|
+
if (true === opts.bash) {
|
|
1724
|
+
token.output = '.*?';
|
|
1725
|
+
if ('bos' === prev.type || 'slash' === prev.type) token.output = nodot + token.output;
|
|
1726
|
+
push(token);
|
|
1727
|
+
continue;
|
|
1728
|
+
}
|
|
1729
|
+
if (prev && ('bracket' === prev.type || 'paren' === prev.type) && true === opts.regex) {
|
|
1730
|
+
token.output = value;
|
|
1731
|
+
push(token);
|
|
1732
|
+
continue;
|
|
1733
|
+
}
|
|
1734
|
+
if (state.index === state.start || 'slash' === prev.type || 'dot' === prev.type) {
|
|
1735
|
+
if ('dot' === prev.type) {
|
|
1736
|
+
state.output += NO_DOT_SLASH;
|
|
1737
|
+
prev.output += NO_DOT_SLASH;
|
|
1738
|
+
} else if (true === opts.dot) {
|
|
1739
|
+
state.output += NO_DOTS_SLASH;
|
|
1740
|
+
prev.output += NO_DOTS_SLASH;
|
|
1741
|
+
} else {
|
|
1742
|
+
state.output += nodot;
|
|
1743
|
+
prev.output += nodot;
|
|
1744
|
+
}
|
|
1745
|
+
if ('*' !== peek()) {
|
|
1746
|
+
state.output += ONE_CHAR;
|
|
1747
|
+
prev.output += ONE_CHAR;
|
|
1748
|
+
}
|
|
1749
|
+
}
|
|
1750
|
+
push(token);
|
|
1751
|
+
}
|
|
1752
|
+
while(state.brackets > 0){
|
|
1753
|
+
if (true === opts.strictBrackets) throw new SyntaxError(syntaxError('closing', ']'));
|
|
1754
|
+
state.output = utils.escapeLast(state.output, '[');
|
|
1755
|
+
decrement('brackets');
|
|
1756
|
+
}
|
|
1757
|
+
while(state.parens > 0){
|
|
1758
|
+
if (true === opts.strictBrackets) throw new SyntaxError(syntaxError('closing', ')'));
|
|
1759
|
+
state.output = utils.escapeLast(state.output, '(');
|
|
1760
|
+
decrement('parens');
|
|
1761
|
+
}
|
|
1762
|
+
while(state.braces > 0){
|
|
1763
|
+
if (true === opts.strictBrackets) throw new SyntaxError(syntaxError('closing', '}'));
|
|
1764
|
+
state.output = utils.escapeLast(state.output, '{');
|
|
1765
|
+
decrement('braces');
|
|
1766
|
+
}
|
|
1767
|
+
if (true !== opts.strictSlashes && ('star' === prev.type || 'bracket' === prev.type)) push({
|
|
1768
|
+
type: 'maybe_slash',
|
|
1769
|
+
value: '',
|
|
1770
|
+
output: `${SLASH_LITERAL}?`
|
|
1771
|
+
});
|
|
1772
|
+
// rebuild the output if we had to backtrack at any point
|
|
1773
|
+
if (true === state.backtrack) {
|
|
1774
|
+
state.output = '';
|
|
1775
|
+
for (const token of state.tokens){
|
|
1776
|
+
state.output += null != token.output ? token.output : token.value;
|
|
1777
|
+
if (token.suffix) state.output += token.suffix;
|
|
1778
|
+
}
|
|
1779
|
+
}
|
|
1780
|
+
return state;
|
|
1781
|
+
};
|
|
1782
|
+
/**
|
|
1783
|
+
* Fast paths for creating regular expressions for common glob patterns.
|
|
1784
|
+
* This can significantly speed up processing and has very little downside
|
|
1785
|
+
* impact when none of the fast paths match.
|
|
1786
|
+
*/ parse.fastpaths = (input, options)=>{
|
|
1787
|
+
const opts = {
|
|
1788
|
+
...options
|
|
1789
|
+
};
|
|
1790
|
+
const max = 'number' == typeof opts.maxLength ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
|
|
1791
|
+
const len = input.length;
|
|
1792
|
+
if (len > max) throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
|
|
1793
|
+
input = REPLACEMENTS[input] || input;
|
|
1794
|
+
// create constants based on platform, for windows or posix
|
|
1795
|
+
const { DOT_LITERAL, SLASH_LITERAL, ONE_CHAR, DOTS_SLASH, NO_DOT, NO_DOTS, NO_DOTS_SLASH, STAR, START_ANCHOR } = constants.globChars(opts.windows);
|
|
1796
|
+
const nodot = opts.dot ? NO_DOTS : NO_DOT;
|
|
1797
|
+
const slashDot = opts.dot ? NO_DOTS_SLASH : NO_DOT;
|
|
1798
|
+
const capture = opts.capture ? '' : '?:';
|
|
1799
|
+
const state = {
|
|
1800
|
+
negated: false,
|
|
1801
|
+
prefix: ''
|
|
1802
|
+
};
|
|
1803
|
+
let star = true === opts.bash ? '.*?' : STAR;
|
|
1804
|
+
if (opts.capture) star = `(${star})`;
|
|
1805
|
+
const globstar = (opts)=>{
|
|
1806
|
+
if (true === opts.noglobstar) return star;
|
|
1807
|
+
return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
|
|
1808
|
+
};
|
|
1809
|
+
const create = (str)=>{
|
|
1810
|
+
switch(str){
|
|
1811
|
+
case '*':
|
|
1812
|
+
return `${nodot}${ONE_CHAR}${star}`;
|
|
1813
|
+
case '.*':
|
|
1814
|
+
return `${DOT_LITERAL}${ONE_CHAR}${star}`;
|
|
1815
|
+
case '*.*':
|
|
1816
|
+
return `${nodot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;
|
|
1817
|
+
case '*/*':
|
|
1818
|
+
return `${nodot}${star}${SLASH_LITERAL}${ONE_CHAR}${slashDot}${star}`;
|
|
1819
|
+
case '**':
|
|
1820
|
+
return nodot + globstar(opts);
|
|
1821
|
+
case '**/*':
|
|
1822
|
+
return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${ONE_CHAR}${star}`;
|
|
1823
|
+
case '**/*.*':
|
|
1824
|
+
return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;
|
|
1825
|
+
case '**/.*':
|
|
1826
|
+
return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${DOT_LITERAL}${ONE_CHAR}${star}`;
|
|
1827
|
+
default:
|
|
1828
|
+
{
|
|
1829
|
+
const match = /^(.*?)\.(\w+)$/.exec(str);
|
|
1830
|
+
if (!match) return;
|
|
1831
|
+
const source = create(match[1]);
|
|
1832
|
+
if (!source) return;
|
|
1833
|
+
return source + DOT_LITERAL + match[2];
|
|
1834
|
+
}
|
|
1835
|
+
}
|
|
1836
|
+
};
|
|
1837
|
+
const output = utils.removePrefix(input, state);
|
|
1838
|
+
let source = create(output);
|
|
1839
|
+
if (source && true !== opts.strictSlashes) source += `${SLASH_LITERAL}?`;
|
|
1840
|
+
return source;
|
|
1841
|
+
};
|
|
1842
|
+
module.exports = parse;
|
|
1843
|
+
},
|
|
1844
|
+
"./node_modules/.pnpm/picomatch@4.0.2/node_modules/picomatch/lib/picomatch.js": function(module, __unused_webpack_exports, __webpack_require__) {
|
|
1845
|
+
const scan = __webpack_require__("./node_modules/.pnpm/picomatch@4.0.2/node_modules/picomatch/lib/scan.js");
|
|
1846
|
+
const parse = __webpack_require__("./node_modules/.pnpm/picomatch@4.0.2/node_modules/picomatch/lib/parse.js");
|
|
1847
|
+
const utils = __webpack_require__("./node_modules/.pnpm/picomatch@4.0.2/node_modules/picomatch/lib/utils.js");
|
|
1848
|
+
const constants = __webpack_require__("./node_modules/.pnpm/picomatch@4.0.2/node_modules/picomatch/lib/constants.js");
|
|
1849
|
+
const isObject = (val)=>val && 'object' == typeof val && !Array.isArray(val);
|
|
1850
|
+
/**
|
|
1851
|
+
* Creates a matcher function from one or more glob patterns. The
|
|
1852
|
+
* returned function takes a string to match as its first argument,
|
|
1853
|
+
* and returns true if the string is a match. The returned matcher
|
|
1854
|
+
* function also takes a boolean as the second argument that, when true,
|
|
1855
|
+
* returns an object with additional information.
|
|
1856
|
+
*
|
|
1857
|
+
* ```js
|
|
1858
|
+
* const picomatch = require('picomatch');
|
|
1859
|
+
* // picomatch(glob[, options]);
|
|
1860
|
+
*
|
|
1861
|
+
* const isMatch = picomatch('*.!(*a)');
|
|
1862
|
+
* console.log(isMatch('a.a')); //=> false
|
|
1863
|
+
* console.log(isMatch('a.b')); //=> true
|
|
1864
|
+
* ```
|
|
1865
|
+
* @name picomatch
|
|
1866
|
+
* @param {String|Array} `globs` One or more glob patterns.
|
|
1867
|
+
* @param {Object=} `options`
|
|
1868
|
+
* @return {Function=} Returns a matcher function.
|
|
1869
|
+
* @api public
|
|
1870
|
+
*/ const picomatch = (glob, options, returnState = false)=>{
|
|
1871
|
+
if (Array.isArray(glob)) {
|
|
1872
|
+
const fns = glob.map((input)=>picomatch(input, options, returnState));
|
|
1873
|
+
const arrayMatcher = (str)=>{
|
|
1874
|
+
for (const isMatch of fns){
|
|
1875
|
+
const state = isMatch(str);
|
|
1876
|
+
if (state) return state;
|
|
1877
|
+
}
|
|
1878
|
+
return false;
|
|
1879
|
+
};
|
|
1880
|
+
return arrayMatcher;
|
|
1881
|
+
}
|
|
1882
|
+
const isState = isObject(glob) && glob.tokens && glob.input;
|
|
1883
|
+
if ('' === glob || 'string' != typeof glob && !isState) throw new TypeError('Expected pattern to be a non-empty string');
|
|
1884
|
+
const opts = options || {};
|
|
1885
|
+
const posix = opts.windows;
|
|
1886
|
+
const regex = isState ? picomatch.compileRe(glob, options) : picomatch.makeRe(glob, options, false, true);
|
|
1887
|
+
const state = regex.state;
|
|
1888
|
+
delete regex.state;
|
|
1889
|
+
let isIgnored = ()=>false;
|
|
1890
|
+
if (opts.ignore) {
|
|
1891
|
+
const ignoreOpts = {
|
|
1892
|
+
...options,
|
|
1893
|
+
ignore: null,
|
|
1894
|
+
onMatch: null,
|
|
1895
|
+
onResult: null
|
|
1896
|
+
};
|
|
1897
|
+
isIgnored = picomatch(opts.ignore, ignoreOpts, returnState);
|
|
1898
|
+
}
|
|
1899
|
+
const matcher = (input, returnObject = false)=>{
|
|
1900
|
+
const { isMatch, match, output } = picomatch.test(input, regex, options, {
|
|
1901
|
+
glob,
|
|
1902
|
+
posix
|
|
1903
|
+
});
|
|
1904
|
+
const result = {
|
|
1905
|
+
glob,
|
|
1906
|
+
state,
|
|
1907
|
+
regex,
|
|
1908
|
+
posix,
|
|
1909
|
+
input,
|
|
1910
|
+
output,
|
|
1911
|
+
match,
|
|
1912
|
+
isMatch
|
|
1913
|
+
};
|
|
1914
|
+
if ('function' == typeof opts.onResult) opts.onResult(result);
|
|
1915
|
+
if (false === isMatch) {
|
|
1916
|
+
result.isMatch = false;
|
|
1917
|
+
return !!returnObject && result;
|
|
1918
|
+
}
|
|
1919
|
+
if (isIgnored(input)) {
|
|
1920
|
+
if ('function' == typeof opts.onIgnore) opts.onIgnore(result);
|
|
1921
|
+
result.isMatch = false;
|
|
1922
|
+
return !!returnObject && result;
|
|
1923
|
+
}
|
|
1924
|
+
if ('function' == typeof opts.onMatch) opts.onMatch(result);
|
|
1925
|
+
return !returnObject || result;
|
|
1926
|
+
};
|
|
1927
|
+
if (returnState) matcher.state = state;
|
|
1928
|
+
return matcher;
|
|
1929
|
+
};
|
|
1930
|
+
/**
|
|
1931
|
+
* Test `input` with the given `regex`. This is used by the main
|
|
1932
|
+
* `picomatch()` function to test the input string.
|
|
1933
|
+
*
|
|
1934
|
+
* ```js
|
|
1935
|
+
* const picomatch = require('picomatch');
|
|
1936
|
+
* // picomatch.test(input, regex[, options]);
|
|
1937
|
+
*
|
|
1938
|
+
* console.log(picomatch.test('foo/bar', /^(?:([^/]*?)\/([^/]*?))$/));
|
|
1939
|
+
* // { isMatch: true, match: [ 'foo/', 'foo', 'bar' ], output: 'foo/bar' }
|
|
1940
|
+
* ```
|
|
1941
|
+
* @param {String} `input` String to test.
|
|
1942
|
+
* @param {RegExp} `regex`
|
|
1943
|
+
* @return {Object} Returns an object with matching info.
|
|
1944
|
+
* @api public
|
|
1945
|
+
*/ picomatch.test = (input, regex, options, { glob, posix } = {})=>{
|
|
1946
|
+
if ('string' != typeof input) throw new TypeError('Expected input to be a string');
|
|
1947
|
+
if ('' === input) return {
|
|
1948
|
+
isMatch: false,
|
|
1949
|
+
output: ''
|
|
1950
|
+
};
|
|
1951
|
+
const opts = options || {};
|
|
1952
|
+
const format = opts.format || (posix ? utils.toPosixSlashes : null);
|
|
1953
|
+
let match = input === glob;
|
|
1954
|
+
let output = match && format ? format(input) : input;
|
|
1955
|
+
if (false === match) {
|
|
1956
|
+
output = format ? format(input) : input;
|
|
1957
|
+
match = output === glob;
|
|
1958
|
+
}
|
|
1959
|
+
if (false === match || true === opts.capture) match = true === opts.matchBase || true === opts.basename ? picomatch.matchBase(input, regex, options, posix) : regex.exec(output);
|
|
1960
|
+
return {
|
|
1961
|
+
isMatch: Boolean(match),
|
|
1962
|
+
match,
|
|
1963
|
+
output
|
|
1964
|
+
};
|
|
1965
|
+
};
|
|
1966
|
+
/**
|
|
1967
|
+
* Match the basename of a filepath.
|
|
1968
|
+
*
|
|
1969
|
+
* ```js
|
|
1970
|
+
* const picomatch = require('picomatch');
|
|
1971
|
+
* // picomatch.matchBase(input, glob[, options]);
|
|
1972
|
+
* console.log(picomatch.matchBase('foo/bar.js', '*.js'); // true
|
|
1973
|
+
* ```
|
|
1974
|
+
* @param {String} `input` String to test.
|
|
1975
|
+
* @param {RegExp|String} `glob` Glob pattern or regex created by [.makeRe](#makeRe).
|
|
1976
|
+
* @return {Boolean}
|
|
1977
|
+
* @api public
|
|
1978
|
+
*/ picomatch.matchBase = (input, glob, options)=>{
|
|
1979
|
+
const regex = glob instanceof RegExp ? glob : picomatch.makeRe(glob, options);
|
|
1980
|
+
return regex.test(utils.basename(input));
|
|
1981
|
+
};
|
|
1982
|
+
/**
|
|
1983
|
+
* Returns true if **any** of the given glob `patterns` match the specified `string`.
|
|
1984
|
+
*
|
|
1985
|
+
* ```js
|
|
1986
|
+
* const picomatch = require('picomatch');
|
|
1987
|
+
* // picomatch.isMatch(string, patterns[, options]);
|
|
1988
|
+
*
|
|
1989
|
+
* console.log(picomatch.isMatch('a.a', ['b.*', '*.a'])); //=> true
|
|
1990
|
+
* console.log(picomatch.isMatch('a.a', 'b.*')); //=> false
|
|
1991
|
+
* ```
|
|
1992
|
+
* @param {String|Array} str The string to test.
|
|
1993
|
+
* @param {String|Array} patterns One or more glob patterns to use for matching.
|
|
1994
|
+
* @param {Object} [options] See available [options](#options).
|
|
1995
|
+
* @return {Boolean} Returns true if any patterns match `str`
|
|
1996
|
+
* @api public
|
|
1997
|
+
*/ picomatch.isMatch = (str, patterns, options)=>picomatch(patterns, options)(str);
|
|
1998
|
+
/**
|
|
1999
|
+
* Parse a glob pattern to create the source string for a regular
|
|
2000
|
+
* expression.
|
|
2001
|
+
*
|
|
2002
|
+
* ```js
|
|
2003
|
+
* const picomatch = require('picomatch');
|
|
2004
|
+
* const result = picomatch.parse(pattern[, options]);
|
|
2005
|
+
* ```
|
|
2006
|
+
* @param {String} `pattern`
|
|
2007
|
+
* @param {Object} `options`
|
|
2008
|
+
* @return {Object} Returns an object with useful properties and output to be used as a regex source string.
|
|
2009
|
+
* @api public
|
|
2010
|
+
*/ picomatch.parse = (pattern, options)=>{
|
|
2011
|
+
if (Array.isArray(pattern)) return pattern.map((p)=>picomatch.parse(p, options));
|
|
2012
|
+
return parse(pattern, {
|
|
2013
|
+
...options,
|
|
2014
|
+
fastpaths: false
|
|
2015
|
+
});
|
|
2016
|
+
};
|
|
2017
|
+
/**
|
|
2018
|
+
* Scan a glob pattern to separate the pattern into segments.
|
|
2019
|
+
*
|
|
2020
|
+
* ```js
|
|
2021
|
+
* const picomatch = require('picomatch');
|
|
2022
|
+
* // picomatch.scan(input[, options]);
|
|
2023
|
+
*
|
|
2024
|
+
* const result = picomatch.scan('!./foo/*.js');
|
|
2025
|
+
* console.log(result);
|
|
2026
|
+
* { prefix: '!./',
|
|
2027
|
+
* input: '!./foo/*.js',
|
|
2028
|
+
* start: 3,
|
|
2029
|
+
* base: 'foo',
|
|
2030
|
+
* glob: '*.js',
|
|
2031
|
+
* isBrace: false,
|
|
2032
|
+
* isBracket: false,
|
|
2033
|
+
* isGlob: true,
|
|
2034
|
+
* isExtglob: false,
|
|
2035
|
+
* isGlobstar: false,
|
|
2036
|
+
* negated: true }
|
|
2037
|
+
* ```
|
|
2038
|
+
* @param {String} `input` Glob pattern to scan.
|
|
2039
|
+
* @param {Object} `options`
|
|
2040
|
+
* @return {Object} Returns an object with
|
|
2041
|
+
* @api public
|
|
2042
|
+
*/ picomatch.scan = (input, options)=>scan(input, options);
|
|
2043
|
+
/**
|
|
2044
|
+
* Compile a regular expression from the `state` object returned by the
|
|
2045
|
+
* [parse()](#parse) method.
|
|
2046
|
+
*
|
|
2047
|
+
* @param {Object} `state`
|
|
2048
|
+
* @param {Object} `options`
|
|
2049
|
+
* @param {Boolean} `returnOutput` Intended for implementors, this argument allows you to return the raw output from the parser.
|
|
2050
|
+
* @param {Boolean} `returnState` Adds the state to a `state` property on the returned regex. Useful for implementors and debugging.
|
|
2051
|
+
* @return {RegExp}
|
|
2052
|
+
* @api public
|
|
2053
|
+
*/ picomatch.compileRe = (state, options, returnOutput = false, returnState = false)=>{
|
|
2054
|
+
if (true === returnOutput) return state.output;
|
|
2055
|
+
const opts = options || {};
|
|
2056
|
+
const prepend = opts.contains ? '' : '^';
|
|
2057
|
+
const append = opts.contains ? '' : '$';
|
|
2058
|
+
let source = `${prepend}(?:${state.output})${append}`;
|
|
2059
|
+
if (state && true === state.negated) source = `^(?!${source}).*$`;
|
|
2060
|
+
const regex = picomatch.toRegex(source, options);
|
|
2061
|
+
if (true === returnState) regex.state = state;
|
|
2062
|
+
return regex;
|
|
2063
|
+
};
|
|
2064
|
+
/**
|
|
2065
|
+
* Create a regular expression from a parsed glob pattern.
|
|
2066
|
+
*
|
|
2067
|
+
* ```js
|
|
2068
|
+
* const picomatch = require('picomatch');
|
|
2069
|
+
* const state = picomatch.parse('*.js');
|
|
2070
|
+
* // picomatch.compileRe(state[, options]);
|
|
2071
|
+
*
|
|
2072
|
+
* console.log(picomatch.compileRe(state));
|
|
2073
|
+
* //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/
|
|
2074
|
+
* ```
|
|
2075
|
+
* @param {String} `state` The object returned from the `.parse` method.
|
|
2076
|
+
* @param {Object} `options`
|
|
2077
|
+
* @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.
|
|
2078
|
+
* @param {Boolean} `returnState` Implementors may use this argument to return the state from the parsed glob with the returned regular expression.
|
|
2079
|
+
* @return {RegExp} Returns a regex created from the given pattern.
|
|
2080
|
+
* @api public
|
|
2081
|
+
*/ picomatch.makeRe = (input, options = {}, returnOutput = false, returnState = false)=>{
|
|
2082
|
+
if (!input || 'string' != typeof input) throw new TypeError('Expected a non-empty string');
|
|
2083
|
+
let parsed = {
|
|
2084
|
+
negated: false,
|
|
2085
|
+
fastpaths: true
|
|
2086
|
+
};
|
|
2087
|
+
if (false !== options.fastpaths && ('.' === input[0] || '*' === input[0])) parsed.output = parse.fastpaths(input, options);
|
|
2088
|
+
if (!parsed.output) parsed = parse(input, options);
|
|
2089
|
+
return picomatch.compileRe(parsed, options, returnOutput, returnState);
|
|
2090
|
+
};
|
|
2091
|
+
/**
|
|
2092
|
+
* Create a regular expression from the given regex source string.
|
|
2093
|
+
*
|
|
2094
|
+
* ```js
|
|
2095
|
+
* const picomatch = require('picomatch');
|
|
2096
|
+
* // picomatch.toRegex(source[, options]);
|
|
2097
|
+
*
|
|
2098
|
+
* const { output } = picomatch.parse('*.js');
|
|
2099
|
+
* console.log(picomatch.toRegex(output));
|
|
2100
|
+
* //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/
|
|
2101
|
+
* ```
|
|
2102
|
+
* @param {String} `source` Regular expression source string.
|
|
2103
|
+
* @param {Object} `options`
|
|
2104
|
+
* @return {RegExp}
|
|
2105
|
+
* @api public
|
|
2106
|
+
*/ picomatch.toRegex = (source, options)=>{
|
|
2107
|
+
try {
|
|
2108
|
+
const opts = options || {};
|
|
2109
|
+
return new RegExp(source, opts.flags || (opts.nocase ? 'i' : ''));
|
|
2110
|
+
} catch (err) {
|
|
2111
|
+
if (options && true === options.debug) throw err;
|
|
2112
|
+
return /$^/;
|
|
2113
|
+
}
|
|
2114
|
+
};
|
|
2115
|
+
/**
|
|
2116
|
+
* Picomatch constants.
|
|
2117
|
+
* @return {Object}
|
|
2118
|
+
*/ picomatch.constants = constants;
|
|
2119
|
+
/**
|
|
2120
|
+
* Expose "picomatch"
|
|
2121
|
+
*/ module.exports = picomatch;
|
|
2122
|
+
},
|
|
2123
|
+
"./node_modules/.pnpm/picomatch@4.0.2/node_modules/picomatch/lib/scan.js": function(module, __unused_webpack_exports, __webpack_require__) {
|
|
2124
|
+
const utils = __webpack_require__("./node_modules/.pnpm/picomatch@4.0.2/node_modules/picomatch/lib/utils.js");
|
|
2125
|
+
const { CHAR_ASTERISK, /* * */ CHAR_AT, /* @ */ CHAR_BACKWARD_SLASH, /* \ */ CHAR_COMMA, /* , */ CHAR_DOT, /* . */ CHAR_EXCLAMATION_MARK, /* ! */ CHAR_FORWARD_SLASH, /* / */ CHAR_LEFT_CURLY_BRACE, /* { */ CHAR_LEFT_PARENTHESES, /* ( */ CHAR_LEFT_SQUARE_BRACKET, /* [ */ CHAR_PLUS, /* + */ CHAR_QUESTION_MARK, /* ? */ CHAR_RIGHT_CURLY_BRACE, /* } */ CHAR_RIGHT_PARENTHESES, /* ) */ CHAR_RIGHT_SQUARE_BRACKET/* ] */ } = __webpack_require__("./node_modules/.pnpm/picomatch@4.0.2/node_modules/picomatch/lib/constants.js");
|
|
2126
|
+
const isPathSeparator = (code)=>code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH;
|
|
2127
|
+
const depth = (token)=>{
|
|
2128
|
+
if (true !== token.isPrefix) token.depth = token.isGlobstar ? 1 / 0 : 1;
|
|
2129
|
+
};
|
|
2130
|
+
/**
|
|
2131
|
+
* Quickly scans a glob pattern and returns an object with a handful of
|
|
2132
|
+
* useful properties, like `isGlob`, `path` (the leading non-glob, if it exists),
|
|
2133
|
+
* `glob` (the actual pattern), `negated` (true if the path starts with `!` but not
|
|
2134
|
+
* with `!(`) and `negatedExtglob` (true if the path starts with `!(`).
|
|
2135
|
+
*
|
|
2136
|
+
* ```js
|
|
2137
|
+
* const pm = require('picomatch');
|
|
2138
|
+
* console.log(pm.scan('foo/bar/*.js'));
|
|
2139
|
+
* { isGlob: true, input: 'foo/bar/*.js', base: 'foo/bar', glob: '*.js' }
|
|
2140
|
+
* ```
|
|
2141
|
+
* @param {String} `str`
|
|
2142
|
+
* @param {Object} `options`
|
|
2143
|
+
* @return {Object} Returns an object with tokens and regex source string.
|
|
2144
|
+
* @api public
|
|
2145
|
+
*/ const scan = (input, options)=>{
|
|
2146
|
+
const opts = options || {};
|
|
2147
|
+
const length = input.length - 1;
|
|
2148
|
+
const scanToEnd = true === opts.parts || true === opts.scanToEnd;
|
|
2149
|
+
const slashes = [];
|
|
2150
|
+
const tokens = [];
|
|
2151
|
+
const parts = [];
|
|
2152
|
+
let str = input;
|
|
2153
|
+
let index = -1;
|
|
2154
|
+
let start = 0;
|
|
2155
|
+
let lastIndex = 0;
|
|
2156
|
+
let isBrace = false;
|
|
2157
|
+
let isBracket = false;
|
|
2158
|
+
let isGlob = false;
|
|
2159
|
+
let isExtglob = false;
|
|
2160
|
+
let isGlobstar = false;
|
|
2161
|
+
let braceEscaped = false;
|
|
2162
|
+
let backslashes = false;
|
|
2163
|
+
let negated = false;
|
|
2164
|
+
let negatedExtglob = false;
|
|
2165
|
+
let finished = false;
|
|
2166
|
+
let braces = 0;
|
|
2167
|
+
let prev;
|
|
2168
|
+
let code;
|
|
2169
|
+
let token = {
|
|
2170
|
+
value: '',
|
|
2171
|
+
depth: 0,
|
|
2172
|
+
isGlob: false
|
|
2173
|
+
};
|
|
2174
|
+
const eos = ()=>index >= length;
|
|
2175
|
+
const peek = ()=>str.charCodeAt(index + 1);
|
|
2176
|
+
const advance = ()=>{
|
|
2177
|
+
prev = code;
|
|
2178
|
+
return str.charCodeAt(++index);
|
|
2179
|
+
};
|
|
2180
|
+
while(index < length){
|
|
2181
|
+
code = advance();
|
|
2182
|
+
let next;
|
|
2183
|
+
if (code === CHAR_BACKWARD_SLASH) {
|
|
2184
|
+
backslashes = token.backslashes = true;
|
|
2185
|
+
code = advance();
|
|
2186
|
+
if (code === CHAR_LEFT_CURLY_BRACE) braceEscaped = true;
|
|
2187
|
+
continue;
|
|
2188
|
+
}
|
|
2189
|
+
if (true === braceEscaped || code === CHAR_LEFT_CURLY_BRACE) {
|
|
2190
|
+
braces++;
|
|
2191
|
+
while(true !== eos() && (code = advance())){
|
|
2192
|
+
if (code === CHAR_BACKWARD_SLASH) {
|
|
2193
|
+
backslashes = token.backslashes = true;
|
|
2194
|
+
advance();
|
|
2195
|
+
continue;
|
|
2196
|
+
}
|
|
2197
|
+
if (code === CHAR_LEFT_CURLY_BRACE) {
|
|
2198
|
+
braces++;
|
|
2199
|
+
continue;
|
|
2200
|
+
}
|
|
2201
|
+
if (true !== braceEscaped && code === CHAR_DOT && (code = advance()) === CHAR_DOT) {
|
|
2202
|
+
isBrace = token.isBrace = true;
|
|
2203
|
+
isGlob = token.isGlob = true;
|
|
2204
|
+
finished = true;
|
|
2205
|
+
if (true === scanToEnd) continue;
|
|
2206
|
+
break;
|
|
2207
|
+
}
|
|
2208
|
+
if (true !== braceEscaped && code === CHAR_COMMA) {
|
|
2209
|
+
isBrace = token.isBrace = true;
|
|
2210
|
+
isGlob = token.isGlob = true;
|
|
2211
|
+
finished = true;
|
|
2212
|
+
if (true === scanToEnd) continue;
|
|
2213
|
+
break;
|
|
2214
|
+
}
|
|
2215
|
+
if (code === CHAR_RIGHT_CURLY_BRACE) {
|
|
2216
|
+
braces--;
|
|
2217
|
+
if (0 === braces) {
|
|
2218
|
+
braceEscaped = false;
|
|
2219
|
+
isBrace = token.isBrace = true;
|
|
2220
|
+
finished = true;
|
|
2221
|
+
break;
|
|
2222
|
+
}
|
|
2223
|
+
}
|
|
2224
|
+
}
|
|
2225
|
+
if (true === scanToEnd) continue;
|
|
2226
|
+
break;
|
|
2227
|
+
}
|
|
2228
|
+
if (code === CHAR_FORWARD_SLASH) {
|
|
2229
|
+
slashes.push(index);
|
|
2230
|
+
tokens.push(token);
|
|
2231
|
+
token = {
|
|
2232
|
+
value: '',
|
|
2233
|
+
depth: 0,
|
|
2234
|
+
isGlob: false
|
|
2235
|
+
};
|
|
2236
|
+
if (true === finished) continue;
|
|
2237
|
+
if (prev === CHAR_DOT && index === start + 1) {
|
|
2238
|
+
start += 2;
|
|
2239
|
+
continue;
|
|
2240
|
+
}
|
|
2241
|
+
lastIndex = index + 1;
|
|
2242
|
+
continue;
|
|
2243
|
+
}
|
|
2244
|
+
if (true !== opts.noext) {
|
|
2245
|
+
const isExtglobChar = code === CHAR_PLUS || code === CHAR_AT || code === CHAR_ASTERISK || code === CHAR_QUESTION_MARK || code === CHAR_EXCLAMATION_MARK;
|
|
2246
|
+
if (true === isExtglobChar && peek() === CHAR_LEFT_PARENTHESES) {
|
|
2247
|
+
isGlob = token.isGlob = true;
|
|
2248
|
+
isExtglob = token.isExtglob = true;
|
|
2249
|
+
finished = true;
|
|
2250
|
+
if (code === CHAR_EXCLAMATION_MARK && index === start) negatedExtglob = true;
|
|
2251
|
+
if (true === scanToEnd) {
|
|
2252
|
+
while(true !== eos() && (code = advance())){
|
|
2253
|
+
if (code === CHAR_BACKWARD_SLASH) {
|
|
2254
|
+
backslashes = token.backslashes = true;
|
|
2255
|
+
code = advance();
|
|
2256
|
+
continue;
|
|
2257
|
+
}
|
|
2258
|
+
if (code === CHAR_RIGHT_PARENTHESES) {
|
|
2259
|
+
isGlob = token.isGlob = true;
|
|
2260
|
+
finished = true;
|
|
2261
|
+
break;
|
|
2262
|
+
}
|
|
2263
|
+
}
|
|
2264
|
+
continue;
|
|
2265
|
+
}
|
|
2266
|
+
break;
|
|
2267
|
+
}
|
|
2268
|
+
}
|
|
2269
|
+
if (code === CHAR_ASTERISK) {
|
|
2270
|
+
if (prev === CHAR_ASTERISK) isGlobstar = token.isGlobstar = true;
|
|
2271
|
+
isGlob = token.isGlob = true;
|
|
2272
|
+
finished = true;
|
|
2273
|
+
if (true === scanToEnd) continue;
|
|
2274
|
+
break;
|
|
2275
|
+
}
|
|
2276
|
+
if (code === CHAR_QUESTION_MARK) {
|
|
2277
|
+
isGlob = token.isGlob = true;
|
|
2278
|
+
finished = true;
|
|
2279
|
+
if (true === scanToEnd) continue;
|
|
2280
|
+
break;
|
|
2281
|
+
}
|
|
2282
|
+
if (code === CHAR_LEFT_SQUARE_BRACKET) {
|
|
2283
|
+
while(true !== eos() && (next = advance())){
|
|
2284
|
+
if (next === CHAR_BACKWARD_SLASH) {
|
|
2285
|
+
backslashes = token.backslashes = true;
|
|
2286
|
+
advance();
|
|
2287
|
+
continue;
|
|
2288
|
+
}
|
|
2289
|
+
if (next === CHAR_RIGHT_SQUARE_BRACKET) {
|
|
2290
|
+
isBracket = token.isBracket = true;
|
|
2291
|
+
isGlob = token.isGlob = true;
|
|
2292
|
+
finished = true;
|
|
2293
|
+
break;
|
|
2294
|
+
}
|
|
2295
|
+
}
|
|
2296
|
+
if (true === scanToEnd) continue;
|
|
2297
|
+
break;
|
|
2298
|
+
}
|
|
2299
|
+
if (true !== opts.nonegate && code === CHAR_EXCLAMATION_MARK && index === start) {
|
|
2300
|
+
negated = token.negated = true;
|
|
2301
|
+
start++;
|
|
2302
|
+
continue;
|
|
2303
|
+
}
|
|
2304
|
+
if (true !== opts.noparen && code === CHAR_LEFT_PARENTHESES) {
|
|
2305
|
+
isGlob = token.isGlob = true;
|
|
2306
|
+
if (true === scanToEnd) {
|
|
2307
|
+
while(true !== eos() && (code = advance())){
|
|
2308
|
+
if (code === CHAR_LEFT_PARENTHESES) {
|
|
2309
|
+
backslashes = token.backslashes = true;
|
|
2310
|
+
code = advance();
|
|
2311
|
+
continue;
|
|
2312
|
+
}
|
|
2313
|
+
if (code === CHAR_RIGHT_PARENTHESES) {
|
|
2314
|
+
finished = true;
|
|
2315
|
+
break;
|
|
2316
|
+
}
|
|
2317
|
+
}
|
|
2318
|
+
continue;
|
|
2319
|
+
}
|
|
2320
|
+
break;
|
|
2321
|
+
}
|
|
2322
|
+
if (true === isGlob) {
|
|
2323
|
+
finished = true;
|
|
2324
|
+
if (true === scanToEnd) continue;
|
|
2325
|
+
break;
|
|
2326
|
+
}
|
|
2327
|
+
}
|
|
2328
|
+
if (true === opts.noext) {
|
|
2329
|
+
isExtglob = false;
|
|
2330
|
+
isGlob = false;
|
|
2331
|
+
}
|
|
2332
|
+
let base = str;
|
|
2333
|
+
let prefix = '';
|
|
2334
|
+
let glob = '';
|
|
2335
|
+
if (start > 0) {
|
|
2336
|
+
prefix = str.slice(0, start);
|
|
2337
|
+
str = str.slice(start);
|
|
2338
|
+
lastIndex -= start;
|
|
2339
|
+
}
|
|
2340
|
+
if (base && true === isGlob && lastIndex > 0) {
|
|
2341
|
+
base = str.slice(0, lastIndex);
|
|
2342
|
+
glob = str.slice(lastIndex);
|
|
2343
|
+
} else if (true === isGlob) {
|
|
2344
|
+
base = '';
|
|
2345
|
+
glob = str;
|
|
2346
|
+
} else base = str;
|
|
2347
|
+
if (base && '' !== base && '/' !== base && base !== str) {
|
|
2348
|
+
if (isPathSeparator(base.charCodeAt(base.length - 1))) base = base.slice(0, -1);
|
|
2349
|
+
}
|
|
2350
|
+
if (true === opts.unescape) {
|
|
2351
|
+
if (glob) glob = utils.removeBackslashes(glob);
|
|
2352
|
+
if (base && true === backslashes) base = utils.removeBackslashes(base);
|
|
2353
|
+
}
|
|
2354
|
+
const state = {
|
|
2355
|
+
prefix,
|
|
2356
|
+
input,
|
|
2357
|
+
start,
|
|
2358
|
+
base,
|
|
2359
|
+
glob,
|
|
2360
|
+
isBrace,
|
|
2361
|
+
isBracket,
|
|
2362
|
+
isGlob,
|
|
2363
|
+
isExtglob,
|
|
2364
|
+
isGlobstar,
|
|
2365
|
+
negated,
|
|
2366
|
+
negatedExtglob
|
|
2367
|
+
};
|
|
2368
|
+
if (true === opts.tokens) {
|
|
2369
|
+
state.maxDepth = 0;
|
|
2370
|
+
if (!isPathSeparator(code)) tokens.push(token);
|
|
2371
|
+
state.tokens = tokens;
|
|
2372
|
+
}
|
|
2373
|
+
if (true === opts.parts || true === opts.tokens) {
|
|
2374
|
+
let prevIndex;
|
|
2375
|
+
for(let idx = 0; idx < slashes.length; idx++){
|
|
2376
|
+
const n = prevIndex ? prevIndex + 1 : start;
|
|
2377
|
+
const i = slashes[idx];
|
|
2378
|
+
const value = input.slice(n, i);
|
|
2379
|
+
if (opts.tokens) {
|
|
2380
|
+
if (0 === idx && 0 !== start) {
|
|
2381
|
+
tokens[idx].isPrefix = true;
|
|
2382
|
+
tokens[idx].value = prefix;
|
|
2383
|
+
} else tokens[idx].value = value;
|
|
2384
|
+
depth(tokens[idx]);
|
|
2385
|
+
state.maxDepth += tokens[idx].depth;
|
|
2386
|
+
}
|
|
2387
|
+
if (0 !== idx || '' !== value) parts.push(value);
|
|
2388
|
+
prevIndex = i;
|
|
2389
|
+
}
|
|
2390
|
+
if (prevIndex && prevIndex + 1 < input.length) {
|
|
2391
|
+
const value = input.slice(prevIndex + 1);
|
|
2392
|
+
parts.push(value);
|
|
2393
|
+
if (opts.tokens) {
|
|
2394
|
+
tokens[tokens.length - 1].value = value;
|
|
2395
|
+
depth(tokens[tokens.length - 1]);
|
|
2396
|
+
state.maxDepth += tokens[tokens.length - 1].depth;
|
|
2397
|
+
}
|
|
2398
|
+
}
|
|
2399
|
+
state.slashes = slashes;
|
|
2400
|
+
state.parts = parts;
|
|
2401
|
+
}
|
|
2402
|
+
return state;
|
|
2403
|
+
};
|
|
2404
|
+
module.exports = scan;
|
|
2405
|
+
},
|
|
2406
|
+
"./node_modules/.pnpm/picomatch@4.0.2/node_modules/picomatch/lib/utils.js": function(__unused_webpack_module, exports, __webpack_require__) {
|
|
2407
|
+
/*global navigator*/ const { REGEX_BACKSLASH, REGEX_REMOVE_BACKSLASH, REGEX_SPECIAL_CHARS, REGEX_SPECIAL_CHARS_GLOBAL } = __webpack_require__("./node_modules/.pnpm/picomatch@4.0.2/node_modules/picomatch/lib/constants.js");
|
|
2408
|
+
exports.isObject = (val)=>null !== val && 'object' == typeof val && !Array.isArray(val);
|
|
2409
|
+
exports.hasRegexChars = (str)=>REGEX_SPECIAL_CHARS.test(str);
|
|
2410
|
+
exports.isRegexChar = (str)=>1 === str.length && exports.hasRegexChars(str);
|
|
2411
|
+
exports.escapeRegex = (str)=>str.replace(REGEX_SPECIAL_CHARS_GLOBAL, '\\$1');
|
|
2412
|
+
exports.toPosixSlashes = (str)=>str.replace(REGEX_BACKSLASH, '/');
|
|
2413
|
+
exports.isWindows = ()=>{
|
|
2414
|
+
if ('undefined' != typeof navigator && navigator.platform) {
|
|
2415
|
+
const platform = navigator.platform.toLowerCase();
|
|
2416
|
+
return 'win32' === platform || 'windows' === platform;
|
|
2417
|
+
}
|
|
2418
|
+
if ('undefined' != typeof process && process.platform) return 'win32' === process.platform;
|
|
2419
|
+
return false;
|
|
2420
|
+
};
|
|
2421
|
+
exports.removeBackslashes = (str)=>str.replace(REGEX_REMOVE_BACKSLASH, (match)=>'\\' === match ? '' : match);
|
|
2422
|
+
exports.escapeLast = (input, char, lastIdx)=>{
|
|
2423
|
+
const idx = input.lastIndexOf(char, lastIdx);
|
|
2424
|
+
if (-1 === idx) return input;
|
|
2425
|
+
if ('\\' === input[idx - 1]) return exports.escapeLast(input, char, idx - 1);
|
|
2426
|
+
return `${input.slice(0, idx)}\\${input.slice(idx)}`;
|
|
2427
|
+
};
|
|
2428
|
+
exports.removePrefix = (input, state = {})=>{
|
|
2429
|
+
let output = input;
|
|
2430
|
+
if (output.startsWith('./')) {
|
|
2431
|
+
output = output.slice(2);
|
|
2432
|
+
state.prefix = './';
|
|
2433
|
+
}
|
|
2434
|
+
return output;
|
|
2435
|
+
};
|
|
2436
|
+
exports.wrapOutput = (input, state = {}, options = {})=>{
|
|
2437
|
+
const prepend = options.contains ? '' : '^';
|
|
2438
|
+
const append = options.contains ? '' : '$';
|
|
2439
|
+
let output = `${prepend}(?:${input})${append}`;
|
|
2440
|
+
if (true === state.negated) output = `(?:^(?!${output}).*$)`;
|
|
2441
|
+
return output;
|
|
2442
|
+
};
|
|
2443
|
+
exports.basename = (path, { windows } = {})=>{
|
|
2444
|
+
const segs = path.split(windows ? /[\\/]/ : '/');
|
|
2445
|
+
const last = segs[segs.length - 1];
|
|
2446
|
+
if ('' === last) return segs[segs.length - 2];
|
|
2447
|
+
return last;
|
|
2448
|
+
};
|
|
2449
|
+
},
|
|
2450
|
+
fs: function(module) {
|
|
2451
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE_fs__;
|
|
2452
|
+
},
|
|
2453
|
+
path: function(module) {
|
|
2454
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE_path__;
|
|
2455
|
+
}
|
|
2456
|
+
};
|
|
2457
|
+
/************************************************************************/ // The module cache
|
|
2458
|
+
var __webpack_module_cache__ = {};
|
|
2459
|
+
// The require function
|
|
2460
|
+
function __webpack_require__(moduleId) {
|
|
2461
|
+
// Check if module is in cache
|
|
2462
|
+
var cachedModule = __webpack_module_cache__[moduleId];
|
|
2463
|
+
if (void 0 !== cachedModule) return cachedModule.exports;
|
|
2464
|
+
// Create a new module (and put it into the cache)
|
|
2465
|
+
var module = __webpack_module_cache__[moduleId] = {
|
|
2466
|
+
exports: {}
|
|
2467
|
+
};
|
|
2468
|
+
// Execute the module function
|
|
2469
|
+
__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
|
2470
|
+
// Return the exports of the module
|
|
2471
|
+
return module.exports;
|
|
2472
|
+
}
|
|
2473
|
+
/************************************************************************/ // webpack/runtime/compat_get_default_export
|
|
2474
|
+
(()=>{
|
|
2475
|
+
// getDefaultExport function for compatibility with non-ESM modules
|
|
2476
|
+
__webpack_require__.n = function(module) {
|
|
2477
|
+
var getter = module && module.__esModule ? function() {
|
|
2478
|
+
return module['default'];
|
|
2479
|
+
} : function() {
|
|
2480
|
+
return module;
|
|
2481
|
+
};
|
|
2482
|
+
__webpack_require__.d(getter, {
|
|
2483
|
+
a: getter
|
|
2484
|
+
});
|
|
2485
|
+
return getter;
|
|
2486
|
+
};
|
|
2487
|
+
})();
|
|
2488
|
+
// webpack/runtime/define_property_getters
|
|
2489
|
+
(()=>{
|
|
2490
|
+
__webpack_require__.d = function(exports, definition) {
|
|
2491
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) Object.defineProperty(exports, key, {
|
|
2492
|
+
enumerable: true,
|
|
2493
|
+
get: definition[key]
|
|
2494
|
+
});
|
|
2495
|
+
};
|
|
2496
|
+
})();
|
|
2497
|
+
// webpack/runtime/has_own_property
|
|
2498
|
+
(()=>{
|
|
2499
|
+
__webpack_require__.o = function(obj, prop) {
|
|
2500
|
+
return Object.prototype.hasOwnProperty.call(obj, prop);
|
|
2501
|
+
};
|
|
2502
|
+
})();
|
|
2503
|
+
// EXTERNAL MODULE: ./node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js
|
|
2504
|
+
var picocolors = __webpack_require__("./node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js");
|
|
2505
|
+
var picocolors_default = /*#__PURE__*/ __webpack_require__.n(picocolors);
|
|
2506
|
+
// node_modules/.pnpm/supports-color@9.4.0/node_modules/supports-color/index.js
|
|
2507
|
+
function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : __WEBPACK_EXTERNAL_MODULE_process__["default"].argv) {
|
|
2508
|
+
const prefix = flag.startsWith("-") ? "" : 1 === flag.length ? "-" : "--";
|
|
2509
|
+
const position = argv.indexOf(prefix + flag);
|
|
2510
|
+
const terminatorPosition = argv.indexOf("--");
|
|
2511
|
+
return -1 !== position && (-1 === terminatorPosition || position < terminatorPosition);
|
|
2512
|
+
}
|
|
2513
|
+
var { env } = __WEBPACK_EXTERNAL_MODULE_process__["default"];
|
|
2514
|
+
var flagForceColor;
|
|
2515
|
+
if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) flagForceColor = 0;
|
|
2516
|
+
else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) flagForceColor = 1;
|
|
2517
|
+
function envForceColor() {
|
|
2518
|
+
if ("FORCE_COLOR" in env) {
|
|
2519
|
+
if ("true" === env.FORCE_COLOR) return 1;
|
|
2520
|
+
if ("false" === env.FORCE_COLOR) return 0;
|
|
2521
|
+
return 0 === env.FORCE_COLOR.length ? 1 : Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3);
|
|
2522
|
+
}
|
|
2523
|
+
}
|
|
2524
|
+
function translateLevel(level) {
|
|
2525
|
+
if (0 === level) return false;
|
|
2526
|
+
return {
|
|
2527
|
+
level,
|
|
2528
|
+
hasBasic: true,
|
|
2529
|
+
has256: level >= 2,
|
|
2530
|
+
has16m: level >= 3
|
|
2531
|
+
};
|
|
2532
|
+
}
|
|
2533
|
+
function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
|
|
2534
|
+
const noFlagForceColor = envForceColor();
|
|
2535
|
+
if (void 0 !== noFlagForceColor) flagForceColor = noFlagForceColor;
|
|
2536
|
+
const forceColor = sniffFlags ? flagForceColor : noFlagForceColor;
|
|
2537
|
+
if (0 === forceColor) return 0;
|
|
2538
|
+
if (sniffFlags) {
|
|
2539
|
+
if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) return 3;
|
|
2540
|
+
if (hasFlag("color=256")) return 2;
|
|
2541
|
+
}
|
|
2542
|
+
if ("TF_BUILD" in env && "AGENT_NAME" in env) return 1;
|
|
2543
|
+
if (haveStream && !streamIsTTY && void 0 === forceColor) return 0;
|
|
2544
|
+
const min = forceColor || 0;
|
|
2545
|
+
if ("dumb" === env.TERM) return min;
|
|
2546
|
+
if ("win32" === __WEBPACK_EXTERNAL_MODULE_process__["default"].platform) {
|
|
2547
|
+
const osRelease = __WEBPACK_EXTERNAL_MODULE_os__["default"].release().split(".");
|
|
2548
|
+
if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
2549
|
+
return 1;
|
|
2550
|
+
}
|
|
2551
|
+
if ("CI" in env) {
|
|
2552
|
+
if ("GITHUB_ACTIONS" in env || "GITEA_ACTIONS" in env) return 3;
|
|
2553
|
+
if ([
|
|
2554
|
+
"TRAVIS",
|
|
2555
|
+
"CIRCLECI",
|
|
2556
|
+
"APPVEYOR",
|
|
2557
|
+
"GITLAB_CI",
|
|
2558
|
+
"BUILDKITE",
|
|
2559
|
+
"DRONE"
|
|
2560
|
+
].some((sign)=>sign in env) || "codeship" === env.CI_NAME) return 1;
|
|
2561
|
+
return min;
|
|
2562
|
+
}
|
|
2563
|
+
if ("TEAMCITY_VERSION" in env) return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
|
|
2564
|
+
if ("truecolor" === env.COLORTERM) return 3;
|
|
2565
|
+
if ("xterm-kitty" === env.TERM) return 3;
|
|
2566
|
+
if ("TERM_PROGRAM" in env) {
|
|
2567
|
+
const version = Number.parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
|
|
2568
|
+
switch(env.TERM_PROGRAM){
|
|
2569
|
+
case "iTerm.app":
|
|
2570
|
+
return version >= 3 ? 3 : 2;
|
|
2571
|
+
case "Apple_Terminal":
|
|
2572
|
+
return 2;
|
|
2573
|
+
}
|
|
2574
|
+
}
|
|
2575
|
+
if (/-256(color)?$/i.test(env.TERM)) return 2;
|
|
2576
|
+
if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) return 1;
|
|
2577
|
+
if ("COLORTERM" in env) return 1;
|
|
2578
|
+
return min;
|
|
2579
|
+
}
|
|
2580
|
+
function createSupportsColor(stream, options = {}) {
|
|
2581
|
+
const level = _supportsColor(stream, {
|
|
2582
|
+
streamIsTTY: stream && stream.isTTY,
|
|
2583
|
+
...options
|
|
2584
|
+
});
|
|
2585
|
+
return translateLevel(level);
|
|
2586
|
+
}
|
|
2587
|
+
var supportsColor = {
|
|
2588
|
+
stdout: createSupportsColor({
|
|
2589
|
+
isTTY: __WEBPACK_EXTERNAL_MODULE_tty__["default"].isatty(1)
|
|
2590
|
+
}),
|
|
2591
|
+
stderr: createSupportsColor({
|
|
2592
|
+
isTTY: __WEBPACK_EXTERNAL_MODULE_tty__["default"].isatty(2)
|
|
2593
|
+
})
|
|
2594
|
+
};
|
|
2595
|
+
var supports_color_default = supportsColor;
|
|
2596
|
+
// src/utils.ts
|
|
2597
|
+
var colorLevel = supports_color_default.stdout ? supports_color_default.stdout.level : 0;
|
|
2598
|
+
var errorStackRegExp = /at\s.*:\d+:\d+[\s\)]*$/;
|
|
2599
|
+
var anonymousErrorStackRegExp = /at\s.*\(<anonymous>\)$/;
|
|
2600
|
+
var isErrorStackMessage = (message)=>errorStackRegExp.test(message) || anonymousErrorStackRegExp.test(message);
|
|
2601
|
+
// src/color.ts
|
|
2602
|
+
var formatter = (open, close, replace = open)=>colorLevel >= 2 ? (input)=>{
|
|
2603
|
+
let string = "" + input;
|
|
2604
|
+
let index = string.indexOf(close, open.length);
|
|
2605
|
+
return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close;
|
|
2606
|
+
} : String;
|
|
2607
|
+
var replaceClose = (string, close, replace, index)=>{
|
|
2608
|
+
let start = string.substring(0, index) + replace;
|
|
2609
|
+
let end = string.substring(index + close.length);
|
|
2610
|
+
let nextIndex = end.indexOf(close);
|
|
2611
|
+
return ~nextIndex ? start + replaceClose(end, close, replace, nextIndex) : start + end;
|
|
2612
|
+
};
|
|
2613
|
+
var bold = formatter("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m");
|
|
2614
|
+
var red = formatter("\x1B[31m", "\x1B[39m");
|
|
2615
|
+
var green = formatter("\x1B[32m", "\x1B[39m");
|
|
2616
|
+
var yellow = formatter("\x1B[33m", "\x1B[39m");
|
|
2617
|
+
var magenta = formatter("\x1B[35m", "\x1B[39m");
|
|
2618
|
+
var cyan = formatter("\x1B[36m", "\x1B[39m");
|
|
2619
|
+
var gray = formatter("\x1B[90m", "\x1B[39m");
|
|
2620
|
+
// src/gradient.ts
|
|
2621
|
+
var startColor = [
|
|
2622
|
+
189,
|
|
2623
|
+
255,
|
|
2624
|
+
243
|
|
2625
|
+
];
|
|
2626
|
+
var endColor = [
|
|
2627
|
+
74,
|
|
2628
|
+
194,
|
|
2629
|
+
154
|
|
2630
|
+
];
|
|
2631
|
+
var isWord = (char)=>!/[\s\n]/.test(char);
|
|
2632
|
+
var gradient = (message)=>{
|
|
2633
|
+
if (colorLevel < 3) return 2 === colorLevel ? bold(cyan(message)) : message;
|
|
2634
|
+
let chars = [
|
|
2635
|
+
...message
|
|
2636
|
+
];
|
|
2637
|
+
let steps = chars.filter(isWord).length;
|
|
2638
|
+
let r = startColor[0];
|
|
2639
|
+
let g = startColor[1];
|
|
2640
|
+
let b = startColor[2];
|
|
2641
|
+
let rStep = (endColor[0] - r) / steps;
|
|
2642
|
+
let gStep = (endColor[1] - g) / steps;
|
|
2643
|
+
let bStep = (endColor[2] - b) / steps;
|
|
2644
|
+
let output = "";
|
|
2645
|
+
for (let char of chars){
|
|
2646
|
+
if (isWord(char)) {
|
|
2647
|
+
r += rStep;
|
|
2648
|
+
g += gStep;
|
|
2649
|
+
b += bStep;
|
|
2650
|
+
}
|
|
2651
|
+
output += `\x1B[38;2;${Math.round(r)};${Math.round(g)};${Math.round(b)}m${char}\x1B[39m`;
|
|
2652
|
+
}
|
|
2653
|
+
return bold(output);
|
|
2654
|
+
};
|
|
2655
|
+
// src/constants.ts
|
|
2656
|
+
var LOG_LEVEL = {
|
|
2657
|
+
error: 0,
|
|
2658
|
+
warn: 1,
|
|
2659
|
+
info: 2,
|
|
2660
|
+
log: 3,
|
|
2661
|
+
verbose: 4
|
|
2662
|
+
};
|
|
2663
|
+
var LOG_TYPES = {
|
|
2664
|
+
// Level error
|
|
2665
|
+
error: {
|
|
2666
|
+
label: "error",
|
|
2667
|
+
level: "error",
|
|
2668
|
+
color: red
|
|
2669
|
+
},
|
|
2670
|
+
// Level warn
|
|
2671
|
+
warn: {
|
|
2672
|
+
label: "warn",
|
|
2673
|
+
level: "warn",
|
|
2674
|
+
color: yellow
|
|
2675
|
+
},
|
|
2676
|
+
// Level info
|
|
2677
|
+
info: {
|
|
2678
|
+
label: "info",
|
|
2679
|
+
level: "info",
|
|
2680
|
+
color: cyan
|
|
2681
|
+
},
|
|
2682
|
+
start: {
|
|
2683
|
+
label: "start",
|
|
2684
|
+
level: "info",
|
|
2685
|
+
color: cyan
|
|
2686
|
+
},
|
|
2687
|
+
ready: {
|
|
2688
|
+
label: "ready",
|
|
2689
|
+
level: "info",
|
|
2690
|
+
color: green
|
|
2691
|
+
},
|
|
2692
|
+
success: {
|
|
2693
|
+
label: "success",
|
|
2694
|
+
level: "info",
|
|
2695
|
+
color: green
|
|
2696
|
+
},
|
|
2697
|
+
// Level log
|
|
2698
|
+
log: {
|
|
2699
|
+
level: "log"
|
|
2700
|
+
},
|
|
2701
|
+
// Level debug
|
|
2702
|
+
debug: {
|
|
2703
|
+
label: "debug",
|
|
2704
|
+
level: "verbose",
|
|
2705
|
+
color: magenta
|
|
2706
|
+
}
|
|
2707
|
+
};
|
|
2708
|
+
// src/createLogger.ts
|
|
2709
|
+
var createLogger = (options = {})=>{
|
|
2710
|
+
let maxLevel = options.level || "log";
|
|
2711
|
+
let log = (type, message, ...args)=>{
|
|
2712
|
+
if (LOG_LEVEL[LOG_TYPES[type].level] > LOG_LEVEL[maxLevel]) return;
|
|
2713
|
+
if (null == message) return console.log();
|
|
2714
|
+
let logType = LOG_TYPES[type];
|
|
2715
|
+
let label = "";
|
|
2716
|
+
let text = "";
|
|
2717
|
+
if ("label" in logType) {
|
|
2718
|
+
label = (logType.label || "").padEnd(7);
|
|
2719
|
+
label = bold(logType.color ? logType.color(label) : label);
|
|
2720
|
+
}
|
|
2721
|
+
if (message instanceof Error) {
|
|
2722
|
+
if (message.stack) {
|
|
2723
|
+
let [name, ...rest] = message.stack.split("\n");
|
|
2724
|
+
if (name.startsWith("Error: ")) name = name.slice(7);
|
|
2725
|
+
text = `${name}
|
|
2726
|
+
${gray(rest.join("\n"))}`;
|
|
2727
|
+
} else text = message.message;
|
|
2728
|
+
} else if ("error" === logType.level && "string" == typeof message) {
|
|
2729
|
+
let lines = message.split("\n");
|
|
2730
|
+
text = lines.map((line)=>isErrorStackMessage(line) ? gray(line) : line).join("\n");
|
|
2731
|
+
} else text = `${message}`;
|
|
2732
|
+
console.log(label.length ? `${label} ${text}` : text, ...args);
|
|
2733
|
+
};
|
|
2734
|
+
let logger2 = {
|
|
2735
|
+
greet: (message)=>log("log", gradient(message))
|
|
2736
|
+
};
|
|
2737
|
+
Object.keys(LOG_TYPES).forEach((key)=>{
|
|
2738
|
+
logger2[key] = (...args)=>log(key, ...args);
|
|
2739
|
+
});
|
|
2740
|
+
Object.defineProperty(logger2, "level", {
|
|
2741
|
+
get: ()=>maxLevel,
|
|
2742
|
+
set (val) {
|
|
2743
|
+
maxLevel = val;
|
|
2744
|
+
}
|
|
2745
|
+
});
|
|
2746
|
+
logger2.override = (customLogger)=>{
|
|
2747
|
+
Object.assign(logger2, customLogger);
|
|
2748
|
+
};
|
|
2749
|
+
return logger2;
|
|
2750
|
+
};
|
|
2751
|
+
// src/index.ts
|
|
2752
|
+
var logger = createLogger();
|
|
2753
|
+
// EXTERNAL MODULE: external "path"
|
|
2754
|
+
var external_path_ = __webpack_require__("path");
|
|
2755
|
+
// EXTERNAL MODULE: ./node_modules/.pnpm/fdir@6.4.2_picomatch@4.0.2/node_modules/fdir/dist/index.js
|
|
2756
|
+
var dist = __webpack_require__("./node_modules/.pnpm/fdir@6.4.2_picomatch@4.0.2/node_modules/fdir/dist/index.js");
|
|
2757
|
+
// EXTERNAL MODULE: ./node_modules/.pnpm/picomatch@4.0.2/node_modules/picomatch/index.js
|
|
2758
|
+
var picomatch = __webpack_require__("./node_modules/.pnpm/picomatch@4.0.2/node_modules/picomatch/index.js");
|
|
2759
|
+
// src/index.ts
|
|
2760
|
+
// src/utils.ts
|
|
2761
|
+
var ESCAPED_WIN32_BACKSLASHES = /\\(?![()[\]{}!+@])/g;
|
|
2762
|
+
function convertPosixPathToPattern(path2) {
|
|
2763
|
+
return escapePosixPath(path2);
|
|
2764
|
+
}
|
|
2765
|
+
function convertWin32PathToPattern(path2) {
|
|
2766
|
+
return escapeWin32Path(path2).replace(ESCAPED_WIN32_BACKSLASHES, "/");
|
|
2767
|
+
}
|
|
2768
|
+
process.platform;
|
|
2769
|
+
var POSIX_UNESCAPED_GLOB_SYMBOLS = /(?<!\\)([()[\]{}*?|]|^!|[!+@](?=\()|\\(?![()[\]{}!*+?@|]))/g;
|
|
2770
|
+
var WIN32_UNESCAPED_GLOB_SYMBOLS = /(?<!\\)([()[\]{}]|^!|[!+@](?=\())/g;
|
|
2771
|
+
var escapePosixPath = (path2)=>path2.replace(POSIX_UNESCAPED_GLOB_SYMBOLS, "\\$&");
|
|
2772
|
+
var escapeWin32Path = (path2)=>path2.replace(WIN32_UNESCAPED_GLOB_SYMBOLS, "\\$&");
|
|
2773
|
+
process.platform;
|
|
2774
|
+
function isDynamicPattern(pattern, options) {
|
|
2775
|
+
if ((null == options ? void 0 : options.caseSensitiveMatch) === false) return true;
|
|
2776
|
+
const scan = picomatch.scan(pattern);
|
|
2777
|
+
return scan.isGlob || scan.negated;
|
|
2778
|
+
}
|
|
2779
|
+
// src/index.ts
|
|
2780
|
+
function normalizePattern(pattern, expandDirectories, cwd, properties, isIgnore) {
|
|
2781
|
+
var _a;
|
|
2782
|
+
let result = pattern;
|
|
2783
|
+
if (pattern.endsWith("/")) result = pattern.slice(0, -1);
|
|
2784
|
+
if (!result.endsWith("*") && expandDirectories) result += "/**";
|
|
2785
|
+
result = external_path_["default"].isAbsolute(result.replace(/\\(?=[()[\]{}!*+?@|])/g, "")) ? external_path_.posix.relative(cwd, result) : external_path_.posix.normalize(result);
|
|
2786
|
+
const parentDirectoryMatch = /^(\/?\.\.)+/.exec(result);
|
|
2787
|
+
if (null == parentDirectoryMatch ? void 0 : parentDirectoryMatch[0]) {
|
|
2788
|
+
const potentialRoot = external_path_.posix.join(cwd, parentDirectoryMatch[0]);
|
|
2789
|
+
if (properties.root.length > potentialRoot.length) {
|
|
2790
|
+
properties.root = potentialRoot;
|
|
2791
|
+
properties.depthOffset = -(parentDirectoryMatch[0].length + 1) / 3;
|
|
2792
|
+
}
|
|
2793
|
+
} else if (!isIgnore && properties.depthOffset >= 0) {
|
|
2794
|
+
const current = result.split("/");
|
|
2795
|
+
null != (_a = properties.commonPath) || (properties.commonPath = current);
|
|
2796
|
+
const newCommonPath = [];
|
|
2797
|
+
for(let i = 0; i < Math.min(properties.commonPath.length, current.length); i++){
|
|
2798
|
+
const part = current[i];
|
|
2799
|
+
if ("**" === part && !current[i + 1]) {
|
|
2800
|
+
newCommonPath.pop();
|
|
2801
|
+
break;
|
|
2802
|
+
}
|
|
2803
|
+
if (part !== properties.commonPath[i] || isDynamicPattern(part) || i === current.length - 1) break;
|
|
2804
|
+
newCommonPath.push(part);
|
|
2805
|
+
}
|
|
2806
|
+
properties.depthOffset = newCommonPath.length;
|
|
2807
|
+
properties.commonPath = newCommonPath;
|
|
2808
|
+
properties.root = newCommonPath.length > 0 ? `${cwd}/${newCommonPath.join("/")}` : cwd;
|
|
2809
|
+
}
|
|
2810
|
+
return result;
|
|
2811
|
+
}
|
|
2812
|
+
function processPatterns({ patterns, ignore = [], expandDirectories = true }, cwd, properties) {
|
|
2813
|
+
if ("string" == typeof patterns) patterns = [
|
|
2814
|
+
patterns
|
|
2815
|
+
];
|
|
2816
|
+
else if (!patterns) patterns = [
|
|
2817
|
+
"**/*"
|
|
2818
|
+
];
|
|
2819
|
+
if ("string" == typeof ignore) ignore = [
|
|
2820
|
+
ignore
|
|
2821
|
+
];
|
|
2822
|
+
const matchPatterns = [];
|
|
2823
|
+
const ignorePatterns = [];
|
|
2824
|
+
for (const pattern of ignore)if (!pattern.startsWith("!") || "(" === pattern[1]) {
|
|
2825
|
+
const newPattern = normalizePattern(pattern, expandDirectories, cwd, properties, true);
|
|
2826
|
+
ignorePatterns.push(newPattern);
|
|
2827
|
+
}
|
|
2828
|
+
for (const pattern of patterns)if (pattern.startsWith("!") && "(" !== pattern[1]) {
|
|
2829
|
+
if ("!" !== pattern[1] || "(" === pattern[2]) {
|
|
2830
|
+
const newPattern = normalizePattern(pattern.slice(1), expandDirectories, cwd, properties, true);
|
|
2831
|
+
ignorePatterns.push(newPattern);
|
|
2832
|
+
}
|
|
2833
|
+
} else {
|
|
2834
|
+
const newPattern = normalizePattern(pattern, expandDirectories, cwd, properties, false);
|
|
2835
|
+
matchPatterns.push(newPattern);
|
|
2836
|
+
}
|
|
2837
|
+
return {
|
|
2838
|
+
match: matchPatterns,
|
|
2839
|
+
ignore: ignorePatterns
|
|
2840
|
+
};
|
|
2841
|
+
}
|
|
2842
|
+
function getRelativePath(path2, cwd, root) {
|
|
2843
|
+
return external_path_.posix.relative(cwd, `${root}/${path2}`);
|
|
2844
|
+
}
|
|
2845
|
+
function processPath(path2, cwd, root, isDirectory, absolute) {
|
|
2846
|
+
const relativePath = absolute ? path2.slice(root.length + 1) || "." : path2;
|
|
2847
|
+
if (root === cwd) return isDirectory && "." !== relativePath ? relativePath.slice(0, -1) : relativePath;
|
|
2848
|
+
return getRelativePath(relativePath, cwd, root);
|
|
2849
|
+
}
|
|
2850
|
+
function crawl(options, cwd, sync) {
|
|
2851
|
+
const properties = {
|
|
2852
|
+
root: cwd,
|
|
2853
|
+
commonPath: null,
|
|
2854
|
+
depthOffset: 0
|
|
2855
|
+
};
|
|
2856
|
+
const processed = processPatterns(options, cwd, properties);
|
|
2857
|
+
const matcher = picomatch(processed.match, {
|
|
2858
|
+
dot: options.dot,
|
|
2859
|
+
nocase: false === options.caseSensitiveMatch,
|
|
2860
|
+
ignore: processed.ignore
|
|
2861
|
+
});
|
|
2862
|
+
const exclude = picomatch(processed.ignore, {
|
|
2863
|
+
dot: options.dot,
|
|
2864
|
+
nocase: false === options.caseSensitiveMatch
|
|
2865
|
+
});
|
|
2866
|
+
const fdirOptions = {
|
|
2867
|
+
// use relative paths in the matcher
|
|
2868
|
+
filters: [
|
|
2869
|
+
(p, isDirectory)=>matcher(processPath(p, cwd, properties.root, isDirectory, options.absolute))
|
|
2870
|
+
],
|
|
2871
|
+
exclude: (_, p)=>exclude(processPath(p, cwd, properties.root, true, true)),
|
|
2872
|
+
pathSeparator: "/",
|
|
2873
|
+
relativePaths: true,
|
|
2874
|
+
resolveSymlinks: true
|
|
2875
|
+
};
|
|
2876
|
+
if (options.deep) fdirOptions.maxDepth = Math.round(options.deep - properties.depthOffset);
|
|
2877
|
+
if (options.absolute) {
|
|
2878
|
+
fdirOptions.relativePaths = false;
|
|
2879
|
+
fdirOptions.resolvePaths = true;
|
|
2880
|
+
fdirOptions.includeBasePath = true;
|
|
2881
|
+
}
|
|
2882
|
+
if (false === options.followSymbolicLinks) {
|
|
2883
|
+
fdirOptions.resolveSymlinks = false;
|
|
2884
|
+
fdirOptions.excludeSymlinks = true;
|
|
2885
|
+
}
|
|
2886
|
+
if (options.onlyDirectories) {
|
|
2887
|
+
fdirOptions.excludeFiles = true;
|
|
2888
|
+
fdirOptions.includeDirs = true;
|
|
2889
|
+
} else if (false === options.onlyFiles) fdirOptions.includeDirs = true;
|
|
2890
|
+
properties.root = properties.root.replace(/\\/g, "");
|
|
2891
|
+
const api = new dist.fdir(fdirOptions).crawl(properties.root);
|
|
2892
|
+
if (cwd === properties.root || options.absolute) return sync ? api.sync() : api.withPromise();
|
|
2893
|
+
return sync ? api.sync().map((p)=>getRelativePath(p, cwd, properties.root) + (!p || p.endsWith("/") ? "/" : "")) : api.withPromise().then((paths)=>paths.map((p)=>getRelativePath(p, cwd, properties.root) + (!p || p.endsWith("/") ? "/" : "")));
|
|
2894
|
+
}
|
|
2895
|
+
async function glob(patternsOrOptions, options) {
|
|
2896
|
+
if (patternsOrOptions && (null == options ? void 0 : options.patterns)) throw new Error("Cannot pass patterns as both an argument and an option");
|
|
2897
|
+
const opts = Array.isArray(patternsOrOptions) || "string" == typeof patternsOrOptions ? {
|
|
2898
|
+
...options,
|
|
2899
|
+
patterns: patternsOrOptions
|
|
2900
|
+
} : patternsOrOptions;
|
|
2901
|
+
const cwd = opts.cwd ? external_path_["default"].resolve(opts.cwd).replace(/\\/g, "/") : process.cwd().replace(/\\/g, "/");
|
|
2902
|
+
return crawl(opts, cwd, false);
|
|
2903
|
+
}
|
|
2904
|
+
var abbreviates_namespaceObject = JSON.parse('{"abi":"ABI","amd":"AMD","api":"API","ast":"AST","bom":"BOM","bsd":"BSD","cdn":"CDN","cjs":"CJS","cli":"CLI","cncf":"CNCF","cors":"CORS","cpu":"CPU","crud":"CRUD","csrf":"CSRF","css":"CSS","csv":"CSV","db2":"DB2","dns":"DNS","dom":"DOM","dos":"DOS","es6":"ES6","esm":"ESM","fbi":"FBI","ftp":"FTP","ftps":"FTPS","gcc":"GCC","gcp":"GCP","glsl":"GLSL","gorm":"GORM","gpl":"GPL","gps":"GPS","gpu":"GPU","gre":"GRE","gui":"GUI","hdmi":"HDMI","hmr":"HMR","html":"HTML","http":"HTTP","https":"HTTPS","iife":"IIFE","iot":"IoT","ipc":"IPC","ipfs":"IPFS","ipmi":"IPMI","jdbc":"JDBC","jdk":"JDK","jit":"JIT","jpeg":"JPEG","jpg":"JPG","jre":"JRE","jsf":"JSF","json":"JSON","jsonp":"JSONP","jsp":"JSP","jwt":"JWT","kcp":"KCP","kde":"KDE","kpi":"KPI","lfu":"LFU","llvm":"LLVM","lru":"LRU","lts":"LTS","mdn":"MDN","mdx":"MDX","mvc":"MVC","mvp":"MVP","mvvm":"MVVM","nft":"NFT","odbc":"ODBC","ont":"ONT","orm":"ORM","oss":"OSS","pdf":"PDF","pdo":"PDO","posix":"POSIX","pwa":"PWA","qemu":"QEMU","qgis":"QGIS","quic":"QUIC","rfc":"RFC","rom":"ROM","rpc":"RPC","rss":"RSS","rss3":"RSS3","sdk":"SDK","seo":"SEO","sip":"SIP","smtp":"SMTP","sql":"SQL","sre":"SRE","ssg":"SSG","ssh":"SSH","sso":"SSO","ssr":"SSR","stp":"STP","svg":"SVG","svn":"SVN","tcp":"TCP","tls":"TLS","toml":"TOML","tsc":"TSC","udp":"UDP","umd":"UMD","uri":"URI","url":"URL","usb":"USB","vlan":"VLAN","vnc":"VNC","vpn":"VPN","vps":"VPS","wgsl":"WGSL","wlan":"WLAN","wsa":"WSA","wsl":"WSL","xhtml":"XHTML","xml":"XML","xss":"XSS","yaml":"YAML"}'); // CONCATENATED MODULE: ./node_modules/.pnpm/case-police@0.7.2/node_modules/case-police/dict/brands.json
|
|
2905
|
+
var brands_namespaceObject = JSON.parse('{"airbnb":"Airbnb","alphago":"AlphaGo","bitbucket":"Bitbucket","bytedance":"ByteDance","circleci":"CircleCI","cloudflare":"Cloudflare","freecodecamp":"freeCodeCamp","gitea":"Gitea","gitee":"Gitee","github":"GitHub","gitlab":"GitLab","gitops":"GitOps","gitpod":"Gitpod","hp":"HP","ibm":"IBM","jsdelivr":"jsDelivr","kfc":"KFC","leetcode":"LeetCode","linkedin":"LinkedIn","mcdonald":"McDonald","nvidia":"NVIDIA","pagerduty":"PagerDuty","producthunt":"Product Hunt","stackblitz":"StackBlitz","stackit":"STACKIT","stackoverflow":"Stack Overflow","unjs":"UnJS","v2ex":"V2EX","youtube":"YouTube"}'); // CONCATENATED MODULE: ./node_modules/.pnpm/case-police@0.7.2/node_modules/case-police/dict/general.json
|
|
2906
|
+
var general_namespaceObject = JSON.parse('{"aiaas":"AIaaS","baas":"BaaS","caas":"CaaS","daas":"DaaS","ddos":"DDoS","devops":"DevOps","devtools":"DevTools","esim":"eSIM","faas":"FaaS","iac":"IaC","iaas":"IaaS","ioc":"IoC","ipsec":"IPsec","mpaas":"mPaaS","paas":"PaaS","saas":"SaaS","wifi":"Wi-Fi","xaas":"XaaS"}'); // CONCATENATED MODULE: ./node_modules/.pnpm/case-police@0.7.2/node_modules/case-police/dict/products.json
|
|
2907
|
+
var products_namespaceObject = JSON.parse('{"airdrop":"AirDrop","airpods":"AirPods","airtag":"AirTag","homekit":"HomeKit","homepod":"HomePod","imac":"iMac","ipad":"iPad","iphone":"iPhone","ipod":"iPod","macbook":"MacBook","macbook air":"MacBook Air","macbook pro":"MacBook Pro","yubikey":"YubiKey"}'); // CONCATENATED MODULE: ./node_modules/.pnpm/case-police@0.7.2/node_modules/case-police/dict/softwares.json
|
|
2908
|
+
var softwares_namespaceObject = JSON.parse('{"1password":"1Password","3dtiles":"3DTiles","actionscript":"ActionScript","adblock":"AdBlock","ajax":"AJAX","alipay":"Alipay","amap":"AMap","angularjs":"AngularJS","ant design":"Ant Design","ant design vue":"Ant Design Vue","antd":"AntD","antdesign":"AntDesign","antdesignvue":"AntDesignVue","antv":"AntV","apifox":"Apifox","app store":"App Store","apple pay":"Apple Pay","applescript":"AppleScript","appletalk":"AppleTalk","arangodb":"ArangoDB","arcgis":"ArcGIS","arcmap":"ArcMap","arcobjects":"ArcObjects","beego":"Beego","bittorrent":"BitTorrent","busybox":"BusyBox","centos":"CentOS","cesiumjs":"CesiumJS","chatgpt":"ChatGPT","citygml":"CityGML","cityjson":"CityJSON","ckeditor":"CKEditor","clashx":"ClashX","clickhouse":"ClickHouse","cloudfront":"CloudFront","cmake":"CMake","cockroachdb":"CockroachDB","cocoapods":"CocoaPods","codepen":"CodePen","codesandbox":"CodeSandbox","coffeescript":"CoffeeScript","commonjs":"CommonJS","composition api":"Composition API","compositionapi":"CompositionAPI","coredns":"CoreDNS","css modules":"CSS Modules","dapr":"Dapr","datadog":"Datadog","datagrip":"DataGrip","dbase":"dBase","definitelytyped":"DefinitelyTyped","denodeploy":"DenoDeploy","digital ocean":"DigitalOcean","digitalocean":"DigitalOcean","dingtalk":"DingTalk","directx":"DirectX","django":"Django","duckduckgo":"DuckDuckGo","dynamodb":"DynamoDB","echarts":"ECharts","ecmascript":"ECMAScript","edgedb":"EdgeDB","eggjs":"Egg.js","elasticsearch":"Elasticsearch","element plus":"Element Plus","elementui":"ElementUI","esbuild":"esbuild","eslint":"ESLint","esxi":"ESXi","etcd":"etcd","facetime":"FaceTime","fastapi":"FastAPI","ffmpeg":"FFmpeg","filezilla":"FileZilla","firefox":"Firefox","freemarker":"FreeMarker","gdnative":"GDNative","gdscript":"GDScript","geforce":"GeForce","geojson":"GeoJSON","geopackage":"GeoPackage","geopandas":"GeoPandas","geoserver":"GeoServer","gitbook":"GitBook","gitkraken":"GitKraken","gltf":"glTF","gnome":"GNOME","gnu":"GNU","gnupg":"GnuPG","goland":"GoLand","google pay":"Google Pay","graphql":"GraphQL","greensock":"GreenSock","grpc":"gRPC","hackernews":"Hacker News","hacpai":"HacPai","hbase":"HBase","hbuilderx":"HBuilderX","ibook":"iBook","icloud":"iCloud","idrac":"iDRAC","ilo":"iLO","imessage":"iMessage","imovie":"iMovie","imtoken":"imToken","influxdb":"InfluxDB","intellij":"IntelliJ","intellij idea":"IntelliJ IDEA","ios":"iOS","ipados":"iPadOS","iphoto":"iPhoto","iscsi":"iSCSI","iterm":"iTerm","itunes":"iTunes","iwork":"iWork","javascript":"JavaScript","jetbrains":"JetBrains","jquery":"jQuery","jsdoc":"JSDoc","jupyterlab":"JupyterLab","katex":"KaTeX","kubernetes":"Kubernetes","latex":"LaTeX","less":"Less","libreoffice":"LibreOffice","line pay":"LINE Pay","lineageos":"LineageOS","macos":"macOS","mariadb":"MariaDB","markdown":"Markdown","markdownlint":"MarkdownLint","mathieu":"MATHIEU","mathjax":"MathJax","mathml":"MathML","mathtype":"MathType","matlab":"MATLAB","mediawiki":"MediaWiki","memcached":"Memcached","messagepack":"MessagePack","metamask":"MetaMask","mkdocs":"MkDocs","mlaas":"MLaaS","mlops":"MLOps","mobx":"MobX","mongodb":"MongoDB","mongoose":"Mongoose","ms-dos":"MS-DOS","mybatis":"MyBatis","mysql":"MySQL","naive ui":"Naive UI","naiveui":"NaiveUI","neo4j":"Neo4j","nestjs":"NestJS","netbeans":"NetBeans","netbios":"NetBIOS","nextjs":"Next.js","nixos":"NixOS","nocodb":"NocoDB","node.js":"Node.js","nosql":"NoSQL","notepad ++":"Notepad++","npm":"npm","numpy":"NumPy","nuxtjs":"NuxtJS","oauth":"OAuth","obs":"OBS","ocaml":"OCaml","onedrive":"OneDrive","onenote":"OneNote","openai":"OpenAI","openapi":"OpenAPI","opencv":"OpenCV","openfaas":"OpenFaaS","openflow":"OpenFlow","opengauss":"openGauss","opengl":"OpenGL","opengl es":"OpenGL ES","openjdk":"OpenJDK","openlayers":"OpenLayers","openpgp":"OpenPGP","opensea":"OpenSea","openssl":"OpenSSL","openstack":"OpenStack","openstreetmap":"OpenStreetMap","opensuse":"openSUSE","openvino":"OpenVINO","openwrt":"OpenWrt","opnsense":"OPNsense","pagp":"PAgP","paypal":"PayPal","photoshop":"Photoshop","php":"PHP","phpstorm":"PhpStorm","pihole":"Pi-hole","planetscale":"PlanetScale","postcss":"PostCSS","postgis":"PostGIS","postgresql":"PostgreSQL","potplayer":"PotPlayer","powerpoint":"PowerPoint","powershell":"PowerShell","premid":"PreMiD","primevue":"PrimeVue","protobuf":"Protobuf","pycharm":"PyCharm","pytorch":"PyTorch","qtscript":"QtScript","raii":"RAII","react native":"React Native","redhat":"RedHat","redisearch":"RediSearch","redisjson":"RedisJSON","rescript":"ReScript","restful":"RESTful","rethinkdb":"RethinkDB","rsshub":"RSSHub","rust":"Rust","rxdb":"RxDB","rxjs":"RxJS","samsung pay":"Samsung Pay","sass":"Sass","scss":"SCSS","segmentfault":"SegmentFault","socket.io":"Socket.IO","solarwinds":"SolarWinds","spatiallite":"SpatialLite","spir-v":"SPIR-V","springboot":"SpringBoot","springcloud":"SpringCloud","springmvc":"SpringMVC","sqlite":"SQLite","sqlserver":"SQLServer","storybook":"Storybook","stylus":"Stylus","sublime text":"Sublime Text","surrealdb":"SurrealDB","sveltekit":"SvelteKit","tailwind css":"Tailwind CSS","tailwindcss":"TailwindCSS","teamviewer":"TeamViewer","tensorflow":"TensorFlow","testflight":"TestFlight","tex":"TeX","threejs":"ThreeJS","tianocore":"TianoCore","tidb":"TiDB","tiflash":"TiFlash","tiktok":"TikTok","tikv":"TiKV","travis ci":"Travis CI","trpc":"tRPC","tsconfig":"TSConfig","tsdoc":"TSDoc","tsdx":"TSdx","turbopack":"Turbopack","turborepo":"Turborepo","typeorm":"TypeORM","typescript":"TypeScript","uniapp":"uniapp","unifi":"UniFi","unix":"UNIX","unocss":"UnoCSS","upnp":"UPnP","vercel":"Vercel","videolan":"VideoLAN","vim":"VIM","virtualbox":"VirtualBox","visual studio":"Visual Studio","visual studio code":"Visual Studio Code","vitepress":"VitePress","vividcortex":"VividCortex","vlc":"VLC","vmware":"VMware","voip":"VoIP","vs code":"VS Code","vs codium":"VSCodium","vscode":"VS Code","vscodium":"VSCodium","vue cli":"Vue CLI","vuepress":"VuePress","vueuse":"VueUse","vulkan":"Vulkan","w3c":"W3C","wasm":"Wasm","watchos":"watchOS","web assembly":"WebAssembly","webar":"WebAR","webassembly":"WebAssembly","webgl":"WebGL","webgpu":"WebGPU","webkit":"WebKit","webpack":"webpack","webrtc":"WebRTC","websocket":"WebSocket","webstorm":"WebStorm","webvr":"WebVR","webxr":"WebXR","wechat":"WeChat","wechat pay":"WeChat Pay","whatsapp":"WhatsApp","windi css":"Windi CSS","windicss":"WindiCSS","wireguard":"WireGuard","wordpress":"WordPress","xmind":"XMind","xstate":"XState","yapi":"YApi"}'); // CONCATENATED MODULE: ./src/dict.ts
|
|
2909
|
+
const dict = [
|
|
2910
|
+
...Object.values(abbreviates_namespaceObject),
|
|
2911
|
+
...Object.values(brands_namespaceObject),
|
|
2912
|
+
...Object.values(general_namespaceObject),
|
|
2913
|
+
...Object.values(products_namespaceObject),
|
|
2914
|
+
...Object.values(softwares_namespaceObject),
|
|
2915
|
+
'EJS',
|
|
2916
|
+
'Rspack',
|
|
2917
|
+
'Rsbuild',
|
|
2918
|
+
'Rsdoctor',
|
|
2919
|
+
'Rslib',
|
|
2920
|
+
'Rspress',
|
|
2921
|
+
'Rstest',
|
|
2922
|
+
'Rollup',
|
|
2923
|
+
'Parcel',
|
|
2924
|
+
'Vite',
|
|
2925
|
+
'Module Federation',
|
|
2926
|
+
'CSS Modules',
|
|
2927
|
+
'Web Workers',
|
|
2928
|
+
'Create React App',
|
|
2929
|
+
'React Router'
|
|
2930
|
+
];
|
|
2931
|
+
async function globMarkdownFiles(cwd) {
|
|
2932
|
+
return glob([
|
|
2933
|
+
'**/*.md',
|
|
2934
|
+
'**/*.mdx'
|
|
2935
|
+
], {
|
|
2936
|
+
cwd,
|
|
2937
|
+
ignore: [
|
|
2938
|
+
'**/node_modules',
|
|
2939
|
+
'**/dist',
|
|
2940
|
+
'**/.git',
|
|
2941
|
+
'**/.cache',
|
|
2942
|
+
'**/temp'
|
|
2943
|
+
],
|
|
2944
|
+
absolute: true
|
|
2945
|
+
});
|
|
2946
|
+
}
|
|
2947
|
+
const isTitleLine = (line)=>/^#{1,6}\s+\S/.test(line.trim());
|
|
2948
|
+
const isEnglishWord = (word)=>/^[a-zA-Z]+$/.test(word);
|
|
2949
|
+
const isFirstCharUppercase = (word)=>/^[A-Z][a-z]*$/.test(word);
|
|
2950
|
+
const isTerm = (word, line)=>dict.some((term)=>{
|
|
2951
|
+
if (term.includes(` ${word}`) || term.includes(`${word} `)) return line.includes(term);
|
|
2952
|
+
return term === word;
|
|
2953
|
+
});
|
|
2954
|
+
const formatLine = (originalLine)=>{
|
|
2955
|
+
let line = originalLine;
|
|
2956
|
+
const words = line.trim().split(/\s+/);
|
|
2957
|
+
const englishWords = [];
|
|
2958
|
+
for(let index = 0; index < words.length; index++){
|
|
2959
|
+
const word = words[index];
|
|
2960
|
+
if (isEnglishWord(word)) englishWords.push(word);
|
|
2961
|
+
if (englishWords.length <= 1 || // ignore terms
|
|
2962
|
+
isTerm(word, originalLine) || // only format the first-char-uppercase English words
|
|
2963
|
+
!isFirstCharUppercase(word)) continue;
|
|
2964
|
+
const lowerCaseWord = word.toLowerCase();
|
|
2965
|
+
if (lowerCaseWord !== word) line = line.replace(new RegExp(`\\b${word}\\b`, 'g'), lowerCaseWord);
|
|
2966
|
+
}
|
|
2967
|
+
return line;
|
|
2968
|
+
};
|
|
2969
|
+
function formatContent(content) {
|
|
2970
|
+
const lines = content.split('\n');
|
|
2971
|
+
return lines.map((originalLine)=>{
|
|
2972
|
+
if (isTitleLine(originalLine)) return formatLine(originalLine);
|
|
2973
|
+
return originalLine;
|
|
2974
|
+
}).join('\n');
|
|
2975
|
+
}
|
|
2976
|
+
async function formatFile(filePath) {
|
|
2977
|
+
const content = await __WEBPACK_EXTERNAL_MODULE_node_fs__["default"].promises.readFile(filePath, 'utf-8');
|
|
2978
|
+
const formatted = formatContent(content);
|
|
2979
|
+
const isChanged = formatted !== content;
|
|
2980
|
+
if (isChanged) {
|
|
2981
|
+
await __WEBPACK_EXTERNAL_MODULE_node_fs__["default"].promises.writeFile(filePath, formatted);
|
|
2982
|
+
logger.success(`${picocolors_default().green('Formatted')} ${picocolors_default().dim(filePath)}`);
|
|
2983
|
+
}
|
|
2984
|
+
return isChanged;
|
|
2985
|
+
}
|
|
2986
|
+
async function headingCase({ root = process.cwd() } = {}) {
|
|
2987
|
+
const files = await globMarkdownFiles(root);
|
|
2988
|
+
let count = 0;
|
|
2989
|
+
for (const file of files){
|
|
2990
|
+
const isFormatted = await formatFile(file);
|
|
2991
|
+
if (isFormatted) count++;
|
|
2992
|
+
}
|
|
2993
|
+
if (count) logger.success(`[heading-case] formatted ${picocolors_default().yellow(count.toString())} files.`);
|
|
2994
|
+
}
|
|
2995
|
+
export { globMarkdownFiles, headingCase };
|