witness
witness(
a,b,opts?):SegmentPattern|null
An example common path (the reachability witness), or null when disjoint.
Turns “these overlap” into “these overlap at X”. The witness is free — it is
the path the engine already walked to prove intersects.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
a | SegmentPattern | The first segment-pattern. |
b | SegmentPattern | The second segment-pattern. |
opts? | Options | Matching semantics (Options); defaults apply when omitted. |
Returns
Section titled “Returns”SegmentPattern | null
A SegmentPattern both a and b match, or null if none exists.
Example
Section titled “Example”witness(["src", "api", "**"], ["src", "**", "handler.ts"]); // ["src", "api", "handler.ts"]witness(["src", "api", "**"], ["src", "web", "**"]); // null