parseSequenceComponent static method

List<int> parseSequenceComponent(
  1. String s
)

Implementation

static List<int> parseSequenceComponent(String s) {
  final components = s.split('-');
  if (components.length != 2) {
    throw InvalidSequenceComponentError();
  }

  final seqNum = toUint32(int.parse(components[0]));
  final seqLength = int.parse(components[1]);

  if (seqNum < 1 || seqLength < 1) {
    throw InvalidSequenceComponentError();
  }

  return [seqNum, seqLength];
}