Skip to content

semver v2.2.0

Compare
Choose a tag to compare
@WalkerCodeRanger WalkerCodeRanger released this 12 Jun 18:25
· 368 commits to master since this release

A minor release to improve comparison. Existing comparison methods and operators were confusing (#15, #26) and had bugs (#39, #53, #69).

  • New ComparePrecedenceTo(SemVersion), PrecedenceEquals(Semver), and static ComparePrecedence(SemVersion, SemVersion) and PrecedenceEquals(SemVersion, SemVersion) methods for comparing precedence
  • New CompareSortOrderTo(SemVersion) and static CompareSortOrder(SemVersion, SemVersion) methods for comparing sort order
    • Use existing Equals(SemVersion) and Equals(SemVersion, SemVersion) to compare sort order equality
  • New PrecedenceComparer and SortOrderComparer static properties
    • Provide a comparer that implements IEqualityComparer<SemVersion> and IComparer<SemVersion> to compare by precedence and sort order respectively
    • These can be used for sorting, binary search, and using SemVersion as a dictionary key
  • Marked Compare(SemVersion, SemVersion), CompareByPrecedence(SemVersion), CompareTo(SemVersion), CompareTo(object), and PrecedenceMatches(SemVersion) obsolete
  • Marked comparison operators obsolete (#53)