matches
matches(
path,patterns,opts?):boolean
Does a concrete path match any pattern in the set?
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
path | string | The concrete path to test. |
patterns | Patterns | The pattern-set to test against (Patterns). |
opts? | Options | Matching semantics (Options); defaults apply when omitted. |
Returns
Section titled “Returns”boolean
true when path matches at least one pattern, else false.
Example
Section titled “Example”matches("src/api/user.ts", ["src/api/**", "docs/**"]); // true (first pattern)matches("README.md", ["src/api/**", "docs/**"]); // false