union method
override
Returns a VersionConstraint that allows Versions
s allowed by either
this or other
.
Implementation
VersionConstraint union(VersionConstraint other) {
if (other.allows(this)) return other;
if (other is VersionRange) {
if (other.min == this) {
return new VersionRange(
min: other.min,
max: other.max,
includeMin: true,
includeMax: other.includeMax,
alwaysIncludeMaxPreRelease: true);
}
if (other.max == this) {
return new VersionRange(
min: other.min,
max: other.max,
includeMin: other.includeMin,
includeMax: true,
alwaysIncludeMaxPreRelease: true);
}
}
return new VersionConstraint.unionOf([this, other]);
}