matches
matches(
path,pattern,opts?):boolean
Does a concrete segmented path match a segment-pattern? The degenerate case
of intersects: a concrete path is a literal SegmentPattern, so it
intersects pattern exactly when it matches it.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
path | SegmentPattern | The concrete path, already split into segments. |
pattern | SegmentPattern | The segment-pattern to test against. |
opts? | Options | Matching semantics (Options); defaults apply when omitted. |
Returns
Section titled “Returns”boolean
true when path falls within pattern, else false.
Example
Section titled “Example”matches(["src", "api", "user.ts"], ["src", "**", "*.ts"]); // truematches(["README.md"], ["src", "**"]); // false