union method

  1. @override
VersionConstraint union(
  1. VersionConstraint other
)

Union with another constraint.

Implementation

@override
VersionConstraint union(VersionConstraint other) {
  if (other is VersionRange) {
    return VersionUnion([...ranges, other]);
  }
  if (other is VersionUnion) {
    return VersionUnion([...ranges, ...other.ranges]);
  }
  return this;
}