Skip to content

Commit

Permalink
Merge pull request #409 from RohitPaul0007/patch-52
Browse files Browse the repository at this point in the history
Update build-layer-graph.js
  • Loading branch information
rustedgrail committed Sep 11, 2023
2 parents 25b481f + a421843 commit f7d87ce
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/order/build-layer-graph.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
var Graph = require("@dagrejs/graphlib").Graph;
var util = require("../util");
let Graph = require("@dagrejs/graphlib").Graph;
let util = require("../util");

module.exports = buildLayerGraph;

Expand Down Expand Up @@ -34,12 +34,12 @@ module.exports = buildLayerGraph;
* graph is not a multi-graph.
*/
function buildLayerGraph(g, rank, relationship) {
var root = createRootNode(g),
let root = createRootNode(g),
result = new Graph({ compound: true }).setGraph({ root: root })
.setDefaultNodeLabel(v => g.node(v));

g.nodes().forEach(v => {
var node = g.node(v),
let node = g.node(v),
parent = g.parent(v);

if (node.rank === rank || node.minRank <= rank && rank <= node.maxRank) {
Expand Down

0 comments on commit f7d87ce

Please sign in to comment.