You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to use Semver library to sort versions that does not necessariy meet STRICT or LOOSE requirement.
Here my exemplary set of versions: "v1", "2", "1.1", "5.0.3.GA", "unknown", "anyString-that-cannotBeParsedAsVersion", etc.
Currently if I use any of existing SemverTypes it throws exception in constructor (e.g. for "unknown").
I would like to have new SemverType.FREESTYLE (the name can be changed if you find better one) so that it can parse versions like LOOSE (or event NPM) but those which could not be parsed (e.g. "unknown") would be also constructed and put in the end while sorting (compareTo() method).
So if i have a list of Semver 'versions' objects which values: "v1", "2", "1.1", "5.0.3.GA", "unknown"
The Collections.sort(versions) would give one of the following (please choose which would be easier/better to implement):
"1.1", "2". "5.0.3.GA", "unknown", "v1" (if "v1" would not be parsed as a valid version)
"v1", "1.1", "2". "5.0.3.GA", "unknown" (if "v1" would be parsed as a valid version)
"1.1", "2". "5.0.3.GA", "v1", "unknown" (if "v1" would be parsed as a valid version but ordered after pure numeric versions)
The text was updated successfully, but these errors were encountered:
I would like to use Semver library to sort versions that does not necessariy meet STRICT or LOOSE requirement.
Here my exemplary set of versions: "v1", "2", "1.1", "5.0.3.GA", "unknown", "anyString-that-cannotBeParsedAsVersion", etc.
Currently if I use any of existing SemverTypes it throws exception in constructor (e.g. for "unknown").
I would like to have new SemverType.FREESTYLE (the name can be changed if you find better one) so that it can parse versions like LOOSE (or event NPM) but those which could not be parsed (e.g. "unknown") would be also constructed and put in the end while sorting (compareTo() method).
So if i have a list of Semver 'versions' objects which values: "v1", "2", "1.1", "5.0.3.GA", "unknown"
The Collections.sort(versions) would give one of the following (please choose which would be easier/better to implement):
The text was updated successfully, but these errors were encountered: