allowsAll method

bool allowsAll (VersionConstraint other)
override

Returns true if this constraint allows all the versions that other allows.

Implementation

bool allowsAll(VersionConstraint other) {
  if (other.isEmpty) return true;
  if (other is Version) return allows(other);

  if (other is VersionUnion) {
    return other.ranges.every((constraint) => allowsAll(constraint));
  }

  if (other is VersionRange) {
    return !allowsLower(other, this) && !allowsHigher(other, this);
  }

  throw new ArgumentError('Unknown VersionConstraint type $other.');
}