minimatch-fast 0.2.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/LICENSE +21 -0
- package/README.md +950 -0
- package/dist/cjs/brace-expand.d.ts +42 -0
- package/dist/cjs/brace-expand.d.ts.map +1 -0
- package/dist/cjs/brace-expand.js +172 -0
- package/dist/cjs/brace-expand.js.map +1 -0
- package/dist/cjs/cache.d.ts +36 -0
- package/dist/cjs/cache.d.ts.map +1 -0
- package/dist/cjs/cache.js +91 -0
- package/dist/cjs/cache.js.map +1 -0
- package/dist/cjs/escape.d.ts +40 -0
- package/dist/cjs/escape.d.ts.map +1 -0
- package/dist/cjs/escape.js +52 -0
- package/dist/cjs/escape.js.map +1 -0
- package/dist/cjs/fast-paths.d.ts +54 -0
- package/dist/cjs/fast-paths.d.ts.map +1 -0
- package/dist/cjs/fast-paths.js +213 -0
- package/dist/cjs/fast-paths.js.map +1 -0
- package/dist/cjs/index.d.ts +150 -0
- package/dist/cjs/index.d.ts.map +1 -0
- package/dist/cjs/index.js +250 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/minimatch-class.d.ts +153 -0
- package/dist/cjs/minimatch-class.d.ts.map +1 -0
- package/dist/cjs/minimatch-class.js +618 -0
- package/dist/cjs/minimatch-class.js.map +1 -0
- package/dist/cjs/options.d.ts +31 -0
- package/dist/cjs/options.d.ts.map +1 -0
- package/dist/cjs/options.js +67 -0
- package/dist/cjs/options.js.map +1 -0
- package/dist/cjs/package.json +3 -0
- package/dist/cjs/types.d.ts +194 -0
- package/dist/cjs/types.d.ts.map +1 -0
- package/dist/cjs/types.js +19 -0
- package/dist/cjs/types.js.map +1 -0
- package/dist/cjs/unescape.d.ts +36 -0
- package/dist/cjs/unescape.d.ts.map +1 -0
- package/dist/cjs/unescape.js +49 -0
- package/dist/cjs/unescape.js.map +1 -0
- package/dist/cjs/utils.d.ts +62 -0
- package/dist/cjs/utils.d.ts.map +1 -0
- package/dist/cjs/utils.js +126 -0
- package/dist/cjs/utils.js.map +1 -0
- package/dist/esm/brace-expand.d.ts +42 -0
- package/dist/esm/brace-expand.d.ts.map +1 -0
- package/dist/esm/brace-expand.js +165 -0
- package/dist/esm/brace-expand.js.map +1 -0
- package/dist/esm/cache.d.ts +36 -0
- package/dist/esm/cache.d.ts.map +1 -0
- package/dist/esm/cache.js +86 -0
- package/dist/esm/cache.js.map +1 -0
- package/dist/esm/escape.d.ts +40 -0
- package/dist/esm/escape.d.ts.map +1 -0
- package/dist/esm/escape.js +49 -0
- package/dist/esm/escape.js.map +1 -0
- package/dist/esm/fast-paths.d.ts +54 -0
- package/dist/esm/fast-paths.d.ts.map +1 -0
- package/dist/esm/fast-paths.js +209 -0
- package/dist/esm/fast-paths.js.map +1 -0
- package/dist/esm/index.d.ts +150 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/index.js +240 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/minimatch-class.d.ts +153 -0
- package/dist/esm/minimatch-class.d.ts.map +1 -0
- package/dist/esm/minimatch-class.js +611 -0
- package/dist/esm/minimatch-class.js.map +1 -0
- package/dist/esm/options.d.ts +31 -0
- package/dist/esm/options.d.ts.map +1 -0
- package/dist/esm/options.js +63 -0
- package/dist/esm/options.js.map +1 -0
- package/dist/esm/package.json +3 -0
- package/dist/esm/types.d.ts +194 -0
- package/dist/esm/types.d.ts.map +1 -0
- package/dist/esm/types.js +16 -0
- package/dist/esm/types.js.map +1 -0
- package/dist/esm/unescape.d.ts +36 -0
- package/dist/esm/unescape.d.ts.map +1 -0
- package/dist/esm/unescape.js +46 -0
- package/dist/esm/unescape.js.map +1 -0
- package/dist/esm/utils.d.ts +62 -0
- package/dist/esm/utils.d.ts.map +1 -0
- package/dist/esm/utils.js +116 -0
- package/dist/esm/utils.js.map +1 -0
- package/package.json +83 -0
|
@@ -0,0 +1,611 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Minimatch class - core pattern matching implementation
|
|
3
|
+
*
|
|
4
|
+
* This is the heart of minimatch-fast. The Minimatch class provides 100% API
|
|
5
|
+
* compatibility with minimatch's Minimatch class while using picomatch
|
|
6
|
+
* internally for faster and more secure pattern matching.
|
|
7
|
+
*
|
|
8
|
+
* Key features:
|
|
9
|
+
* - Pattern compilation and caching for efficient repeated matching
|
|
10
|
+
* - Full support for glob patterns: *, **, ?, [], {}, extglob
|
|
11
|
+
* - Brace expansion using the 'braces' package
|
|
12
|
+
* - Negation patterns with !
|
|
13
|
+
* - Comment patterns with #
|
|
14
|
+
* - Cross-platform path handling (Windows and POSIX)
|
|
15
|
+
*
|
|
16
|
+
* Architecture:
|
|
17
|
+
* 1. Constructor receives pattern and options
|
|
18
|
+
* 2. Pattern is parsed and expanded (braces)
|
|
19
|
+
* 3. Picomatch matchers are created for each expanded pattern
|
|
20
|
+
* 4. match() method tests paths against all matchers
|
|
21
|
+
*
|
|
22
|
+
* Compatibility layer:
|
|
23
|
+
* Some edge cases require special handling to match minimatch's exact behavior:
|
|
24
|
+
* - Dotfiles (. and ..) are never matched by wildcards
|
|
25
|
+
* - Negated character classes [^...] don't match dotfiles
|
|
26
|
+
* - Backslash escapes in character classes ([\b] = literal 'b')
|
|
27
|
+
*
|
|
28
|
+
* @author 686f6c61
|
|
29
|
+
* @see https://github.com/686f6c61/minimatch-fast
|
|
30
|
+
* @license MIT
|
|
31
|
+
*/
|
|
32
|
+
import picomatch from 'picomatch';
|
|
33
|
+
import { GLOBSTAR } from './types.js';
|
|
34
|
+
import { translateOptions } from './options.js';
|
|
35
|
+
import { braceExpand } from './brace-expand.js';
|
|
36
|
+
import { normalizePath, normalizePattern, slashSplit, isWindows as checkIsWindows, getPlatform, } from './utils.js';
|
|
37
|
+
/**
|
|
38
|
+
* Maximum pattern length to prevent ReDoS attacks
|
|
39
|
+
*/
|
|
40
|
+
const MAX_PATTERN_LENGTH = 65536;
|
|
41
|
+
/**
|
|
42
|
+
* Minimatch class for glob pattern matching
|
|
43
|
+
*/
|
|
44
|
+
export class Minimatch {
|
|
45
|
+
/** Original pattern passed to constructor */
|
|
46
|
+
pattern;
|
|
47
|
+
/** Options used for matching */
|
|
48
|
+
options;
|
|
49
|
+
/** 2D array of parsed pattern parts after brace expansion */
|
|
50
|
+
set;
|
|
51
|
+
/** Whether the pattern is negated (starts with !) */
|
|
52
|
+
negate;
|
|
53
|
+
/** Whether the pattern is a comment (starts with #) */
|
|
54
|
+
comment;
|
|
55
|
+
/** Whether the pattern is empty */
|
|
56
|
+
empty;
|
|
57
|
+
/** Whether to preserve multiple consecutive slashes */
|
|
58
|
+
preserveMultipleSlashes;
|
|
59
|
+
/** Whether to do partial matching */
|
|
60
|
+
partial;
|
|
61
|
+
/** Result of brace expansion on the pattern */
|
|
62
|
+
globSet;
|
|
63
|
+
/** Brace-expanded patterns split into path portions */
|
|
64
|
+
globParts;
|
|
65
|
+
/** Whether to perform case-insensitive matching */
|
|
66
|
+
nocase;
|
|
67
|
+
/** Whether running on Windows */
|
|
68
|
+
isWindows;
|
|
69
|
+
/** Target platform */
|
|
70
|
+
platform;
|
|
71
|
+
/** Windows-specific magic root handling */
|
|
72
|
+
windowsNoMagicRoot;
|
|
73
|
+
/** Compiled regular expression (lazily computed) */
|
|
74
|
+
regexp;
|
|
75
|
+
/** Whether backslash is treated as path separator */
|
|
76
|
+
windowsPathsNoEscape;
|
|
77
|
+
/** Whether negation is disabled */
|
|
78
|
+
nonegate;
|
|
79
|
+
// Private properties
|
|
80
|
+
_picoOpts;
|
|
81
|
+
_matchers;
|
|
82
|
+
_debugFn;
|
|
83
|
+
// Cached computed values for performance
|
|
84
|
+
_hasNegatedCharClassCached;
|
|
85
|
+
_requiresTrailingSlashCached;
|
|
86
|
+
_patternBasename;
|
|
87
|
+
/**
|
|
88
|
+
* Create a new Minimatch instance
|
|
89
|
+
*
|
|
90
|
+
* @param pattern - The glob pattern to match against
|
|
91
|
+
* @param options - Matching options
|
|
92
|
+
*/
|
|
93
|
+
constructor(pattern, options = {}) {
|
|
94
|
+
// Validate pattern
|
|
95
|
+
if (typeof pattern !== 'string') {
|
|
96
|
+
throw new TypeError('glob pattern must be a string');
|
|
97
|
+
}
|
|
98
|
+
// Prevent ReDoS attacks with very long patterns
|
|
99
|
+
if (pattern.length > MAX_PATTERN_LENGTH) {
|
|
100
|
+
throw new TypeError('pattern is too long');
|
|
101
|
+
}
|
|
102
|
+
// Store options
|
|
103
|
+
this.options = options;
|
|
104
|
+
this.pattern = pattern;
|
|
105
|
+
// Platform detection
|
|
106
|
+
this.platform = options.platform || getPlatform();
|
|
107
|
+
this.isWindows = checkIsWindows(this.platform);
|
|
108
|
+
// Handle Windows path escape mode
|
|
109
|
+
this.windowsPathsNoEscape =
|
|
110
|
+
!!options.windowsPathsNoEscape || options.allowWindowsEscape === false;
|
|
111
|
+
// Normalize pattern for Windows if needed
|
|
112
|
+
if (this.windowsPathsNoEscape) {
|
|
113
|
+
this.pattern = normalizePattern(this.pattern, true);
|
|
114
|
+
}
|
|
115
|
+
// Initialize properties
|
|
116
|
+
this.preserveMultipleSlashes = !!options.preserveMultipleSlashes;
|
|
117
|
+
this.regexp = null;
|
|
118
|
+
this.negate = false;
|
|
119
|
+
this.nonegate = !!options.nonegate;
|
|
120
|
+
this.comment = false;
|
|
121
|
+
this.empty = false;
|
|
122
|
+
this.partial = !!options.partial;
|
|
123
|
+
this.nocase = !!options.nocase;
|
|
124
|
+
this.windowsNoMagicRoot =
|
|
125
|
+
options.windowsNoMagicRoot !== undefined
|
|
126
|
+
? options.windowsNoMagicRoot
|
|
127
|
+
: !!(this.isWindows && this.nocase);
|
|
128
|
+
this.globSet = [];
|
|
129
|
+
this.globParts = [];
|
|
130
|
+
this.set = [];
|
|
131
|
+
this._matchers = [];
|
|
132
|
+
// Debug function (no-op by default)
|
|
133
|
+
this._debugFn = () => { };
|
|
134
|
+
// Translate options for picomatch
|
|
135
|
+
const { picoOpts } = translateOptions(options);
|
|
136
|
+
this._picoOpts = picoOpts;
|
|
137
|
+
// Build the pattern set
|
|
138
|
+
this.make();
|
|
139
|
+
// Pre-compute cached values for performance
|
|
140
|
+
// These are used in match() and would otherwise be computed on every call
|
|
141
|
+
this._hasNegatedCharClassCached = /\[\^[^\]]+\]/.test(this.pattern);
|
|
142
|
+
this._requiresTrailingSlashCached = /\*\*\/\.[^/]+\/\*\*/.test(this.pattern);
|
|
143
|
+
// Cache pattern basename for dotfile handling
|
|
144
|
+
const lastSlash = this.pattern.lastIndexOf('/');
|
|
145
|
+
this._patternBasename = lastSlash >= 0
|
|
146
|
+
? this.pattern.slice(lastSlash + 1)
|
|
147
|
+
: this.pattern;
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Enable debug output
|
|
151
|
+
*/
|
|
152
|
+
debug(...args) {
|
|
153
|
+
this._debugFn(...args);
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Check if the pattern contains glob magic characters
|
|
157
|
+
*/
|
|
158
|
+
hasMagic() {
|
|
159
|
+
// If magicalBraces is set and we have multiple patterns from brace expansion
|
|
160
|
+
if (this.options.magicalBraces && this.set.length > 1) {
|
|
161
|
+
return true;
|
|
162
|
+
}
|
|
163
|
+
// Check each pattern part for non-string (regex) parts
|
|
164
|
+
for (const pattern of this.set) {
|
|
165
|
+
for (const part of pattern) {
|
|
166
|
+
if (typeof part !== 'string') {
|
|
167
|
+
return true;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
return false;
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Build the pattern matching set
|
|
175
|
+
*/
|
|
176
|
+
make() {
|
|
177
|
+
const pattern = this.pattern;
|
|
178
|
+
const options = this.options;
|
|
179
|
+
// Handle debug mode
|
|
180
|
+
if (options.debug) {
|
|
181
|
+
this._debugFn = (...args) => console.error(...args);
|
|
182
|
+
}
|
|
183
|
+
// Comments match nothing
|
|
184
|
+
if (!options.nocomment && pattern.charAt(0) === '#') {
|
|
185
|
+
this.comment = true;
|
|
186
|
+
return;
|
|
187
|
+
}
|
|
188
|
+
// Empty patterns match nothing
|
|
189
|
+
if (!pattern) {
|
|
190
|
+
this.empty = true;
|
|
191
|
+
return;
|
|
192
|
+
}
|
|
193
|
+
// Parse negation (!)
|
|
194
|
+
this.parseNegate();
|
|
195
|
+
// Expand braces
|
|
196
|
+
this.globSet = [...new Set(this.braceExpand())];
|
|
197
|
+
this.debug(this.pattern, this.globSet);
|
|
198
|
+
// Split into path parts
|
|
199
|
+
const rawGlobParts = this.globSet.map((s) => this.slashSplit(s));
|
|
200
|
+
// Apply preprocessing (optimization, normalization)
|
|
201
|
+
this.globParts = this.preprocess(rawGlobParts);
|
|
202
|
+
this.debug(this.pattern, this.globParts);
|
|
203
|
+
// Create matchers for each expanded pattern
|
|
204
|
+
this._matchers = this.globSet.map((p) => {
|
|
205
|
+
try {
|
|
206
|
+
// Pre-process pattern for minimatch compatibility
|
|
207
|
+
const processed = this.preprocessPattern(p);
|
|
208
|
+
return picomatch(processed, this._picoOpts);
|
|
209
|
+
}
|
|
210
|
+
catch {
|
|
211
|
+
// If picomatch fails, return a matcher that never matches
|
|
212
|
+
return () => false;
|
|
213
|
+
}
|
|
214
|
+
});
|
|
215
|
+
// Convert to pattern set for internal use
|
|
216
|
+
this.set = this.globParts
|
|
217
|
+
.map((parts) => {
|
|
218
|
+
return parts.map((part) => this.parse(part));
|
|
219
|
+
})
|
|
220
|
+
.filter((s) => s.indexOf(false) === -1);
|
|
221
|
+
this.debug(this.pattern, this.set);
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* Parse negation from the pattern
|
|
225
|
+
*/
|
|
226
|
+
parseNegate() {
|
|
227
|
+
if (this.nonegate)
|
|
228
|
+
return;
|
|
229
|
+
const pattern = this.pattern;
|
|
230
|
+
let negate = false;
|
|
231
|
+
let negateOffset = 0;
|
|
232
|
+
// Count leading ! characters
|
|
233
|
+
for (let i = 0; i < pattern.length && pattern.charAt(i) === '!'; i++) {
|
|
234
|
+
negate = !negate;
|
|
235
|
+
negateOffset++;
|
|
236
|
+
}
|
|
237
|
+
// Remove leading ! characters from pattern
|
|
238
|
+
if (negateOffset) {
|
|
239
|
+
this.pattern = pattern.slice(negateOffset);
|
|
240
|
+
}
|
|
241
|
+
this.negate = negate;
|
|
242
|
+
}
|
|
243
|
+
/**
|
|
244
|
+
* Perform brace expansion on the pattern
|
|
245
|
+
*/
|
|
246
|
+
braceExpand() {
|
|
247
|
+
return braceExpand(this.pattern, this.options);
|
|
248
|
+
}
|
|
249
|
+
/**
|
|
250
|
+
* Split a path by slashes
|
|
251
|
+
*/
|
|
252
|
+
slashSplit(p) {
|
|
253
|
+
return slashSplit(p, this.preserveMultipleSlashes, this.isWindows);
|
|
254
|
+
}
|
|
255
|
+
/**
|
|
256
|
+
* Preprocess glob parts (optimization, normalization)
|
|
257
|
+
*/
|
|
258
|
+
preprocess(globParts) {
|
|
259
|
+
// Convert ** to * if noglobstar
|
|
260
|
+
if (this.options.noglobstar) {
|
|
261
|
+
for (const parts of globParts) {
|
|
262
|
+
for (let j = 0; j < parts.length; j++) {
|
|
263
|
+
if (parts[j] === '**') {
|
|
264
|
+
parts[j] = '*';
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
const { optimizationLevel = 1 } = this.options;
|
|
270
|
+
if (optimizationLevel >= 1) {
|
|
271
|
+
// Remove adjacent ** and resolve .. portions
|
|
272
|
+
globParts = globParts
|
|
273
|
+
.map((parts) => {
|
|
274
|
+
return parts.reduce((set, part) => {
|
|
275
|
+
const prev = set[set.length - 1];
|
|
276
|
+
// Skip duplicate **
|
|
277
|
+
if (part === '**' && prev === '**') {
|
|
278
|
+
return set;
|
|
279
|
+
}
|
|
280
|
+
// Resolve ..
|
|
281
|
+
if (part === '..') {
|
|
282
|
+
if (prev && prev !== '..' && prev !== '.' && prev !== '**') {
|
|
283
|
+
set.pop();
|
|
284
|
+
return set;
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
set.push(part);
|
|
288
|
+
return set;
|
|
289
|
+
}, []);
|
|
290
|
+
})
|
|
291
|
+
.map((parts) => (parts.length === 0 ? [''] : parts));
|
|
292
|
+
}
|
|
293
|
+
return globParts;
|
|
294
|
+
}
|
|
295
|
+
/**
|
|
296
|
+
* Parse a single pattern part into a regex or string
|
|
297
|
+
*/
|
|
298
|
+
parse(pattern) {
|
|
299
|
+
// Globstar
|
|
300
|
+
if (pattern === '**') {
|
|
301
|
+
return GLOBSTAR;
|
|
302
|
+
}
|
|
303
|
+
// Empty string
|
|
304
|
+
if (pattern === '') {
|
|
305
|
+
return '';
|
|
306
|
+
}
|
|
307
|
+
// Try to create a regex using picomatch
|
|
308
|
+
try {
|
|
309
|
+
const regex = picomatch.makeRe(pattern, this._picoOpts);
|
|
310
|
+
if (regex) {
|
|
311
|
+
return regex;
|
|
312
|
+
}
|
|
313
|
+
return false;
|
|
314
|
+
}
|
|
315
|
+
catch {
|
|
316
|
+
return false;
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
/**
|
|
320
|
+
* Test if a path matches the pattern
|
|
321
|
+
*
|
|
322
|
+
* @param path - The path to test
|
|
323
|
+
* @param partial - Whether to do partial matching
|
|
324
|
+
* @returns true if the path matches
|
|
325
|
+
*/
|
|
326
|
+
match(path, partial = this.partial) {
|
|
327
|
+
this.debug('match', path, this.pattern);
|
|
328
|
+
// Comments never match
|
|
329
|
+
if (this.comment) {
|
|
330
|
+
return false;
|
|
331
|
+
}
|
|
332
|
+
// Empty patterns only match empty strings
|
|
333
|
+
if (this.empty) {
|
|
334
|
+
return path === '';
|
|
335
|
+
}
|
|
336
|
+
// Root matches everything in partial mode
|
|
337
|
+
if (path === '/' && partial) {
|
|
338
|
+
return true;
|
|
339
|
+
}
|
|
340
|
+
// Normalize Windows paths (only if needed)
|
|
341
|
+
if ((this.windowsPathsNoEscape || this.isWindows) && path.includes('\\')) {
|
|
342
|
+
path = normalizePath(path, true);
|
|
343
|
+
}
|
|
344
|
+
// Get the basename for special handling (optimized to avoid split)
|
|
345
|
+
const lastSlashIdx = path.lastIndexOf('/');
|
|
346
|
+
const basename = lastSlashIdx >= 0 ? path.slice(lastSlashIdx + 1) : path;
|
|
347
|
+
// minimatch compatibility: '.' and '..' never match unless pattern is exactly '.' or '..'
|
|
348
|
+
// This is true even with dot:true option
|
|
349
|
+
if (basename === '.' || basename === '..') {
|
|
350
|
+
// Only match if the pattern is exactly the basename (use cached value)
|
|
351
|
+
if (this._patternBasename !== basename && this._patternBasename !== '.*' + basename.slice(1)) {
|
|
352
|
+
// Check if pattern explicitly matches . or ..
|
|
353
|
+
if (!this.pattern.includes(basename)) {
|
|
354
|
+
return this.negate ? true : false;
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
// Handle trailing slashes in path
|
|
359
|
+
// minimatch treats 'dir/' as equivalent to 'dir' when pattern doesn't end with /
|
|
360
|
+
const pathWithoutTrailingSlash = path.endsWith('/') && path.length > 1
|
|
361
|
+
? path.slice(0, -1)
|
|
362
|
+
: path;
|
|
363
|
+
// Use picomatch matchers for fast matching
|
|
364
|
+
let matches = false;
|
|
365
|
+
if (this.options.matchBase && !path.includes('/')) {
|
|
366
|
+
// matchBase mode: match against basename only
|
|
367
|
+
matches = this._matchers.some((matcher) => matcher(path));
|
|
368
|
+
}
|
|
369
|
+
else if (this.options.matchBase) {
|
|
370
|
+
// matchBase with path: try full path first, then basename
|
|
371
|
+
matches = this._matchers.some((matcher) => matcher(path) || matcher(basename));
|
|
372
|
+
}
|
|
373
|
+
else {
|
|
374
|
+
// Normal mode: match full path
|
|
375
|
+
// Try with and without trailing slash for compatibility
|
|
376
|
+
matches = this._matchers.some((matcher) => matcher(path) || matcher(pathWithoutTrailingSlash));
|
|
377
|
+
}
|
|
378
|
+
// minimatch compatibility: negated character classes [^...] should not match dotfiles
|
|
379
|
+
// unless dot option is true
|
|
380
|
+
if (matches && !this.options.dot && this._hasNegatedCharClassCached) {
|
|
381
|
+
if (basename.startsWith('.')) {
|
|
382
|
+
matches = false;
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
// minimatch compatibility: globstar patterns like **/.x/** require directory indicators
|
|
386
|
+
// The path ".x" or "a/b/.x" (without trailing /) should not match **/.x/**
|
|
387
|
+
// but ".x/" or "a/b/.x/" or "a/b/.x/c" should match
|
|
388
|
+
if (matches && this._requiresTrailingSlashCached && !path.endsWith('/')) {
|
|
389
|
+
// Check if the matched portion requires a trailing slash
|
|
390
|
+
const patternParts = this.pattern.split('/');
|
|
391
|
+
const pathParts = path.split('/');
|
|
392
|
+
const lastPathPart = pathParts[pathParts.length - 1];
|
|
393
|
+
// If pattern has **/.x/** and path ends with just ".x" (no trailing slash), don't match
|
|
394
|
+
// The pattern requires content after the dotfile directory
|
|
395
|
+
for (let i = 0; i < patternParts.length - 1; i++) {
|
|
396
|
+
if (patternParts[i] === '**' && patternParts[i + 1] && patternParts[i + 1].startsWith('.')) {
|
|
397
|
+
const dotPart = patternParts[i + 1];
|
|
398
|
+
// Check if this is followed by another ** (meaning content is required after)
|
|
399
|
+
if (i + 2 < patternParts.length && patternParts[i + 2] === '**') {
|
|
400
|
+
// Path ends with the dotfile part - should not match without trailing slash
|
|
401
|
+
if (lastPathPart === dotPart) {
|
|
402
|
+
matches = false;
|
|
403
|
+
break;
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
// Handle flipNegate option
|
|
410
|
+
if (this.options.flipNegate) {
|
|
411
|
+
return matches;
|
|
412
|
+
}
|
|
413
|
+
// Apply negation
|
|
414
|
+
return this.negate ? !matches : matches;
|
|
415
|
+
}
|
|
416
|
+
// Note: _hasNegatedCharClass and _requiresTrailingSlash are now cached
|
|
417
|
+
// in the constructor as _hasNegatedCharClassCached and _requiresTrailingSlashCached
|
|
418
|
+
// for better performance (avoids regex test on every match() call)
|
|
419
|
+
/**
|
|
420
|
+
* Pre-process pattern for minimatch compatibility
|
|
421
|
+
* Handles edge cases where picomatch behaves differently
|
|
422
|
+
*/
|
|
423
|
+
preprocessPattern(pattern) {
|
|
424
|
+
// minimatch treats [\b] as [b] (the backslash is just escaping 'b' in a character class)
|
|
425
|
+
// picomatch treats [\b] as the backspace character
|
|
426
|
+
// Convert [\b] to [b] for compatibility
|
|
427
|
+
pattern = pattern.replace(/\[\\b\]/g, '[b]');
|
|
428
|
+
// Also handle other escaped letters in character classes that should be literal
|
|
429
|
+
// [\n], [\t], etc. in minimatch are just the literal letters n, t, etc.
|
|
430
|
+
// But we need to be careful not to break actual escape sequences
|
|
431
|
+
return pattern;
|
|
432
|
+
}
|
|
433
|
+
/**
|
|
434
|
+
* Create a regular expression from the pattern
|
|
435
|
+
*
|
|
436
|
+
* @returns RegExp or false if pattern is invalid
|
|
437
|
+
*/
|
|
438
|
+
makeRe() {
|
|
439
|
+
// Return cached regex if available
|
|
440
|
+
if (this.regexp !== null) {
|
|
441
|
+
return this.regexp;
|
|
442
|
+
}
|
|
443
|
+
// Comments and empty patterns produce no regex
|
|
444
|
+
if (this.comment || this.empty) {
|
|
445
|
+
this.regexp = false;
|
|
446
|
+
return this.regexp;
|
|
447
|
+
}
|
|
448
|
+
// No patterns after parsing
|
|
449
|
+
if (!this.set.length) {
|
|
450
|
+
this.regexp = false;
|
|
451
|
+
return this.regexp;
|
|
452
|
+
}
|
|
453
|
+
const options = this.options;
|
|
454
|
+
const flags = options.nocase ? 'i' : '';
|
|
455
|
+
try {
|
|
456
|
+
// Collect all regexes from expanded patterns
|
|
457
|
+
const regexParts = [];
|
|
458
|
+
for (const glob of this.globSet) {
|
|
459
|
+
try {
|
|
460
|
+
const re = picomatch.makeRe(glob, this._picoOpts);
|
|
461
|
+
if (re) {
|
|
462
|
+
// Extract the source without anchors
|
|
463
|
+
let src = re.source;
|
|
464
|
+
// Remove ^ and $ anchors if present
|
|
465
|
+
if (src.startsWith('^'))
|
|
466
|
+
src = src.slice(1);
|
|
467
|
+
if (src.endsWith('$'))
|
|
468
|
+
src = src.slice(0, -1);
|
|
469
|
+
regexParts.push(src);
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
catch {
|
|
473
|
+
// Skip invalid patterns
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
if (regexParts.length === 0) {
|
|
477
|
+
this.regexp = false;
|
|
478
|
+
return this.regexp;
|
|
479
|
+
}
|
|
480
|
+
// Combine all patterns with |
|
|
481
|
+
const combined = regexParts.length === 1
|
|
482
|
+
? regexParts[0]
|
|
483
|
+
: `(?:${regexParts.join('|')})`;
|
|
484
|
+
const re = `^${combined}$`;
|
|
485
|
+
this.regexp = new RegExp(re, flags);
|
|
486
|
+
this.regexp._src = re;
|
|
487
|
+
this.regexp._glob = this.pattern;
|
|
488
|
+
}
|
|
489
|
+
catch (e) {
|
|
490
|
+
this.regexp = false;
|
|
491
|
+
}
|
|
492
|
+
return this.regexp;
|
|
493
|
+
}
|
|
494
|
+
/**
|
|
495
|
+
* Match a file array against a pattern array
|
|
496
|
+
* This is for internal use and advanced matching scenarios
|
|
497
|
+
*
|
|
498
|
+
* @param file - Array of path segments
|
|
499
|
+
* @param pattern - Array of pattern parts
|
|
500
|
+
* @param partial - Whether to do partial matching
|
|
501
|
+
* @returns true if file matches pattern
|
|
502
|
+
*/
|
|
503
|
+
matchOne(file, pattern, partial = false) {
|
|
504
|
+
const options = this.options;
|
|
505
|
+
this.debug('matchOne', { file, pattern, partial });
|
|
506
|
+
// Traverse both arrays simultaneously
|
|
507
|
+
let fi = 0;
|
|
508
|
+
let pi = 0;
|
|
509
|
+
const fl = file.length;
|
|
510
|
+
const pl = pattern.length;
|
|
511
|
+
for (; fi < fl && pi < pl; fi++, pi++) {
|
|
512
|
+
const p = pattern[pi];
|
|
513
|
+
const f = file[fi];
|
|
514
|
+
this.debug('matchOne loop', { fi, pi, f, p });
|
|
515
|
+
// Invalid pattern part
|
|
516
|
+
if (p === false) {
|
|
517
|
+
return false;
|
|
518
|
+
}
|
|
519
|
+
// Globstar handling
|
|
520
|
+
if (p === GLOBSTAR) {
|
|
521
|
+
this.debug('GLOBSTAR', { pi, fl, fi });
|
|
522
|
+
// Handle ** at the end
|
|
523
|
+
const pr = pi + 1;
|
|
524
|
+
if (pr === pl) {
|
|
525
|
+
this.debug('** at end');
|
|
526
|
+
// ** at the end swallows everything except . and ..
|
|
527
|
+
for (; fi < fl; fi++) {
|
|
528
|
+
if (file[fi] === '.' ||
|
|
529
|
+
file[fi] === '..' ||
|
|
530
|
+
(!options.dot && file[fi].charAt(0) === '.')) {
|
|
531
|
+
return false;
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
return true;
|
|
535
|
+
}
|
|
536
|
+
// Try to match rest of pattern
|
|
537
|
+
let fr = fi;
|
|
538
|
+
while (fr < fl) {
|
|
539
|
+
const swallowee = file[fr];
|
|
540
|
+
this.debug('globstar while', { swallowee, fr, fl });
|
|
541
|
+
// Try matching the rest
|
|
542
|
+
if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {
|
|
543
|
+
this.debug('globstar found match!', fr, fl, swallowee);
|
|
544
|
+
return true;
|
|
545
|
+
}
|
|
546
|
+
// Don't swallow . or .. or dotfiles (unless dot option)
|
|
547
|
+
if (swallowee === '.' ||
|
|
548
|
+
swallowee === '..' ||
|
|
549
|
+
(!options.dot && swallowee.charAt(0) === '.')) {
|
|
550
|
+
this.debug('dot detected!', file, fr, pattern, pi);
|
|
551
|
+
break;
|
|
552
|
+
}
|
|
553
|
+
fr++;
|
|
554
|
+
}
|
|
555
|
+
// Partial match if we've consumed all of file
|
|
556
|
+
if (partial && fr === fl) {
|
|
557
|
+
return true;
|
|
558
|
+
}
|
|
559
|
+
return false;
|
|
560
|
+
}
|
|
561
|
+
// String or RegExp matching for this segment
|
|
562
|
+
let hit;
|
|
563
|
+
if (typeof p === 'string') {
|
|
564
|
+
hit = f === p;
|
|
565
|
+
this.debug('string match', p, f, hit);
|
|
566
|
+
}
|
|
567
|
+
else {
|
|
568
|
+
hit = p.test(f);
|
|
569
|
+
this.debug('pattern match', p, f, hit);
|
|
570
|
+
}
|
|
571
|
+
if (!hit) {
|
|
572
|
+
return false;
|
|
573
|
+
}
|
|
574
|
+
}
|
|
575
|
+
// Check if we matched everything
|
|
576
|
+
if (fi === fl && pi === pl) {
|
|
577
|
+
// Perfect match
|
|
578
|
+
return true;
|
|
579
|
+
}
|
|
580
|
+
else if (fi === fl) {
|
|
581
|
+
// Ran out of file, but still have pattern left
|
|
582
|
+
// This is a partial match
|
|
583
|
+
return partial;
|
|
584
|
+
}
|
|
585
|
+
else if (pi === pl) {
|
|
586
|
+
// Ran out of pattern, but still have file left
|
|
587
|
+
// Only OK if we're at the last part and it's empty (trailing slash)
|
|
588
|
+
return fi === fl - 1 && file[fi] === '';
|
|
589
|
+
}
|
|
590
|
+
// Shouldn't reach here
|
|
591
|
+
throw new Error('wtf?');
|
|
592
|
+
}
|
|
593
|
+
/**
|
|
594
|
+
* Create a new Minimatch class with default options
|
|
595
|
+
*
|
|
596
|
+
* @param def - Default options to apply
|
|
597
|
+
* @returns New Minimatch class with defaults
|
|
598
|
+
*/
|
|
599
|
+
static defaults(def) {
|
|
600
|
+
const OrigClass = Minimatch;
|
|
601
|
+
return class DefaultMinimatch extends OrigClass {
|
|
602
|
+
constructor(pattern, options = {}) {
|
|
603
|
+
super(pattern, { ...def, ...options });
|
|
604
|
+
}
|
|
605
|
+
static defaults(options) {
|
|
606
|
+
return OrigClass.defaults({ ...def, ...options });
|
|
607
|
+
}
|
|
608
|
+
};
|
|
609
|
+
}
|
|
610
|
+
}
|
|
611
|
+
//# sourceMappingURL=minimatch-class.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"minimatch-class.js","sourceRoot":"","sources":["../../src/minimatch-class.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,OAAO,SAAS,MAAM,WAAW,CAAC;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AC/C,oEAAoE;YACpE,OAAO,EAAE,KAAK,EAAE,GAAG,CAAC,IAAI,IAAI,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC;QAC1C,CAAC;QAED,uBAAuB;QACvB,MAAM,IAAI,KAAK,CAAC,MAAM,CAAC,CAAC;IAC1B,CAAC;IAED;;;;;OAKG;IACH,MAAM,CAAC,QAAQ,CAAC,GAAqB;QACnC,MAAM,SAAS,GAAG,SAAS,CAAC;QAC5B,OAAO,MAAM,gBAAiB,SAAQ,SAAS;YAC7C,YAAY,OAAe,EAAE,UAA4B,EAAE;gBACzD,KAAK,CAAC,OAAO,EAAE,EAAE,GAAG,GAAG,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;YACzC,CAAC;YACD,MAAM,CAAU,QAAQ,CACtB,OAAyB;gBAEzB,OAAO,SAAS,CAAC,QAAQ,CAAC,EAAE,GAAG,GAAG,EAAE,GAAG,OAAO,EAAE,CAA4B,CAAC;YAC/E,CAAC;SACF,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Options translator: minimatch options -> picomatch options
|
|
3
|
+
*
|
|
4
|
+
* This module handles the translation of minimatch options to picomatch options.
|
|
5
|
+
* Since minimatch-fast uses picomatch as its matching engine, we need to map
|
|
6
|
+
* the options from minimatch's API to picomatch's API.
|
|
7
|
+
*
|
|
8
|
+
* Key differences between minimatch and picomatch options:
|
|
9
|
+
* - noext (minimatch) -> noextglob (picomatch)
|
|
10
|
+
* - matchBase (minimatch) -> basename (picomatch)
|
|
11
|
+
*
|
|
12
|
+
* Some options are handled specially and not passed to picomatch:
|
|
13
|
+
* - nocomment: Comment patterns (handled in Minimatch class)
|
|
14
|
+
* - nonull: Return pattern when no matches (handled in match function)
|
|
15
|
+
* - flipNegate: Invert negation result (handled in match function)
|
|
16
|
+
*
|
|
17
|
+
* @author 686f6c61
|
|
18
|
+
* @see https://github.com/686f6c61/minimatch-fast
|
|
19
|
+
* @license MIT
|
|
20
|
+
*/
|
|
21
|
+
import type { MinimatchOptions, TranslatedOptions } from './types.js';
|
|
22
|
+
/**
|
|
23
|
+
* Translate minimatch options to picomatch options
|
|
24
|
+
* Handles naming differences and sets appropriate defaults
|
|
25
|
+
*/
|
|
26
|
+
export declare function translateOptions(opts?: MinimatchOptions): TranslatedOptions;
|
|
27
|
+
/**
|
|
28
|
+
* Merge options with defaults
|
|
29
|
+
*/
|
|
30
|
+
export declare function mergeOptions(defaults: MinimatchOptions, options: MinimatchOptions): MinimatchOptions;
|
|
31
|
+
//# sourceMappingURL=options.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../src/options.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAoB,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAExF;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,GAAE,gBAAqB,GAAG,iBAAiB,CAqC/E;AAED;;GAEG;AACH,wBAAgB,YAAY,CAC1B,QAAQ,EAAE,gBAAgB,EAC1B,OAAO,EAAE,gBAAgB,GACxB,gBAAgB,CAElB"}
|