expandVersion

Takes a partial version and expands it to a valid SemVer version.

This function corresponds to the semantivs of the "~>" comparison operator's lower bound.

@safe
string
expandVersion
pure
(
string ver
)

Examples

1 assert("1.0.0" == expandVersion("1"));
2 assert("1.0.0" == expandVersion("1.0"));
3 assert("1.0.0" == expandVersion("1.0.0"));
4 // These are rather excotic variants...
5 assert("1.0.0-pre.release" == expandVersion("1-pre.release"));
6 assert("1.0.0+meta" == expandVersion("1+meta"));
7 assert("1.0.0-pre.release+meta" == expandVersion("1-pre.release+meta"));

See Also

bumpVersion

Meta