You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
minimatch has a partial option that seems to do a partial match. This is great for optimizations in path traversal libraries. As per minimatch's docs:
partial
Compare a partial path to a pattern. As long as the parts of the path that
are present are not contradicted by the pattern, it will be treated as a
match. This is useful in applications where you're walking through a
folder structure, and don't yet have the full path, but want to ensure that
you do not walk down paths that can never be a match.
For example,
minimatch('/a/b','/a/*/c/d',{partial: true})// true, might be /a/b/c/dminimatch('/a/b','/**/d',{partial: true})// true, might be /a/b/.../dminimatch('/x/y/z','/a/**/z',{partial: true})// false, because x !== a
I am building a library that would greatly benefit from this functionality, but I also would rather not switch to minimatch as I greatly value picomatch's advantages in terms of performance. It also seems like I'm not the first one to suggest this, as someone also opened a feature request in micromatch (micromatch/micromatch#276).
minimatch
has apartial
option that seems to do a partial match. This is great for optimizations in path traversal libraries. As perminimatch
's docs:I am building a library that would greatly benefit from this functionality, but I also would rather not switch to
minimatch
as I greatly valuepicomatch
's advantages in terms of performance. It also seems like I'm not the first one to suggest this, as someone also opened a feature request inmicromatch
(micromatch/micromatch#276).Many existing libraries that make use of
picomatch
(that currently implement this behavior themselves) would also benefit from this, such asfast-glob
: https://github.com/mrmlnc/fast-glob/blob/096a5b620f4224eb692bd8ff2c8de0e634e50d8e/src/providers/matchers/partial.tsThe text was updated successfully, but these errors were encountered: