Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Mimic the behavior of NPM and Bower when comparing versions
constructed by 1 or 2 groups of numbers. Versions as "1", "7.9", "v4" and "v98.2" are perfectly valid and both Bower and NPM expand those to, accordingly, "1.*", "7.9.*", "v4.*" and "v98.2.*". Until now this plugin failed at doing so, which causes quite some failures when trying to install packages that use that syntax (npmconf, just to name one). This commit fixes that by adding a single regex replace that matches groups of numbers and appends a ".*". Also, the regex keeps in mind that other type of versions, such as "~2" or ">=4.5" don't need to be expanded. Also note that this fix will not break current unit tests.
- Loading branch information