- Match each path portion with
Matcherfrom@isaacs/nonrecursive-glob-match, in place of aRegExp. Items inMinimatch.setare now strings,Matcherobjects, orGLOBSTAR. - Remove
makeRe(),Minimatch#regexp, and theMMRegExptype. - Remove the
ASTclass. - Remove the
maxExtglobRecursionoption. - An empty path portion, such as the last one in
a/b/, only matches an empty pattern portion. Soa/b/no longer matchesa/b/?(x)ora/b/*(x), the same asa/b/*. - Add the
normalizeoption, to normalize unicode in the pattern and in each portion of the tested path. - Remove the
debugoption and thedebug()method. - Remove the
matchOne(),slashSplit(), andlevelTwoFileOptimize()methods. They are internal now. - Fix patterns with more than one
**and sections of different lengths between them, such as**/a/b/c/**/d/**, which failed to match some paths since 10.2.3. - Fix
partialmatching of patterns with**, which since 10.2.3 matched some paths under a dot portion that**can not walk, and did not match some paths that end in the pattern's last portion. partialmatching of patterns with many**no longer takes exponential time.- On Windows, a
..no longer removes the drive letter, or the host and share of a UNC path, at the start of a pattern or (at optimization level 2) a path. SoC:/a/../../xno longer matchesxor/x. - On Windows, compare the host and share of UNC paths like
//host/share/...case-insensitively, the same as drive letters. - On Windows, long UNC paths like
//?/UNC/host/share/...match//host/share/...and vice versa, the same as//?/c:/...andc:/.... - At optimization level 2, stop splitting
**/..portions once there arebraceExpandMaxpatterns, and do not dedupe sets of more than 1000 patterns. Before, a short pattern could take minutes to compile. minimatch()keeps the 256Minimatchobjects that it used most recently, so it does not compile the same pattern again.- Faster to compile brace patterns that make rows that are merged,
such as
**/*.{png,jpg,gif}, because theMatchers for the rows that are merged are not made.
- Add
braceExpandMaxoption
- Add
magicalBracesoption forescape - Fix
makeRewhenpartial: trueis set. - Fix
makeRewhen pattern ends in a final**path part.
- Require node 20 or 22 and higher
- No default export, only named exports.
- Recursive descent parser for extglob, allowing correct support for arbitrarily nested extglob expressions
- Bump required Node.js version
- Add
escape()method - Add
unescape()method - Add
Minimatch.hasMagic()method
- Add support for posix character classes in a unicode-aware way.
- Add
windowsNoMagicRootoption
- Add
optimizationLevelconfiguration option, and revert the default back to the 6.2 style minimal optimizations, making the advanced transforms introduced in 7.0 opt-in. Also, process provided file paths in the same way in optimizationLevel:2 mode, so most things that matched with optimizationLevel 1 or 0 should match with level 2 as well. However, level 1 is the default, out of an abundance of caution.
- Preprocess patterns to simplify complicated patterns and reduce
out
..pattern portions where possible. Note that this means a pattern likea/b/../*will be equivalent toa/*, and will not match the stringa/b/../c. If this causes problems, it can be addressed in a patch release by resolving..portions in the test string.
- Add nocaseMagicOnly flag
-
Handle UNC paths on Windows
This adds some slightly modified behavior when a pattern or path starts with
//on Windows.- In the case of
//?/<drive letter>:/..., the?is treated as a literal character, rather than a wildcard. That is,//?/c:will not match//x/c:. - UNC patterns starting with
//?/<drive letter>:/will match file paths starting with<drive letter>:if the drive letters match case-insensitively. - File paths starting with
//?/<drive letter>:/will match file patterns starting with<drive letter>:if the drive letters match case-insensitively.
- In the case of
-
Add
{preserveMultipleSlashes:true}option to suppress the behavior where multiple consecutive/characters would be effectively coerced into a single path portion separator.
- hybrid module supporting both
require()andimport - exported types
- use windowsPathNoEscape/allowWindowsEscape opts
- make character classes more faithful to bash glob behavior
- fix handling of escapes
- treat invalid character classes as non-matching pattern rather than escaped literals
- brace-expansion: ignore only blocks that begins with $
- Expect exclusively forward slash as path sep, same as node-glob
- makeRe: globstar should match zero+ path portions
- Fix bug with escaped '@' in patterns
- treat
nocase:trueas always having magic - expose GLOBSTAR marker
- Update to modern JS syntax
- Add
allowWindowsEscapeoption
- Added basic redos protection
- Handle unfinished
!(extglob patterns - Add
partial: trueoption