Skip to content

Prevent Inverted SemVersionRange Values ("1.2 - 1.0") #77

Closed
@damepatr

Description

@damepatr

The SemVersionRange.TryParseNpm methods will return true if you pass inverted version ranges.

Example

Imagine that you are trying to check if a version range is a valid version range. You can create code similar to the following:

public static bool IsValidRange(string range) {
    return SemVersionRange.TryParseNpm(range, out _);
}

When passing 1.2 - 1.0 for range, this method returns true. However, I thought that it would return false. I think that 1.2 - 1.0 isn't a valid version range for NPM.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions