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

Method traverse

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

Source from the content-addressed store, hash-verified

4796 }
4797
4798 public *traverse(
4799 _source: GraphSource<any>,
4800 input: Iterable<unknown>,
4801 _context?: QueryContext,
4802 ): IterableIterator<string[] | string | null> {
4803 for (const item of input) {
4804 this.traversed++;
4805 const result = this.#extractLabel(item);
4806 // 'skip' means we couldn't process this item (shouldn't happen in normal use)
4807 if (result !== "skip") {
4808 this.emitted++;
4809 yield result;
4810 }
4811 }
4812 }
4813
4814 #extractLabel(item: unknown): string | string[] | null | "skip" {
4815 // Handle arrays from SelectStep (first element is the path)

Callers

nothing calls this directly

Calls 1

#extractLabelMethod · 0.95

Tested by

no test coverage detected