-
Notifications
You must be signed in to change notification settings - Fork 492
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] add methods to update a range, including operator #314
Comments
I'm not sure exactly what you're looking for. Can you share some example code of how you might expect this to work and/or a description of what you'd use it for? If you have a range like const semver = require('semver')
const range = new semver.Range('1.x || >=2.0.3 <3')
for (const set of range.set) {
console.log('set:')
for (const comparator of set) {
console.log(comparator.operator, comparator.semver.version)
}
}
// outputs
/*
set:
>= 1.0.0
< 2.0.0
set:
>= 2.0.3
< 3.0.0
*/ |
Note that some comparators will have their .semver member set to an internal |
Reopening after some research into other issues. I think providing a supported way to do this without reaching into |
One area this would be useful is when getting a range and attempting to increase the range somehow. Maybe there is less use of an Digging up #10 as an old issue asking for something like this. Some other prior art here: |
Updated the title of the issue to increase its scope. |
What / Why
There doesn't seem to currently be a way to get the operator of a passed semver range. Adding something like
semver.operator()
to get the operator would be helpful.Current Behavior
There does not seem to be a way to get an operator of a passed version easily.
Expected Behavior
Have an easy way to get the operator of the passed semver range.
The text was updated successfully, but these errors were encountered: