Matcher
A compiled pattern-set for amortized queries against many paths/patterns.
Built by compile, which parses each pattern once; every method reuses
that parsed set. Its overlapping filters the ARGUMENT (contrast the free
overlapping, which filters its first argument).
Methods
Section titled “Methods”intersects()
Section titled “intersects()”intersects(
other):boolean
Does this set overlap another pattern-set or matcher?
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
other | Patterns | Matcher |
Returns
Section titled “Returns”boolean
matches()
Section titled “matches()”matches(
path):boolean
Does a concrete path match this set?
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
path | string |
Returns
Section titled “Returns”boolean
overlapping()
Section titled “overlapping()”overlapping(
candidates):string[]
Which of candidates overlap this set, in the order given (filters the argument).
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
candidates | readonly string[] |
Returns
Section titled “Returns”string[]
witness()
Section titled “witness()”witness(
other):string|null
An example path common to this set and other, or null.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
other | Patterns | Matcher |
Returns
Section titled “Returns”string | null
Properties
Section titled “Properties”| Property | Modifier | Type | Description |
|---|---|---|---|
patterns | readonly | readonly string[] | The source patterns, normalized to an array. |