npm / node-semver

The semver parser for node (the one npm uses)
ISC License
5.09k stars 492 forks source link

wild card entry specialtilde ( * ) bug #694

Closed rohannsahh closed 6 months ago

rohannsahh commented 6 months ago

Is there an existing issue for this?

Current Behavior

const version = "1.2.alpha.1"; const specialTilde = "*"; console.log( "semver package special tilde: ", semver.satisfies(version, specialTilde) ); ==false

in prerelease identifier special tilde gives false ,it should give true

Expected Behavior

const version = "1.2.alpha.1"; const specialTilde = "*"; console.log( "semver package special tilde: ", semver.satisfies(version, specialTilde) ); ==true

Steps To Reproduce

Reproducible repo link:

https://github.com/rohannsahh/semverissue

  1. npm i
  2. npm run test

Special tilde wildcard for prerelease identifier does not seems correct

Environment

wraithgar commented 6 months ago

prereleases are not included in any matching unless you specify that you want prereleases or if the range you're checking also has prereleases in it. This is by design.

https://github.com/npm/node-semver?tab=readme-ov-file#prerelease-tags