* Get a node in the path by label. * @param label The label to get the node by.
(
label: TLabel,
)
| 214 | * @param label The label to get the node by. |
| 215 | */ |
| 216 | public get<const TLabel extends string>( |
| 217 | label: TLabel, |
| 218 | ): GetTraversalPathByLabel<TraversalPath<TParent, TValue, TLabels>, TLabel> { |
| 219 | let node: TraversalPath<any, any, any> = this; |
| 220 | while (node !== undefined) { |
| 221 | if (node.labels.includes(label)) { |
| 222 | return node as GetTraversalPathByLabel<TraversalPath<TParent, TValue, TLabels>, TLabel>; |
| 223 | } |
| 224 | node = node.parent; |
| 225 | } |
| 226 | return undefined as GetTraversalPathByLabel<TraversalPath<TParent, TValue, TLabels>, TLabel>; |
| 227 | } |
| 228 | |
| 229 | /** |
| 230 | * Get all the node in the path by label. |
nothing calls this directly
no outgoing calls
no test coverage detected