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: compare two ranges #178
Comments
Seems like |
came to the project today to request exactly this. we're presently using a litany of regular expressions (from some very old legacy code that I haven't gotten around to replacing) - https://github.com/gilt/gilt-swig-assets/blob/master/lib/swig-install/lib/merge-util.js#L73 |
+1 |
@ljharb @platinumazure @shellscape take a look in the PR I just made. It should be what you need. |
Landed in v5.4 |
I'm trying to compare an existing semver range in a package.json, with a peerDependency range in another package.json - in other words, I want to see if the two ranges are compatible (ie, if there exists a version that satisfies both).
I tried playing with
Range
but couldn't come up with anything.A simple example would be,
^1.2.3
and<= 1.3.0
should return either a semver range that satisfies both, or the highest version number that satisfies both (either is sufficient).Is this possible?
The text was updated successfully, but these errors were encountered: