witness
witness(
a,b,opts?):string|null
An example path common to both sets (turns “overlap” into “overlap at X”), or
null when disjoint.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
a | Patterns | The first pattern-set (Patterns). |
b | Patterns | The second pattern-set (Patterns). |
opts? | Options | Matching semantics (Options); defaults apply when omitted. |
Returns
Section titled “Returns”string | null
A concrete path matching both sets, or null if none exists.
Example
Section titled “Example”witness("src/api/**", "src/api/handler.ts"); // "src/api/handler.ts" — a path both matchwitness("src/api/**", "src/web/**"); // null — no common path