Throws "cyclic dependency" error where there is none
alexlawrence opened this issue · comments
Alex Lawrence commented
Again if I am not mistaken the following is a bug.
If a depdends on b & c and b also depends on c this is perfectly fine. However the following call results in an error:
toposort([['a', 'b'], ['a', 'c'], ['b', 'c']]);
Gustavo Henke commented
In my package toposort-class, the following code gives you the desired output:
var Toposort = require("toposort-class"),
t = new Toposort();
t.add("a", ["b", "c"]);
t.add("b", "c");
// Actually you may want to call .reverse()
console.log(t.sort());
Marcel Klehr commented
In the latest version of my package toposort, the above bug is fixed ;)
@gustavohenke: nice API, btw