I am trying to understand why npx -r '>1.2' 1.2.8 results in 1.2.8 not satisfying the range. I think >1.2 should expand to >1.2.0 <1.3.0 which would mean 1.2.8 satisfies. But stepping through the tool, I see it hits this path:
|
const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR] |
|
const m = comp.match(r) |
|
|
|
if (!m) { |
|
throw new TypeError(`Invalid comparator: ${comp}`) |
|
} |
The result being m === null and the TypeError is thrown.
node-semver/test/fixtures/range-exclude.js
Line 68 in d17aebf
I am trying to understand why
npx -r '>1.2' 1.2.8results in1.2.8not satisfying the range. I think>1.2should expand to>1.2.0 <1.3.0which would mean1.2.8satisfies. But stepping through the tool, I see it hits this path:node-semver/classes/comparator.js
Lines 37 to 42 in d17aebf
The result being
m === nulland theTypeErroris thrown.