VersionConstraint.intersection constructor

VersionConstraint.intersection(Iterable<VersionConstraint> constraints)

Creates a new version constraint that is the intersection of constraints.

It only allows versions that all of those constraints allow. If constraints is empty, then it returns a VersionConstraint that allows all versions.


factory VersionConstraint.intersection(
    Iterable<VersionConstraint> constraints) {
  var constraint = new VersionRange();
  for (var other in constraints) {
    constraint = constraint.intersect(other);
  return constraint;