Repository navigation
Permalink
Choose a base ref
{{ refName }}
default
Choose a head ref
{{ refName }}
default
Comparing changes
Choose two branches to see what’s changed or to start a new pull request.
If you need to, you can also or
learn more about diff comparisons.
Open a pull request
Create a new pull request by comparing changes across two branches. If you need to, you can also .
Learn more about diff comparisons here.
base repository: npm/node-semver
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v7.8.3
Could not load branches
Nothing to show
Loading
Could not load tags
Nothing to show
{{ refName }}
default
Loading
...
head repository: npm/node-semver
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v7.8.5
Could not load branches
Nothing to show
Loading
Could not load tags
Nothing to show
{{ refName }}
default
Loading
- 4 commits
- 6 files changed
- 3 contributors
Commits on Jun 9, 2026
-
fix: reject numeric segments after x-ranges
王胜 authored and Michael Smith committedJun 9, 2026 Configuration menu - View commit details
-
Copy full SHA for e583226 - Browse repository at this point
Copy the full SHA e583226View commit details -
🤖 I have created a release *beep* *boop* --- ## [7.8.4](v7.8.3...v7.8.4) (2026-06-09) ### Bug Fixes * [`e583226`](e583226) [#874](#874) reject numeric segments after x-ranges (@pupuking723) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Configuration menu - View commit details
-
Copy full SHA for 8640bd6 - Browse repository at this point
Copy the full SHA 8640bd6View commit details
Commits on Jun 19, 2026
-
fix: include prereleases in tilde range lower bound with includePrere…
…lease (#878) Closes #512 ## Problem A tilde range like \`~1.2\` is documented in the README as equivalent to the \`1.2.x\` x-range: > \`~1.2\` := \`>=1.2.0 <1.(2+1).0\` := \`>=1.2.0 <1.3.0-0\` (**Same as \`1.2.x\`**) With \`{ includePrerelease: true }\`, both the x-range and the caret operator lower-bound their open forms at \`-0\` (the lowest possible prerelease) so that prereleases like \`1.2.0-rc\` match. The tilde operator did **not**, leaving its lower bound at \`>=1.2.0\`: ```js const semver = require("semver") const opts = { includePrerelease: true } semver.satisfies("1.2.0-rc", "1.2.*", opts) // true semver.satisfies("1.2.0-rc", "^1.2.*", opts) // true semver.satisfies("1.2.0-rc", "~1.2.*", opts) // false <-- bug new semver.Range("1.2.*", opts).range // ">=1.2.0-0 <1.3.0-0" new semver.Range("^1.2.*", opts).range // ">=1.2.0-0 <2.0.0-0" new semver.Range("~1.2.*", opts).range // ">=1.2.0 <1.3.0-0" <-- lower bound missing -0 ``` This makes \`~1.2.*\` inconsistent with both its documented x-range equivalent and the caret operator. Reported in #512 (and the same root cause as #510 / #736 discussion around tilde + prerelease). ## Fix \`replaceCaret\` and \`replaceXRange\` already compute a lower-bound suffix: ```js const z = options.includePrerelease ? "-0" : "" ``` and apply it to their open forms. \`replaceTilde\` was the only one of the three that did not. This change applies the same suffix to the open tilde forms (\`~1\`, \`~1.x\`, \`~1.2\`, \`~1.2.x\`). After the fix, \`~1.2.*\` desugars to \`>=1.2.0-0 <1.3.0-0\` — identical to the \`1.2.*\` x-range it is documented to equal. ### Scope / what is intentionally unchanged - **Default behavior (no \`includePrerelease\`) is untouched** — no \`-0\` is added, so \`~1.2.*\` stays \`>=1.2.0 <1.3.0-0\`. - **Fully-specified tildes keep their exact lower bound**, matching the caret operator: \`~1.2.3\` with \`includePrerelease\` stays \`>=1.2.3 <1.3.0-0\` (so \`1.2.3-rc\`, which sorts *before* the \`1.2.3\` release, correctly does **not** match — same as \`^1.2.3\`). - **Explicit-prerelease tildes** (\`~1.2.3-beta\`) are preserved as-is. ## Tests Added failing-then-passing fixtures: - \`test/fixtures/range-parse.js\` — desugaring of \`~1\`, \`~1.x\`, \`~1.2\`, \`~1.2.x\`, \`~0.0\` under \`includePrerelease\`, plus \`~1.2.3\` / \`~1.2.3-beta.4\` to lock in that they do *not* change. - \`test/fixtures/range-include.js\` — \`~1.1\` / \`~1.1.x\` / \`~2\` / \`~2.x\` now satisfy the same prereleases as the equivalent x-ranges. Full suite (\`npm test\`) and \`eslint\` pass.
Configuration menu - View commit details
-
Copy full SHA for 9c8692a - Browse repository at this point
Copy the full SHA 9c8692aView commit details -
🤖 I have created a release *beep* *boop* --- ## [7.8.5](v7.8.4...v7.8.5) (2026-06-19) ### Bug Fixes * [`9c8692a`](9c8692a) [#878](#878) include prereleases in tilde range lower bound with includePrerelease (#878) (@chatman-media) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1Configuration menu - View commit details
-
Copy full SHA for 6e05b76 - Browse repository at this point
Copy the full SHA 6e05b76View commit details
Loading
This comparison is taking too long to generate.
Unfortunately it looks like we can’t render this comparison for you right now. It might be too big, or there might be something weird with your repository.
You can try running this command locally to see the comparison on your machine:
git diff v7.8.3...v7.8.5