diff --git a/.eslintrc b/.eslintrc index 35fcf812c52bbe09b314d5fc27dcbd243e139f55..f1ccc5c94aa713d7bf861668085574b7774d0549 100644 --- a/.eslintrc +++ b/.eslintrc @@ -9,5 +9,6 @@ rules: "func-names": 0 "guard-for-in": 0 "no-undefined": 0 + "consistent-return": 0 "no-nested-ternary": 0 "no-extend-native": ["error", { "exceptions": ["String"] }] diff --git a/lib/proportions.js b/lib/proportions.js index 12121cb8f438f6bcad17d0ef49ce3add9ca6d32a..4d2125ab6623f63a2f7f2e8cb60db70159ba544d 100644 --- a/lib/proportions.js +++ b/lib/proportions.js @@ -110,9 +110,10 @@ define(['d3-interpolate', 'snabbdom', 'utils/version', 'filters/genericnode', 'h var domainDict = count(nodes, ['domain'], function (d) { if (config.domainNames) { - config.domainNames.forEach(function (t) { + config.domainNames.some(function (t) { if (d === t.domain) { d = t.name; + return true; } }); } diff --git a/lib/utils/node.js b/lib/utils/node.js index f2412434e6345568651b1ac50dad713a82713fdb..9df5aa8b5b8994551a106b7fdadad7f45adff4b0 100644 --- a/lib/utils/node.js +++ b/lib/utils/node.js @@ -71,9 +71,10 @@ define(['snabbdom', 'helper', 'moment'], function (V, helper, moment) { self.showDomain = function showDomain(d) { var rt = d.domain; if (config.domainNames) { - config.domainNames.forEach(function (t) { - if (d.domain === t.domain) { + config.domainNames.some(function (t) { + if (rt === t.domain) { rt = t.name; + return true; } }); }