node-semver icon indicating copy to clipboard operation
node-semver copied to clipboard

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

Open scagood opened this issue 1 year ago • 2 comments

Is there an existing issue for this?

  • [X] 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

scagood avatar Apr 24 '24 21:04 scagood

@scagood Did you ever find a workaround for this? We're hitting the same issue.

rochdev avatar Jul 25 '25 14:07 rochdev

Did you ever find a workaround for this? We're hitting the issue.

Alas, we never found a satisfactory solution

scagood avatar Jul 26 '25 11:07 scagood