fast-glob
fast-glob copied to clipboard
[Feature Request] provide a test function to see if a path is matched by target pattern(s)
Assume the future method is called isMatch(filePath, patterns, options)
then I want to achieve the follow:
fastGlob.isMatch('./package.json', ['src/*.json'])
// return false
Note: A hidden requirement is I want to keep the ability to constraint the patterns under specify scope (aka cwd
). Otherwise i could use micromatch
directly.
guided from https://github.com/sindresorhus/globby/issues/93
I correctly understand that under the options
argument you understand options for FastGlob?
@mrmlnc sorry, I don't understand your words. In the provided example I just use the default options.
I'll mark this question as an improvement. But I'm not sure that this method is needed within this package.
It is not planned to implement, as this functionality is outside the scope of this package. This package provides functionality for searching entries by glob patterns and utilities for preparing these glob patterns.
The requested functionality directly relates to matching a mask to a path. You can use micromatch or any other analog for this purpose.