code: function assertThreshold(value, other, threshold) {
    if (!threshold && value > other) throw new ThresholdError();
    const ratio = 1 - (value / other);
    if (ratio < threshold) throw new ThresholdError();
  }
docs: CHECK THRESHOLDS  
  Throws if a given threshold ratio is not met.
  
  @param {number} value
  @param {number} other
  @param {?number} threshold