From a016e9baee32955a3b26dab78abd3677605aa687 Mon Sep 17 00:00:00 2001 From: Rohit Paul <113459757+RohitPaul0007@users.noreply.github.com> Date: Sun, 10 Sep 2023 21:52:59 +0530 Subject: [PATCH] Update add-border-segments.js --- lib/add-border-segments.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/add-border-segments.js b/lib/add-border-segments.js index 0c0a077c..e8871182 100644 --- a/lib/add-border-segments.js +++ b/lib/add-border-segments.js @@ -1,11 +1,11 @@ -var util = require("./util"); +let util = require("./util"); module.exports = addBorderSegments; function addBorderSegments(g) { function dfs(v) { - var children = g.children(v); - var node = g.node(v); + let children = g.children(v); + let node = g.node(v); if (children.length) { children.forEach(dfs); } @@ -13,7 +13,7 @@ function addBorderSegments(g) { if (node.hasOwnProperty("minRank")) { node.borderLeft = []; node.borderRight = []; - for (var rank = node.minRank, maxRank = node.maxRank + 1; + for (let rank = node.minRank, maxRank = node.maxRank + 1; rank < maxRank; ++rank) { addBorderNode(g, "borderLeft", "_bl", v, node, rank); @@ -26,9 +26,9 @@ function addBorderSegments(g) { } function addBorderNode(g, prop, prefix, sg, sgNode, rank) { - var label = { width: 0, height: 0, rank: rank, borderType: prop }; - var prev = sgNode[prop][rank - 1]; - var curr = util.addDummyNode(g, "border", label, prefix); + let label = { width: 0, height: 0, rank: rank, borderType: prop }; + let prev = sgNode[prop][rank - 1]; + let curr = util.addDummyNode(g, "border", label, prefix); sgNode[prop][rank] = curr; g.setParent(curr, sg); if (prev) {