lib/validation.helper.js
function lessThan(validatedObject, threshold, errorText) {
  number(validatedObject);
  number(threshold, 'Threshold is not a number');
  if (validatedObject >= threshold) {
    throw new ValidationError(
      errorText || `Validated number ${validatedObject} is not less than the threshold ${threshold}`
    );
  }
  return validatedObject;
}
function lessThan(validatedObject, threshold, errorText) {
  number(validatedObject);
  number(threshold, 'Threshold is not a number');
  if (validatedObject >= threshold) {
    throw new ValidationError(
      errorText || `Validated number ${validatedObject} is not less than the threshold ${threshold}`
    );
  }
  return validatedObject;
}
function lessThan ( 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 less than the specified number
@param {*} validatedObject
@param {number} threshold - if validated number is equal or larger 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 less than the specified number