Skip to content
New issue

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

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

Already on GitHub? # to your account

[BUG] Tilde Range Not Equivalent to X-Range when Including Prerelease #512

Open
1 task done
WalkerCodeRanger opened this issue Dec 26, 2022 · 0 comments
Open
1 task done
Labels
Bug thing that needs fixing Needs Triage needs an initial review

Comments

@WalkerCodeRanger
Copy link

WalkerCodeRanger commented Dec 26, 2022

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

When including all prerelease versions, a tilde range like ~1.2.* does not include prerelease versions like 1.2.0-rc, but the X-range 1.2.* it is the "same as" does.

Expected Behavior

As stated by the readme and what seems to make sense for the way the >= operator works with X-ranges, ~1.2.* should include 1.2.0-rc when using the include prerelease option.

Also, note that the expected behavior is consistent with the caret operator for which ^1.2.* includes 1.2.0-rc when using the include prerelease option.

Steps To Reproduce

$semver -p -r '>=1.2.*' 1.2.0-rc
1.2.0-rc

$semver -p -r '~1.2.*' 1.2.0-rc

$semver -p -r '~1.2' 1.2.0-rc

$semver -p -r '1.2.*' 1.2.0-rc
1.2.0-rc

semver -p -r '^1.2.*' 1.2.0-rc
1.2.0-rc

Environment

  • npm: 7.3.8
  • Node: 8.11.3
  • OS: Windows Home 10.0.19044 Build 19044
  • platform: Asus Laptop
@WalkerCodeRanger WalkerCodeRanger added Bug thing that needs fixing Needs Triage needs an initial review labels Dec 26, 2022
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Bug thing that needs fixing Needs Triage needs an initial review
Projects
None yet
Development

No branches or pull requests

1 participant