Skip to content

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.

ParameterTypeDescription
aSegmentPatternThe first segment-pattern.
bSegmentPatternThe second segment-pattern.
opts?OptionsMatching semantics (Options); defaults apply when omitted.

SegmentPattern | null

A SegmentPattern both a and b match, or null if none exists.

witness(["src", "api", "**"], ["src", "**", "handler.ts"]); // ["src", "api", "handler.ts"]
witness(["src", "api", "**"], ["src", "web", "**"]); // null