loose Be more forgiving about not-quite-valid semver strings.
Options in this object are false by default. Putting all this together, here is a Backus-Naur grammar for ranges,Īll methods and classes take a final options object argument. It allows for changes that are presumed to beĪdditive (but non-breaking), according to commonly observed practices. However, it presumes that there will not be breaking changes betweenĠ.2.4 and 0.2.5. Many authors treat a 0.x version as if the x were the majorĬaret ranges are ideal when an author may make breaking changesīetween 0.2.4 and 0.3.0 releases, which is a common practice. Will append the value of the string as a prerelease identifier:Īdvanced range syntax desugars to primitive comparators inĪdvanced ranges may be combined in the same way as primitiveĬomparators using white space or ||. inc takes an additional identifier string argument that Matching) by setting the includePrerelease flag on the options Versions as if they were normal versions, for the purpose of range Note that this behavior can be suppressed (treating all prerelease Similar risk on the next set of prerelease versions. Is still not appropriate to assume that they have opted into taking a The user is indicating that they are aware of the risk. By including a prerelease tag in the range, Second, a user who has opted into using a prerelease version hasĬlearly indicated the intent to use that specific set ofĪlpha/beta/rc versions. Therefore, by default, they are excluded from range matching That are (by the author's design) not yet fit for public consumption. First, prerelease versionsįrequently are updated very quickly, and contain many breaking changes The purpose for this behavior is twofold. Prerelease flag, and 3.4.5 is greater than 1.2.3-alpha.7. Version 3.4.5 would satisfy the range, because it does not have a Range only accepts prerelease tags on the 1.2.3 version. Than" 1.2.3-alpha.3 according to the SemVer sort rules. Version 1.2.3-alpha.7, but it would not be satisfied byģ.4.5-alpha.9, even though 3.4.5-alpha.9 is technically "greater One of the ||-separated comparator sets is satisfied by the version.įor example, the range >=1.2.7 =1.2.9 1.2.3-alpha.3 would be allowed to match the Version matches a range if and only if every comparator in at least Which is satisfied by the intersection of all of the comparatorsĪ range is composed of one or more comparator sets, joined by ||. So this operator is optional, but MAY be included.įor example, the comparator >=1.2.7 would match the versionsġ.2.7, 1.2.8, 2.5.3, and 1.3.9, but not the versions 1.2.6Ĭomparators can be joined by whitespace to form a comparator set, If no operator is specified, then equality is assumed, RangesĪ version range is a set of comparators which specify versionsĪ comparator is composed of an operator and a version. VersionsĪ "version" is described by the v2.0.0 specification found atĪ leading "=" or "v" character is stripped off and ignored. Multiple versions to the utility will just sort them.