whichMatch
whichMatch(
path,patterns,opts?):string[]
Which patterns in the set match a concrete path, in the order given.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
path | string | The concrete path to test. |
patterns | Patterns | The pattern-set to filter (Patterns). |
opts? | Options | Matching semantics (Options); defaults apply when omitted. |
Returns
Section titled “Returns”string[]
The subset of patterns that match path, in input order.
Example
Section titled “Example”whichMatch("src/api/user.ts", ["src/api/**", "src/**", "docs/**"]);// → ["src/api/**", "src/**"] (docs/** does not match)