diff options
author | Andrew Harvey <andrew@alantgeo.com.au> | 2021-05-13 14:14:54 +1000 |
---|---|---|
committer | Andrew Harvey <andrew@alantgeo.com.au> | 2021-05-13 14:14:54 +1000 |
commit | 9e2c8a7a3964363b12559c91ea55d9f80659fa11 (patch) | |
tree | 03153ad076aaee08d547c84995971db198edb910 /lib | |
parent | 178fcab8c091f197f153bd0b730a5175a790a9fb (diff) |
log message when regexp didn't match for prefix number suffix
Diffstat (limited to 'lib')
-rw-r--r-- | lib/unitsToRanges.js | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/unitsToRanges.js b/lib/unitsToRanges.js index eebd3ef..11e867f 100644 --- a/lib/unitsToRanges.js +++ b/lib/unitsToRanges.js @@ -63,6 +63,11 @@ module.exports = (units) => { const curParts = cur.match(regexp) const prevParts = idx > 0 ? src[idx - 1].match(regexp) : null + if (!curParts) { + console.log(`"${cur}" didn't match regexp for prefix number suffix`) + return acc + } + const curNum = curParts.groups.num const prevNum = prevParts ? prevParts.groups.num : null |