compare

fun compare(other: SemVer): Int

Compares two SemVers and returns a SemVerComparison according to the differences. One of the following will happen:

  • If the versions are equal, DIFF_EQUAL is returned.

  • If the version change is of type patch, DIFF_PATCH is returned. This is intended for small fixes, and versions with patch changes should be compatible.

  • If the version change is of type minor, DIFF_MINOR is returned. This is intended for changes bigger than patch, but that might still be compatible, however, a warning is recommended.

  • If the version change is of type major, DIFF_MAJOR is returned. This is intended for big structural changes, and usually indicates incompatibility between versions. Caution is advised.

Author

Arnau Mora

Since

20220711

Return

One of: DIFF_EQUAL, DIFF_PATCH, DIFF_MINOR or DIFF_MAJOR.

Parameters

other

The other version to compare against to.