Skip to content

[BUG] diff is inconsistent in comparing prerelease to later versions #561

@pgsandstrom

Description

@pgsandstrom

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

This code:

    console.log(diff('2.0.0-alpha.1', '2.0.0'))
    console.log(diff('2.0.0-alpha.1', '2.1.1'))

Results in "major" and "minor".

Expected Behavior

The code should result in the output "major", "major".

Steps To Reproduce

Just run the code with semver v7.5.1. The bug seems to have appeared in 7.4.0.

Environment

  • npm: 8.18.0
  • Node: v18.8.0
  • OS: Windows 11
  • platform: node

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bugthing that needs fixingPriority 1high priority issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions