File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -1164,10 +1164,14 @@ function replaceXRange (comp, options) {
11641164 gtlt = ''
11651165 }
11661166
1167+ // if we're including prereleases in the match, then we need
1168+ // to fix this to -0, the lowest possible prerelease value
1169+ pr = options . includePrerelease ? '-0' : ''
1170+
11671171 if ( xM ) {
11681172 if ( gtlt === '>' || gtlt === '<' ) {
11691173 // nothing is allowed
1170- ret = '<0.0.0'
1174+ ret = '<0.0.0-0 '
11711175 } else {
11721176 // nothing is forbidden
11731177 ret = '*'
Original file line number Diff line number Diff line change @@ -679,8 +679,8 @@ test('comparators test', function (t) {
679679 [ '1.2 - 3.4.5' , [ [ '>=1.2.0' , '<=3.4.5' ] ] ] ,
680680 [ '1.2.3 - 3.4' , [ [ '>=1.2.3' , '<3.5.0' ] ] ] ,
681681 [ '1.2.3 - 3' , [ [ '>=1.2.3' , '<4.0.0' ] ] ] ,
682- [ '>*' , [ [ '<0.0.0' ] ] ] ,
683- [ '<*' , [ [ '<0.0.0' ] ] ]
682+ [ '>*' , [ [ '<0.0.0-0 ' ] ] ] ,
683+ [ '<*' , [ [ '<0.0.0-0 ' ] ] ]
684684 ] . forEach ( function ( v ) {
685685 var pre = v [ 0 ]
686686 var wanted = v [ 1 ]
You can’t perform that action at this time.
0 commit comments