lib/validation.helper.js
function greaterThan(validatedObject, threshold, errorText) {
  number(validatedObject);
  number(threshold, 'Threshold is not a number');
  if (validatedObject <= threshold) {
    throw new ValidationError(
      errorText ||
        `Validated number ${validatedObject} is not greater than the threshold ${threshold}`
    );
  }
  return validatedObject;
}
function greaterThan(validatedObject, threshold, errorText) {
  number(validatedObject);
  number(threshold, 'Threshold is not a number');
  if (validatedObject <= threshold) {
    throw new ValidationError(
      errorText ||
        `Validated number ${validatedObject} is not greater than the threshold ${threshold}`
    );
  }
  return validatedObject;
}
function greaterThan ( validatedObject , threshold , errorText ) { number ( validatedObject ) ; number ( threshold , 'Threshold is not a number' ) ; if ( validatedObject <= threshold ) { throw new ValidationError ( errorText || ` ${ validatedObject } ${ threshold } ` ) ; } return validatedObject ; }
Checks value to be a number that is greater than specified number
@param {*} validatedObject
@param {number} threshold - if validated number is equal or less than this, throw an error
@param {String} [errorText] - message for error thrown if validation fails
@returns {number} validatedObject
Checks value to be a number that is greater than specified number