@cdk-x/core
    Preparing search index...

    Class CycleDetector

    Pure utility for detecting cycles in a dependency graph.

    Operates on a plain Record<string, string[]> dependency map where each key is a node ID and its value is the list of node IDs it depends on.

    Index

    Constructors

    Methods

    Constructors

    Methods

    • Detects cycles in a dependency graph using Kahn's topological sort.

      Parameters

      • deps: Record<string, string[]>

        Map of node ID → list of dependency IDs.

      Returns string[] | null

      null if the graph is acyclic, or an array of node IDs involved in a cycle if one is found.