Skip to content

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

Description

@scagood

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

eslint-community/eslint-plugin-n#253

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bugthing that needs fixingPriority 2will get attention when we're freed up

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions