* Intersect the edges in the traversal with another traversal. * @param other The other traversal to intersect with.
(
other: EdgeTraversal<TSchema, TOtherPath>,
)
| 2149 | * @param other The other traversal to intersect with. |
| 2150 | */ |
| 2151 | public intersect<const TOtherPath extends TraversalPath<any, any, any>>( |
| 2152 | other: EdgeTraversal<TSchema, TOtherPath>, |
| 2153 | ) { |
| 2154 | type TIntersection = |
| 2155 | TPath extends TraversalPath<any, infer TValue, any> |
| 2156 | ? TOtherPath extends TraversalPath<any, infer TOtherValue, any> |
| 2157 | ? TraversalPath<any, TValue & TOtherValue, any> |
| 2158 | : never |
| 2159 | : TPath & TOtherPath; |
| 2160 | return new EdgeTraversal<TSchema, TIntersection>(this.graph, [ |
| 2161 | ...this.steps, |
| 2162 | new IntersectStep({}, other.steps), |
| 2163 | ]); |
| 2164 | } |
| 2165 | |
| 2166 | /** |
| 2167 | * Deduplicate the edges in the traversal. |
no outgoing calls
no test coverage detected