semver-range-intersect
Get the intersection of multiple semver ranges.
Install
npm install semver-range-intersect
Usage
const intersect = ; // equals to: '^4.1.0' === '>=4.1.0 <5.0.0' // equals to: 1.1.0 - 1.4.0 === '>=1.1.0 <=1.4.0' === '>=8.2.6 <=8.6.9' === '6.7.9' // equals to: ^8.15.0 || ^10.13.0 || >=11.10.1 === '>=8.15.0 <9.0.0 || >=10.13.0 <11.0.0 || >=11.10.1' === '*' // null for invalid version === null // null for version range not crossing === null === null
Tests
To run the test suite, first install the dependencies, then run npm test
:
npm installnpm test
Contributing
see CONTRIBUTING.md