diff --git a/classes/range.js b/classes/range.js index a791d912..c0da0b8e 100644 --- a/classes/range.js +++ b/classes/range.js @@ -104,7 +104,7 @@ class Range { range = range.replace(re[t.CARETTRIM], caretTrimReplace) // normalize spaces - range = range.split(/\s+/).join(' ') + range = range.replace(/ +/g, ' ') // At this point, the range is completely trimmed and // ready to be split into comparators. diff --git a/ranges/to-comparators.js b/ranges/to-comparators.js index 6c8bc7e6..e2e935ca 100644 --- a/ranges/to-comparators.js +++ b/ranges/to-comparators.js @@ -3,6 +3,6 @@ const Range = require('../classes/range') // Mostly just for testing and legacy API reasons const toComparators = (range, options) => new Range(range, options).set - .map(comp => comp.map(c => c.value).join(' ').trim().split(' ')) + .map(comp => comp.map(c => c.value.trim())) module.exports = toComparators