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

Issue with tilde constraint #156

Open
cagataygurturk opened this issue Oct 21, 2020 · 3 comments
Open

Issue with tilde constraint #156

cagataygurturk opened this issue Oct 21, 2020 · 3 comments

Comments

@cagataygurturk
Copy link

It seems that there is an issue with tilde constraints. Version "0.1.0" matches "~0.0.0" although it should not.

Adding the following test cases causes a failure:

https://github.com/cagataygurturk/semver/commit/32e10671da3fbb7110f79679587e6799945c27ef#diff-38863e0a01899c69c60ca35df3a357eb9839bc41ea818352ee5240c728234920

Thanks.

@mattfarina mattfarina added the bug label Nov 16, 2020
@mattfarina
Copy link
Member

Thanks for catching this issue.

@mattfarina
Copy link
Member

I did a little looking. According to the internal code comments...

// ~0.0.0 is a special case where all constraints are accepted. It's
// equivalent to >= 0.0.0.

This is intentional behavior that came from v1. While I would like to change this it would mean a v4 of this package because it's following the intent.

I'm changing this to an enhancement so that when v4 is released we can incorporate it.

@mattfarina
Copy link
Member

Note, I do not remember by ~0.0.0 is a special case. I wish I did. Better comments would have helped.

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

No branches or pull requests

2 participants