<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@essex/toposort](./toposort.md) &gt; [toposort](./toposort.toposort.md)

## toposort() function

Toposort an edge list

<b>Signature:</b>

```typescript
export declare function toposort<T = string>(edges: ReadonlyArray<[T, T | undefined]>): T[];
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  edges | ReadonlyArray&lt;\[T, T \| undefined\]&gt; | the edge list |

<b>Returns:</b>

T\[\]

the topologically sorted node array

