Skip to content

feat: add IsPrerelease and IsStable methods to Version#285

Open
walle250ai wants to merge 1 commit into
Masterminds:masterfrom
walle250ai:master
Open

feat: add IsPrerelease and IsStable methods to Version#285
walle250ai wants to merge 1 commit into
Masterminds:masterfrom
walle250ai:master

Conversation

@walle250ai
Copy link
Copy Markdown

Summary

  • Add IsPrerelease() bool — returns true when the version has a prerelease identifier (Prerelease() != "")
  • Add IsStable() bool — returns true when Major() >= 1 and there is no prerelease identifier, following the semver spec where major=0 is initial development

Both methods are placed alongside the existing accessor group (Major, Minor, Patch, Prerelease, Metadata).

Test plan

  • TestIsPrerelease: covers 1.2.3 (false), -alpha (true), -alpha.1 (true), 0.3.7 (false), 0.3.7-beta (true), -x.7.z.92 (true)
  • TestIsStable: covers 0.x.x (false), 1.0.0 (true), 1.0.0-beta (false), 2.3.4 (true), -alpha.1 (false)

🤖 Generated with Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant