aboutsummaryrefslogtreecommitdiff
path: root/bin/reduceOverlap.js
diff options
context:
space:
mode:
authorAndrew Harvey <andrew@alantgeo.com.au>2021-07-05 23:41:35 +1000
committerAndrew Harvey <andrew@alantgeo.com.au>2021-07-05 23:41:35 +1000
commit9e3708dca0c07765ea047846fac0015c067308a2 (patch)
tree82ab801189141e189ee61603126c0dfff2501458 /bin/reduceOverlap.js
parent6a9a77e4860b9c64ee1fd6de86025268570696cb (diff)
fix reduce overlap where range is first
Diffstat (limited to 'bin/reduceOverlap.js')
-rwxr-xr-xbin/reduceOverlap.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/bin/reduceOverlap.js b/bin/reduceOverlap.js
index 0941f49..695d5f6 100755
--- a/bin/reduceOverlap.js
+++ b/bin/reduceOverlap.js
@@ -120,6 +120,9 @@ const reduce = new Transform({
if (cur && cur.split('-').length === 2) {
cur = cur.split('-')[0]
}
+ if (acc && acc.split('-').length === 2) {
+ acc = acc.split('-')[0]
+ }
return (cur < acc) ? cur : acc
}) : null
@@ -127,6 +130,9 @@ const reduce = new Transform({
if (cur && cur.split('-').length === 2) {
cur = cur.split('-')[1]
}
+ if (acc && acc.split('-').length === 2) {
+ acc = acc.split('-')[1]
+ }
return (cur > acc) ? cur : acc
}) : null