allowsAny method

Returns true if this constraint allows any of the versions that other allows.

Implementation

@override
bool allowsAny(PackageVersionNumberGeneralLibraryConstraint other) {
  if (other.isEmpty) return false;
  if (other is PackageVersionNumberGeneralLibrary) return allows(other);

  if (other is PackageVersionNumberGeneralLibraryUnion) {
    return other.ranges.any(allowsAny);
  }

  if (other is PackageVersionNumberGeneralLibraryRange) {
    return !strictlyLower(other, this) && !strictlyHigher(other, this);
  }

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