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 pure
string
expandVersion
(
string ver
)

Examples

assertEquals("1.0.0", expandVersion("1"));
assertEquals("1.0.0", expandVersion("1.0"));
assertEquals("1.0.0", expandVersion("1.0.0"));
// These are rather excotic variants...
assertEquals("1.0.0-pre.release", expandVersion("1-pre.release"));
assertEquals("1.0.0+meta", expandVersion("1+meta"));
assertEquals("1.0.0-pre.release+meta", expandVersion("1-pre.release+meta"));

See Also

bumpVersion

Meta