diff options
author | Andrew Harvey <andrew@alantgeo.com.au> | 2021-07-05 23:41:35 +1000 |
---|---|---|
committer | Andrew Harvey <andrew@alantgeo.com.au> | 2021-07-05 23:41:35 +1000 |
commit | 9e3708dca0c07765ea047846fac0015c067308a2 (patch) | |
tree | 82ab801189141e189ee61603126c0dfff2501458 /bin/reduceOverlap.js | |
parent | 6a9a77e4860b9c64ee1fd6de86025268570696cb (diff) |
fix reduce overlap where range is first
Diffstat (limited to 'bin/reduceOverlap.js')
-rwxr-xr-x | bin/reduceOverlap.js | 6 |
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 |