-
Notifications
You must be signed in to change notification settings - Fork 148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Distinguish between zero values and missing values #175
Comments
It's been a little bit since you posted this so may already have a setup that works for this. When it comes to versions, a missing section is a 0. When an The way to do all of that with this library is to parse your version as a version (e.g., |
I have a need to distinguish between "2" and "2.0" post-parsing, without having to re-parse these strings.
For example, I am writing an automated system to identify when software component versions are no longer supported. The data about support timelines can vary about specificity, so that some products exit support as of a major-wide series 2.x ("2"), whereas other products develop at a much faster rate and can exit support as of particular minor versions ("2.0").
Unfortunately, it appears that semver simply defaults unspecified minor version values, etc. etc. as zero, without providing a clear way to distinguish between an explicit zero input, versus an implicit default of missing information to zero.
I think I may hack around this gap by counting the periods in the original version string prior to parsing with semver. But I would love for a standard feature such as HasMinor(), HasPatch(), HasBuild(), to clarify in a reliable way.
The text was updated successfully, but these errors were encountered: