File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change 44Topological sorting for JavaScript.
55See [ docs] ( https://aureooms.github.io/js-topological-sorting/index.html ) .
66
7- > :building_construction : Caveat emptor! This is work in progress. Code may be
8- > working. Documentation may be present. Coherence may be. Maybe.
9-
107> :warning : The code requires ` regeneratorRuntime ` to be defined, for instance by importing
118> [ regenerator-runtime/runtime] ( https://www.npmjs.com/package/regenerator-runtime ) .
129
10+ ``` js
11+ // Sort anything that can be iterated over with `for (const [u, v] of ...)`
12+ import {sorted } from ' @aureooms/js-topological-sorting' ;
13+ sorted ([" ab" , " bc" ]); // abc
14+
15+ // Add a comparison function to break ties.
16+ import {increasing } from ' @aureooms/js-compare' ;
17+ sorted ([" ab" , " cd" ], increasing); // acbd
18+ ```
19+
1320[ ![ License] ( https://img.shields.io/github/license/aureooms/js-topological-sorting.svg )] ( https://raw.githubusercontent.com/aureooms/js-topological-sorting/main/LICENSE )
1421[ ![ Version] ( https://img.shields.io/npm/v/@aureooms/js-topological-sorting.svg )] ( https://www.npmjs.org/package/@aureooms/js-topological-sorting )
1522[ ![ Build] ( https://img.shields.io/travis/aureooms/js-topological-sorting/main.svg )] ( https://travis-ci.org/aureooms/js-topological-sorting/branches )
You can’t perform that action at this time.
0 commit comments