Skip to content

rune-langium / visual-editor/src / detectCircularInheritance

Function: detectCircularInheritance()

ts
function detectCircularInheritance(
   childId, 
   parentId, 
   edges): boolean;

Defined in: packages/visual-editor/src/validation/edit-validator.ts:31

Detect whether setting childId extends parentId would create a cycle.

Walks the inheritance chain from parentId upward; if it reaches childId, a cycle exists.

Parameters

ParameterType
childIdstring
parentIdstring
edgesTypeGraphEdge[]

Returns

boolean

Core packages released under MIT. Studio app released under FSL-1.1-ALv2.