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.
Record<string, string[]>
Static
Detects cycles in a dependency graph using Kahn's topological sort.
Map of node ID → list of dependency IDs.
null if the graph is acyclic, or an array of node IDs involved in a cycle if one is found.
null
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.