allowsAny method

  1. @override
bool allowsAny(
  1. VersionConstraint other
)
override

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

Implementation

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

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

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

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