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

calculate two Ranges intersection. #195

Closed
wants to merge 1 commit into from
Closed

Conversation

xice-blue
Copy link

I have two case need deal:
3 modules dependency X module:
1.
'x': '~1.1.0'
'x': '~1.1.5'
'x': '1.1.10'
or
2.
'x': '~1.1.0'
'x': '~1.1.5'
'x': '1.2.1'
Case 1 need get X module version is 1.1.10, and case 2 throw Exception about version mismatching.
So I extend function 'intersections' to deal these cases.

@isaacs isaacs added the review label May 16, 2017
@coveralls
Copy link

coveralls commented May 16, 2017

Coverage Status

Coverage decreased (-0.1%) to 94.526% when pulling 33e9be7 on xice-blue:master into 8fff305 on npm:master.

@rtfpessoa
Copy link
Contributor

I think this is the same I have here: #187 waiting for merge for a while.

@xice-blue
Copy link
Author

@rtfpessoa your function return is true or false, I need return intersection.
For example: range '~1.1.0' and '^1.0.0 < 1.1.5', it will return '>=1.1.0 <1.1.5'.
And I can get more range's intersection.

@rtfpessoa
Copy link
Contributor

You are right. I think I misread the description.

@adam-stanek
Copy link

Please add test for ['^1.2.1', '^1.2.5', '>=1.2.5 <2.0.0']. It doesn't seem to be working.

@isaacs
Copy link
Contributor

isaacs commented Jul 25, 2017

Landed and published in v5.4

@isaacs isaacs closed this Jul 25, 2017
@isaacs
Copy link
Contributor

isaacs commented Jul 25, 2017

Er, another implementation landed. Not this one.

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

Successfully merging this pull request may close these issues.

5 participants