@voxpelli/semver-set
TypeScript icon, indicating that this package has built-in type declarations

4.0.0 • Public • Published

@voxpelli/semver-set

Finds intersections between semantic version ranges.

Started out as a fork of the original semver-set, triggered by the lack of bug fixes in that project, but is now been rewritten from scratch to fix issue with missing license in original project.

Usage

semverIntersect(firstRange, secondRange, [{ loose: false }])

Supports the semver loose option in an optional third argument.

import { semverIntersect } from '@voxpelli/semver-set';

// ^2.2.0
semverIntersect('^1.1 || ^2.2 || >=5', '^2.2.0-alpha1');

// undefined
semverIntersect('~2.2.4', '~2.3.0');

intersect(...ranges) (deprecated)

The original semver-set intersect() method is supported to ensure backwards compatibility

import { intersect } from '@voxpelli/semver-set';

// ^2.2.0
intersect('^1.1 || ^2.2 || >=5', '^2.2.0-alpha1');

// null
intersect('~2.2.4', '~2.3.0');

Keywords

none

Install

npm i @voxpelli/semver-set

DownloadsWeekly Downloads

14,846

Version

4.0.0

License

MIT

Unpacked Size

14.4 kB

Total Files

9

Last publish

Collaborators

  • voxpelli