Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Support for Semver Ranges #6

Open
Gei0r opened this issue Apr 1, 2020 · 5 comments
Open

[Feature Request] Support for Semver Ranges #6

Gei0r opened this issue Apr 1, 2020 · 5 comments

Comments

@Gei0r
Copy link

Gei0r commented Apr 1, 2020

Hey, could you add support for ranges to the library? These are not in the official standard, but are still widely used.

Example: ^1.2.3 means >= 1.2.3 && < 2.0.0

So maybe add a class semver::range with:

  • a constructor that takes a range string
  • an inRange() method that takes a single semver object and checks if the passed semver fits into the range

Here's the node documentation for semver ranges. This github project also has test cases.

@Neargye Neargye self-assigned this Apr 1, 2020
@Neargye Neargye added the enhancement New feature or request label Apr 1, 2020
@Neargye
Copy link
Owner

Neargye commented Apr 1, 2020

Hi, yes, it looks useful, I will add semver::range

@Neargye
Copy link
Owner

Neargye commented Apr 1, 2020

You want ranges and advanced-range-syntax?

@Gei0r
Copy link
Author

Gei0r commented Apr 1, 2020

Yeah, both would be awesome 😎

@Neargye Neargye added the help wanted Extra attention is needed label Jun 12, 2020
@egorpugin
Copy link

@Gei0r
You might be interested in my version with advanced ranges etc.
See tons of examples in tests
https://github.com/egorpugin/primitives/blob/master/src/version.cpp#L1839
Root dir
https://github.com/egorpugin/primitives/tree/master/src/version

It works in my C++ build system/package manager and you need it to include into your project, again, if you're interested.
https://software-network.org/

@icnocop
Copy link

icnocop commented May 24, 2024

When comparing X-Ranges, the code currently hangs.

semver::version l_v("1.0.0");
std::string_view r_v("2.x");

semver::range::satisfies(l_v, r_v);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants