Skip to content

comparisons do not consider build. #276

Closed

Description

@coreyfarrell

semver.gt('1.0.0+2', '1.0.0+1') returns false, I think this should return true. Similar issues occur with other comparisons, semver.eq says these are equal.

Activity

  1. isaacs commented on Apr 30, 2019

    @isaacs
    Contributor

    According to item 10 on the spec at https://semver.org, this behavior is required.

  2. coreyfarrell commented on May 1, 2019

    @coreyfarrell
    ContributorAuthor

    Would you accept a semver.compareBuild function returning -1, 0 or 1 so build can be easily compared without breaking the spec?

    Edit: This proposed function would use semver.compare first, only perform build comparison if the semver spec says the versions are equal.

  3. isaacs commented on May 1, 2019

    @isaacs
    Contributor
  4. coreyfarrell commented on May 2, 2019

    @coreyfarrell
    ContributorAuthor

    What do you think the correct order of 1.0.0 and 1.0.0+0 should be? I think this is a difference from the prerelease sorting logic so I would put 1.0.0 before (less than) 1.0.0+0.

  5. added a commit that references this issue on Nov 18, 2019
    3e23806
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions