UNPKG

archunit

Version:

ArchUnit TypeScript is an architecture testing library, to specify and assert architecture rules in your TypeScript app

22 lines 828 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.exportDiagram = void 0; const exportDiagram = (graph) => { let output = '@startuml\n'; // Extract all unique vertices from edges const vertices = new Set(graph.flatMap((edge) => [edge.sourceLabel, edge.targetLabel])); // Add component declarations for (const vertex of vertices.values()) { output += `component [${vertex}]\n`; } // Add relationships between components, excluding self-referencing edges for (const edge of graph) { if (edge.sourceLabel !== edge.targetLabel) { output += `[${edge.sourceLabel}] --> [${edge.targetLabel}]\n`; } } output += '@enduml'; return output; }; exports.exportDiagram = exportDiagram; //# sourceMappingURL=export-diagram.js.map