This is some ingenous piece of Debian. When packaging an alpha version that is about to be superseded by the same string just without the "-alpha" as a suffix, then the "-alpha" is ordered "newer" than what is new. But if it is "~alpha", then this sorts as earlier. Debian packages are very consistent with this (otherwise maintainers don't get their updates into the distribution). You may want to allow for such versions, too, and if it is to eventually point to the exact version of a package in Debian without the need for a different versionType.
This is some ingenous piece of Debian. When packaging an alpha version that is about to be superseded by the same string just without the "-alpha" as a suffix, then the "-alpha" is ordered "newer" than what is new. But if it is "~alpha", then this sorts as earlier. Debian packages are very consistent with this (otherwise maintainers don't get their updates into the distribution). You may want to allow for such versions, too, and if it is to eventually point to the exact version of a package in Debian without the need for a different versionType.