assert("1.0.0" == expandVersion("1")); assert("1.0.0" == expandVersion("1.0")); assert("1.0.0" == expandVersion("1.0.0")); // These are rather exotic variants... assert("1.0.0-pre.release" == expandVersion("1-pre.release")); assert("1.0.0+meta" == expandVersion("1+meta")); assert("1.0.0-pre.release+meta" == expandVersion("1-pre.release+meta"));
bumpVersion
Takes a partial version and expands it to a valid SemVer version.
This function corresponds to the semantics of the "~>" comparison operator's lower bound.