Put a prerelease before its final release
Example input
1.2.3-alpha.1
1.2.3Expected result
1.2.3-alpha.1 < 1.2.3Compare these as semantic versions rather than sorting plain text. The prerelease precedes the release with the same three numeric components. Build metadata does not determine precedence. Range matching has its own prerelease rules, so test the actual target version against the actual range instead of inferring the answer from this comparison.