[BUG] `subset('>=17.2.0', '^17.2.0 || >17')` should be `true`

Aperta
#703 2 commenti 1 reazione 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@abhu85 ci sta già lavorando.

Dal 29/4/2026.

  • #854 di @abhu85 — aperta
  • #894 di @deepakganesh78 — aperta

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
45/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
javascript, node.js
Ambito
tooling

Direzione di ricerca

Start with the semver/ranges/subset entry point and reproduce the four examples from the issue. Trace how the range combinations are evaluated, then add regression coverage for the expected true results and run the relevant test suite to confirm the existing cases still pass.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Bug Priority 2
Is there an existing issue for this?
  • I have searched the existing issues
Current Behavior
const subset = require("semver/ranges/subset")

subset('^17.2.0 || >17', '>=17.2.0') // true
subset('>=17.2.0', '^17.2.0 || >17') // false

subset('^17.2.0 || >=18', '>=17.2.0') // true
subset('>=17.2.0', '^17.2.0 || >=18') // false
Expected Behavior
const subset = require("semver/ranges/subset")

subset('^17.2.0 || >17', '>=17.2.0') // true
subset('>=17.2.0', '^17.2.0 || >17') // true

subset('^17.2.0 || >=18', '>=17.2.0') // true
subset('>=17.2.0', '^17.2.0 || >=18') // true
Steps To Reproduce

https://runkit.com/scagood/662900db83c1e60008f2ccd4

Environment
  • npm: 10.5.0
  • Node: 20.12.2
  • OS: Ubuntu 22.04.4
  • platform: KDE
Other references

https://github.com/eslint-community/eslint-plugin-n/issues/253

Lingua principale
JavaScript
Stelle
5.5k
Fork
635
Merge medio
1h 24m
PR unite (30g)
6

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di npm/node-semver

Tutte le issue di npm/node-semver

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.