mirror of
https://github.com/semver/semver.git
synced 2026-07-10 19:50:47 -05:00
[GH-ISSUE #866] Coerce does not preserve valid versions with prerelease identifiers #5676
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @alasdairhurst on GitHub (Aug 9, 2022).
Original GitHub issue: https://github.com/semver/semver/issues/866
Coerce specifically "Coerces a string to semver if possible". It does not work with ranges.
Given this description, any strings that i provide that happen to be valid semver versions, should be returned as-is.
Unfortunately, i've found that the prerelease identifier gets stripped off entirely.
I shouldn't have to provide
loose(especially if i want to be strict), orincludePrereleasebut those options don't change the behavior either.@alasdairhurst commented on GitHub (Aug 10, 2022):
Submitted to the wrong repo, apologies. This is what i was looking for. https://github.com/npm/node-semver/issues/357