UNPKG

mermaid

Version:

Markdown-ish syntax for generating flowcharts, mindmaps, sequence diagrams, class diagrams, gantt charts, git graphs and more.

22 lines (19 loc) • 540 B
import { __name } from "./chunk-42YUCIBL.mjs"; // src/diagrams/common/containment.ts var wouldCreateContainmentCycle = /* @__PURE__ */ __name((childId, parentId, getParentId) => { const visited = /* @__PURE__ */ new Set(); let currentId = parentId; while (currentId !== void 0 && !visited.has(currentId)) { if (currentId === childId) { return true; } visited.add(currentId); currentId = getParentId(currentId); } return false; }, "wouldCreateContainmentCycle"); export { wouldCreateContainmentCycle };