validated static method

Feature validated(
  1. Feature feature
)

Implementation

static Feature validated(Feature feature) {
  if (feature.cubics.isEmpty) {
    throw ArgumentError("Features need at least one cubic.");
  }
  if (!_isContinuous(feature)) {
    throw ArgumentError(
      "Feature must be continuous, with the anchor points of all cubics "
      "matching the anchor points of the preceding and succeeding cubics",
    );
  }
  return feature;
}