MCPcopy Create free account
hub / github.com/codemix/graph / traverse

Method traverse

packages/graph/src/Steps.ts:2564–2586  ·  view source on GitHub ↗
(
    _source: GraphSource<any>,
    input: Iterable<TraversalPath<any, any, any>>,
    _context?: QueryContext,
  )

Source from the content-addressed store, hash-verified

2562 }
2563
2564 public *traverse(
2565 _source: GraphSource<any>,
2566 input: Iterable<TraversalPath<any, any, any>>,
2567 _context?: QueryContext,
2568 ): IterableIterator<TraversalPath<any, any, any>> {
2569 const { start, end } = this.config;
2570 let index = 0;
2571 for (const path of input) {
2572 this.traversed++;
2573 if (index >= start) {
2574 if (index < end) {
2575 this.emitted++;
2576 yield path;
2577 if (index === end - 1) {
2578 break;
2579 }
2580 } else {
2581 break;
2582 }
2583 }
2584 index++;
2585 }
2586 }
2587
2588 public override clone(partial?: Partial<RangeStepConfig>) {
2589 const { config } = this;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected