aboutsummaryrefslogtreecommitdiff
path: root/lib/unitsToRanges.js
diff options
context:
space:
mode:
authorAndrew Harvey <andrew@alantgeo.com.au>2021-05-14 16:01:33 +1000
committerAndrew Harvey <andrew@alantgeo.com.au>2021-05-14 16:01:33 +1000
commitf636c81824436a31c47ce164a59e1aeacfd6551d (patch)
tree0dd74374d46628db1e80fbc7a856ec908f1b9324 /lib/unitsToRanges.js
parent55d89bc49d9fba94219306b95ebef41eec198be9 (diff)
handle duplicate units when converting to ranges
Diffstat (limited to 'lib/unitsToRanges.js')
-rw-r--r--lib/unitsToRanges.js2
1 files changed, 1 insertions, 1 deletions
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) {