From 9e3708dca0c07765ea047846fac0015c067308a2 Mon Sep 17 00:00:00 2001 From: Andrew Harvey Date: Mon, 5 Jul 2021 23:41:35 +1000 Subject: fix reduce overlap where range is first --- bin/reduceOverlap.js | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'bin/reduceOverlap.js') 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 -- cgit v1.2.3