createGlobMatcher
createMatcher with every string read as a glob (*, ?): no string is ever taken
for a regular expression, so it never throws. The right choice for paths and file names.
Available since v3.1.5
Import
Section titled “Import”Signature
Section titled “Signature”Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
pattern | MatcherPattern | readonly MatcherPattern[] | A pattern, or an array of patterns and `!` exclusions |
options | Omit<MatcherOptions, "syntax"> | Case sensitivity |
Returns
Section titled “Returns”function — A function telling whether a string matches
Examples
Section titled “Examples”Filter paths
Section titled “Filter paths”Strings are always globs, so a path is never taken for a regular expression.
Ignore case
Section titled “Ignore case”caseSensitive: false matches letters of any case.
Related Types
Section titled “Related Types”MatcherOptions
Section titled “MatcherOptions”Options for createMatcher and createSafeMatcher.
MatcherPattern
Section titled “MatcherPattern”One pattern accepted by createMatcher: a string (read according to
MatcherOptions.syntax), a RegExp, or a predicate of your own.
