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

Method traverse

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

Source from the content-addressed store, hash-verified

4873 }
4874
4875 public *traverse(
4876 _source: GraphSource<any>,
4877 input: Iterable<TraversalPath<any, any, any>>,
4878 _context?: QueryContext,
4879 ): IterableIterator<TraversalPath<any, any, any>> {
4880 const { pathVariable } = this.config;
4881
4882 for (const path of input) {
4883 this.traversed++;
4884 // Bind the entire path to the path variable
4885 // The path itself becomes the value, with the pathVariable as the label
4886 const boundPath = path.with(path, [pathVariable]);
4887 this.emitted++;
4888 yield boundPath;
4889 }
4890 }
4891
4892 public override clone(partial?: Partial<BindPathStepConfig>) {
4893 return new BindPathStep({

Callers

nothing calls this directly

Calls 1

withMethod · 0.80

Tested by

no test coverage detected