hasCompatibleUnits method

bool hasCompatibleUnits(
  1. SassNumber other
)

Returns whether this has units that are compatible with other.

Unlike isComparableTo, unitless numbers are only considered compatible with other unitless numbers.

Implementation

bool hasCompatibleUnits(SassNumber other) {
  if (numeratorUnits.length != other.numeratorUnits.length) return false;
  if (denominatorUnits.length != other.denominatorUnits.length) return false;
  return isComparableTo(other);
}