Skip to content

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).

intersects(other): boolean

Does this set overlap another pattern-set or matcher?

ParameterType
otherPatterns | Matcher

boolean


matches(path): boolean

Does a concrete path match this set?

ParameterType
pathstring

boolean


overlapping(candidates): string[]

Which of candidates overlap this set, in the order given (filters the argument).

ParameterType
candidatesreadonly string[]

string[]


witness(other): string | null

An example path common to this set and other, or null.

ParameterType
otherPatterns | Matcher

string | null

PropertyModifierTypeDescription
patternsreadonlyreadonly string[]The source patterns, normalized to an array.