parseVersion function

Version parseVersion(
  1. String version
)

Implementation

Version parseVersion(String version) {
  final match = _versionPattern.firstMatch(version);

  if (match == null) {
    throw ShipworldException('Invalid version: $version');
  }

  return Version(
    major: int.parse(match.group(1)!),
    minor: int.parse(match.group(2)!),
    patch: int.parse(match.group(3)!),
  );
}