UNPKG

topological-sort-group

Version:

Topological sorting and cycle detection. Optional grouping for parallel processing

5 lines (4 loc) 258 B
import type Graph from './Graph.js'; import type { Key } from './types.js'; import { SortMode, type SortResult } from './types.js'; export default function sort<T extends Key>(graph: Graph<T>, mode?: (typeof SortMode)[keyof typeof SortMode]): SortResult<T>;