Skip to content

Confusing process.release.compareVersion API #20053

@BridgeAR

Description

@BridgeAR

It might only be me but the current implementation is not intuitive for me because I expect the output to be exactly the opposite of what it is. Even though it is not right or wrong either way.

Let's give an example.

The current master version is 10.0.0-pre.

That way I expect 9.0.0 to return -1 because the input value is lower than the current version. Instead, it is 1, because the current version is bigger than the input value. So it depends on what viewpoint the user is in.

For me, it is more intuitive to have the input value being the main important part and not the current version (I hope it is clear what I want to express...).

So I would like to hear from others @nodejs/collaborators how they feel about this (it did not yet land on any release, so there would theoretically still be time to change this without being semver-major).

Metadata

Metadata

Assignees

No one assigned

    Labels

    metaIssues and PRs related to the general management of the project.processIssues and PRs related to the process subsystem.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions