Add testing script for cyclical dependencies
parent
a76b759a01
commit
a067c361e5
@ -0,0 +1,20 @@
|
||||
"use strict";
|
||||
|
||||
/*
|
||||
parents == dependencies == before
|
||||
children == dependents == after
|
||||
*/
|
||||
|
||||
const sortDependencies = require("../sort-dependencies");
|
||||
|
||||
let items = [
|
||||
{ id: 0, deps: { 1:1 } },
|
||||
{ id: 1, deps: { 2:2, 3:3, 4:4 } },
|
||||
// { id: 2, deps: {} },
|
||||
{ id: 2, deps: { 0:0 } },
|
||||
{ id: 3, deps: {} },
|
||||
{ id: 4, deps: {} },
|
||||
];
|
||||
|
||||
console.log(sortDependencies(items, {}, { ignoreCycles: true }));
|
||||
|
Loading…
Reference in New Issue