adamreeve / semver.net

Semantic versioning for .NET
MIT License
117 stars 22 forks source link

Feature: Support functionality similar to the `includePrerelease` flag from the npm package #49

Closed sfwester closed 3 years ago

sfwester commented 3 years ago

Feature Request

Support a mechanism to optionally treat prerelease versions as normal versions when checking if the satisfy a version range.

e.g.

SemVer.Range.Parse(">2.0.0").IsSatisfied(SemVer.Version.Parse("2.1.0-alpha.1"))
// true

https://github.com/npm/node-semver#prerelease-tags

Note that this behavior can be suppressed (treating all prerelease versions as if they were normal versions, for the purpose of range matching) by setting the includePrerelease flag on the options object to any functions that do range matching.

adamreeve commented 3 years ago

Hi, thanks for the feature request, this does sound like it would be useful to support. I should have some time to implement this soon

adamreeve commented 3 years ago

This has been added in 2.0.0-alpha.1