fix: prerelease identifier starting with digits by mbtools · Pull Request #781 · npm/node-semver (original) (raw)

Closes #775

@wraithgar your suspicion was correct. The regex for the prerelease identifier was not precise enough. Changing the order of numeric and non-numeric parts fixes the issue. I reverted the change to inc function in semver.js. The tests still pass 😃

I added tests that check the exact result of parsing valid versions in particular the pre-release and build parts which was somehow missing. We might want to add edge cases here.