Skip to content

Add Version.clean, stricter valid?, and || handling in satisfies?#12

Merged
andrew merged 1 commit intomainfrom
add-clean-and-valid
Mar 5, 2026
Merged

Add Version.clean, stricter valid?, and || handling in satisfies?#12
andrew merged 1 commit intomainfrom
add-clean-and-valid

Conversation

@andrew
Copy link
Owner

@andrew andrew commented Mar 5, 2026

Three changes to support removing VersionNormalization from downstream consumers:

  • Vers.clean(version) validates a version string matches x.y.z and strips the v prefix, returning nil for invalid input
  • Vers.valid? now requires the x.y.z pattern instead of accepting bare numbers like "1" or non-version strings
  • Vers.satisfies? now splits on || to handle OR ranges directly, so callers don't need to do it themselves

Version.clean validates and strips v prefix from version strings,
returning nil for invalid input. Version.valid? now requires the
x.y.z pattern instead of accepting bare numbers or non-version
strings. Vers.satisfies? now splits on || to handle OR ranges
directly rather than requiring callers to do it.
@andrew andrew merged commit 65f36d1 into main Mar 5, 2026
2 checks passed
@andrew andrew deleted the add-clean-and-valid branch March 5, 2026 11:52
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