From f636c81824436a31c47ce164a59e1aeacfd6551d Mon Sep 17 00:00:00 2001 From: Andrew Harvey Date: Fri, 14 May 2021 16:01:33 +1000 Subject: handle duplicate units when converting to ranges --- lib/unitsToRanges.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/unitsToRanges.js b/lib/unitsToRanges.js index cd572f7..e73388a 100644 --- a/lib/unitsToRanges.js +++ b/lib/unitsToRanges.js @@ -54,7 +54,7 @@ module.exports = (units, sourceAddresses) => { const existingRanges = [] // adapted from https://stackoverflow.com/a/54973116/6702659 - const formedRanges = expandedUnits + const formedRanges = [...new Set(expandedUnits)] .slice() .map(unit => { if (unit.split('-').length > 1) { -- cgit v1.2.3