Commit c44e124
committed
Handle X ranges properly in includePrelease mode
Append a `-0` prerelease tag on the parsed comparators when in
includePrerelease mode. Otherwise, 2.x will be satisfied by 3.0.0-beta,
since it's in `>=2.0.0 <3.0.0`. However, `2.0.0-beta` will _not_
satisfy this range.
By appending the `-0`, the version set is pinned to the appropriate
boundary.
Note that doing this in non-prerelease-including mode would be a
mistake! Appending the `-0` to the comparator means that prereleases in
the tuple are allowed, so `2.0.0-beta` would match `2.x` in
non-prerelease-including mode as well. However, if we're including
prereleases, then their inclusion is intentional.
Fix: #2821 parent ba19e8f commit c44e124
2 files changed
+11
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1208 | 1208 | | |
1209 | 1209 | | |
1210 | 1210 | | |
1211 | | - | |
| 1211 | + | |
1212 | 1212 | | |
1213 | | - | |
| 1213 | + | |
1214 | 1214 | | |
1215 | | - | |
| 1215 | + | |
| 1216 | + | |
1216 | 1217 | | |
1217 | 1218 | | |
1218 | 1219 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
249 | 249 | | |
250 | 250 | | |
251 | 251 | | |
| 252 | + | |
| 253 | + | |
252 | 254 | | |
253 | 255 | | |
254 | 256 | | |
255 | | - | |
256 | | - | |
| 257 | + | |
| 258 | + | |
257 | 259 | | |
258 | 260 | | |
259 | 261 | | |
| |||
338 | 340 | | |
339 | 341 | | |
340 | 342 | | |
| 343 | + | |
341 | 344 | | |
342 | 345 | | |
343 | 346 | | |
344 | | - | |
345 | | - | |
| 347 | + | |
| 348 | + | |
346 | 349 | | |
347 | 350 | | |
348 | 351 | | |
| |||
0 commit comments