SemVer.parse constructor

SemVer.parse(
  1. String version
)

Parse a version string, throwing if it cannot be parsed.

Implementation

factory SemVer.parse(String version) {
  final result = tryParse(version);
  if (result == null) {
    throw FormatException('Invalid semver: $version');
  }
  return result;
}