class Visitor {
  #seen = /* @__PURE__ */ new Set();
  #dagRead;
  constructor(dagRead) {
    this.#dagRead = dagRead;
  }
  async visit(h) {
    if (this.#seen.has(h)) {
      return;
    }
    this.#seen.add(h);
    const chunk = await this.#dagRead.mustGetChunk(h);
    await this.visitChunk(chunk);
  }
  async visitChunk(chunk) {
    await Promise.all(chunk.meta.map((ref) => this.visit(ref)));
  }
}
export {
  Visitor
};
//# sourceMappingURL=visitor.js.map
