npm / node-semver

The semver parser for node (the one npm uses)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

wild card entry specialtilde ( * ) bug

rohannsahh opened this issue · comments

Is there an existing issue for this?

  • I have searched the existing issues

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

  • npm: 9.6.5
  • Node: 20.11.0
  • OS: windows 11
  • platform: vs code
commented

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