Fix for npm versions like 1.2.x
What does this MR do?
Fix parsing and comparison of npm "versions" ending with .x
.
- Versions ending with
.x
now match any version, including prereleases. Prior to this change, theaddition
attribute was compared. - The parser now raises an error if
.x
isn't at the very end of the version string.
compare_tokens
now takes the two arrays of tokens being compared. This makes it possible to trim an array before comparing it.
For consistency compare_addition
has been renamed to compared_additions
(plural) and now takes the two additions being compared.
This addresses incorrect results surfaced in !66 (comment 1861998472).
package:
type: npm
name: hapi
range: 2.0.x || 2.1.x
versions:
not_in:
- 2.0.0-preview
not_out: []
err: []
What are the relevant issue numbers?
gitlab-org/gitlab#386070 (comment 1821312900)
Does this MR meet the acceptance criteria?
-
Changelog entry added -
Documentation created/updated for this project, if necessary -
Tests added for this feature/bug -
Conforms to the code review guidelines -
Security reports checked/validated by reviewer
Edited by Fabien Catteau