@snyk/unmanaged-semver
v1.1.1
Published
A semantic version parser for unmanaged, based on the API of npm's semver
Downloads
1,954
Readme
unmanaged-semver
A semantic version parser for unmanaged, based on the API of npm's semver.
Additional functionality, beyond what is documented in npm's, is available:
compareRanges
This facilitates sorting version ranges, which may help with generating consistent/normalised data, and may help work around bugs in Unmanaged's version parser. It compares as follows (see #19):
- The operators are interpreted as "just outside", so
(1,2]>[1,2]. (Read(1as[1.000001?) - Singular versions are sorted before ranges:
[2]<[2,3). - The minimum/singular version is more important than the maximum.
[2]>[1,3) - Open-ended ranges are further out than any named version:
(,2)<(0.0.1,2),[1,3)<[1,).
