node-semver icon indicating copy to clipboard operation
node-semver copied to clipboard

[bug] diff("1.7.2-1", "1.8.1") returns patch, not minor

Open erikjalevik opened this issue 2 years ago • 1 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Current Behavior

diff("1.7.2-1", "1.8.1") returns "patch".

Expected Behavior

I would have expected it to return "minor" since we're moving from 1.7 to 1.8.

Steps To Reproduce

  1. In this environment...
  2. With this config...
  3. Run '...'
  4. See error...

Environment

  • npm:
  • Node:
  • OS:
  • platform:

erikjalevik avatar Jul 28 '23 17:07 erikjalevik

> Semver.inc('1.7.2-1', 'patch')
'1.7.2'
> Semver.inc('1.7.2-1', 'minor')
'1.8.0'
> Semver.diff("1.7.2", "1.8.1")
'minor'

wraithgar avatar Jan 25 '24 17:01 wraithgar