Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions classes/range.js
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@ const isSatisfiable = (comparators, options) => {
// already replaced the hyphen ranges
// turn into a set of JUST comparators.
const parseComparator = (comp, options) => {
comp = comp.replace(re[t.BUILD], '')
debug('comp', comp, options)
comp = replaceCarets(comp, options)
debug('caret', comp)
Expand Down
28 changes: 28 additions & 0 deletions test/fixtures/range-parse.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,32 @@ module.exports = [
[`^${MAX_SAFE_INTEGER}.0.0`, null],
[`=${MAX_SAFE_INTEGER}.0.0`, `${MAX_SAFE_INTEGER}.0.0`],
[`^${MAX_SAFE_INTEGER - 1}.0.0`, `>=${MAX_SAFE_INTEGER - 1}.0.0 <${MAX_SAFE_INTEGER}.0.0-0`],
// x-ranges with build metadata
['1.x.x+build >2.x+build', '>=1.0.0 <2.0.0-0 >=3.0.0', null],
['>=1.x+build <2.x.x+build', '>=1.0.0 <2.0.0-0', null],
['1.x.x+build || 2.x.x+build', '>=1.0.0 <2.0.0-0||>=2.0.0 <3.0.0-0', null],
['1.x+build.123', '>=1.0.0 <2.0.0-0', null],
['1.x.x+meta-data', '>=1.0.0 <2.0.0-0', null],
['1.x.x+build.123 >2.x.x+meta-data', '>=1.0.0 <2.0.0-0 >=3.0.0', null],
['1.x.x+build <2.x.x+meta', '>=1.0.0 <2.0.0-0', null],
['>1.x+build <=2.x.x+meta', '>=2.0.0 <3.0.0-0', null],
[' 1.x.x+build >2.x.x+build ', '>=1.0.0 <2.0.0-0 >=3.0.0', null],
['^1.x+build', '>=1.0.0 <2.0.0-0', null],
['^1.x.x+build', '>=1.0.0 <2.0.0-0', null],
['^1.2.x+build', '>=1.2.0 <2.0.0-0', null],
['^1.x+meta-data', '>=1.0.0 <2.0.0-0', null],
['^1.x.x+build.123', '>=1.0.0 <2.0.0-0', null],
['~1.x+build', '>=1.0.0 <2.0.0-0', null],
['~1.x.x+build', '>=1.0.0 <2.0.0-0', null],
['~1.2.x+build', '>=1.2.0 <1.3.0-0', null],
['~1.x+meta-data', '>=1.0.0 <2.0.0-0', null],
['~1.x.x+build.123', '>=1.0.0 <2.0.0-0', null],
['^1.x.x+build || ~2.x.x+meta', '>=1.0.0 <2.0.0-0||>=2.0.0 <3.0.0-0', null],
['~1.x.x+build >2.x+meta', '>=1.0.0 <2.0.0-0 >=3.0.0', null],
['^1.x+build.123 <2.x.x+meta-data', '>=1.0.0 <2.0.0-0', null],
// // x-ranges with prerelease and build
['1.x.x-alpha+build', '>=1.0.0 <2.0.0-0', null],
['>1.x.x-alpha+build', '>=2.0.0', null],
['>=1.x.x-alpha+build <2.x.x+build', '>=1.0.0 <2.0.0-0', null],
['1.x.x-alpha+build || 2.x.x+build', '>=1.0.0 <2.0.0-0||>=2.0.0 <3.0.0-0', null],
]
Loading