File tree 1 file changed +10
-3
lines changed
1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change 4
4
Topological sorting for JavaScript.
5
5
See [ docs] ( https://aureooms.github.io/js-topological-sorting/index.html ) .
6
6
7
- > :building_construction : Caveat emptor! This is work in progress. Code may be
8
- > working. Documentation may be present. Coherence may be. Maybe.
9
-
10
7
> :warning : The code requires ` regeneratorRuntime ` to be defined, for instance by importing
11
8
> [ regenerator-runtime/runtime] ( https://www.npmjs.com/package/regenerator-runtime ) .
12
9
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
+
13
20
[ ![ License] ( https://img.shields.io/github/license/aureooms/js-topological-sorting.svg )] ( https://raw.githubusercontent.com/aureooms/js-topological-sorting/main/LICENSE )
14
21
[ ![ Version] ( https://img.shields.io/npm/v/@aureooms/js-topological-sorting.svg )] ( https://www.npmjs.org/package/@aureooms/js-topological-sorting )
15
22
[ ![ 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