[BUG] subset() returns false for an upper-bound-only range such as subset('<2.0.0', '*')
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 74/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- javascript, node.js
- 領域
- backend
調査の方向性
Start in ranges/subset.js at simpleSubset, especially the lt && hasDomGT && !gt condition described in the issue. Trace how missing lower bounds and * are normalized, then check the existing subset tests for these range combinations. Done means the first five reproductions return true while existing subset behavior remains correct.
索引モデルが issue の本文から書いたものです。
説明
Is there an existing issue for this?
- I have searched the existing issues
Current Behavior
subset(sub, dom) returns false when sub has only an upper bound (< or <=) and dom has a lower bound, including *, which subset treats as >=0.0.0. Every version that satisfies <2.0.0 also satisfies *, so the README's "entirely contained" definition gives true.
subset('<1.0.0', '0.x') is a related false negative: 0.x is >=0.0.0 <1.0.0-0, which admits the same non-prerelease versions as <1.0.0.
Expected Behavior
The first five lines below print true.
In ranges/subset.js, simpleSubset replaces * in dom with >=0.0.0 and then returns false for lt && hasDomGT && !gt, which treats a missing lower bound in sub as unbounded below instead of >=0.0.0.
Steps To Reproduce
const { subset } = require('semver')
console.log(subset('<2.0.0', '*'))
console.log(subset('<2', '*'))
console.log(subset('<2.0.0', '>=0.0.0'))
console.log(subset('<2.0.0', '>=0.0.0-0'))
console.log(subset('<1.0.0', '0.x'))
console.log(subset('<1.0.0', '>=0.0.0 <1.0.0'))
console.log(subset('^1.2.3', '*'))
Output:
false
false
false
false
false
true
true
Environment
- semver: 7.8.6, also
mainat b37b033 - Node: 26.13.0
- OS: Ubuntu Linux
- platform: x86_64
Credit: https://ucsbplse.github.io/
- 主要言語
- JavaScript
- スター
- 5.5k
- フォーク
- 624
- 平均マージ
- 6日 1時間
- マージ済み PR(30日)
- 13
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
npm/node-semver のほかの issue
-
[BUG] minVersion returns 0.0.0 when a 0.0.0 prerelease is the true minimum対応中かも @thisisshivamtiwari が 10 日前に担当しました。 オープンBug Needs Triage
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
npm/node-semver#934 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
[BUG] new Range(comparator).test() throws TypeError for a prerelease version対応中かも @Boulea7 が 37 日前に担当しました。 オープンBug Needs Triage
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
npm/node-semver#908 ·
メンテナーはふだん 1 日以内に返信
-
semver:major
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
npm/node-semver#108 · コメント 6 件 ·
メンテナーはふだん 1 日以内に返信
-
[BUG] intersects() still returns true for an empty range against "*" (follow-up to #521)対応中かも @json-open-source が 36 日前に担当しました。 オープンBug Needs Triage
難易度 3/5 1〜2日 初心者へのやさしさ 64/100
npm/node-semver#909 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
[BUG] `* || 1.2.3-alpha` won't match `1.2.3-alpha` (when includePrerelease = false)対応中かも @x0Lazarus が 42 日前に担当しました。 オープンBug Needs Triage
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
npm/node-semver#906 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
npm/node-semver の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
Fei2411/DeepSeek-Bot#1113 ·
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
arfct/timezone.fyi#19 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
fastify/fastify-http-proxy#493 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
eliasstravik/herdr-projects#785 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
tensorflow/tfjs#8754 ·