function computeStatus(aspect, value) {
  // Invalid if no aspect or if value is not a non-empty string!
  if (!aspect || typeof value !== 'string' || value.length === 0) {
    return constants.statuses.Invalid;
  }

  // "Timeout" special case
  if (value === constants.statuses.Timeout) {
    return constants.statuses.Timeout;
  }

  let num;

  // Boolean value type: Case-insensitive 'true'
  if (value.toLowerCase() === 'true') {
    num = 1;
  } else if (value.toLowerCase() === 'false') {
    // Boolean value type: Case-insensitive 'false'
    num = 0;
  } else {
    num = Number(value);
  }

  // If not true|false|Timeout, then value must be convertible to number!
  if (isNaN(num)) {
    return constants.statuses.Invalid;
  }

  if (inRange(num, aspect.criticalRange)) {
    return constants.statuses.Critical;
  } else if (inRange(num, aspect.warningRange)) {
    return constants.statuses.Warning;
  } else if (inRange(num, aspect.infoRange)) {
    return constants.statuses.Info;
  } else if (inRange(num, aspect.okRange)) {
    return constants.statuses.OK;
  }

  return constants.statuses.Invalid;
} // computeStatus
/**
 * Computes status based on the value and the ranges defined in the associated
 * aspect.
 *
 * @param {Aspect} aspect - The associated aspect which provides the ranges are
 *  used to determine the status to assign
 * @param {String} value - The value to evaluate.
 * @returns {String} status, based on the value and the aspect status
 *  ranges
 */
Computes status based on the value and the ranges defined in the associated
aspect.

@param {Aspect} aspect - The associated aspect which provides the ranges are
used to determine the status to assign
@param {String} value - The value to evaluate.
@returns {String} status, based on the value and the aspect status
ranges
Computes status based on the value and the ranges defined in the associated aspect . @param { Aspect } aspect - The associated aspect which provides the ranges are used to determine the status to assign @param { String } value - The value to evaluate . @returns { String } status based on the value and the aspect status ranges
function computeStatus(aspect, value) {
  if (!aspect || typeof value !== 'string' || value.length === 0) {
    return constants.statuses.Invalid;
  }
  if (value === constants.statuses.Timeout) {
    return constants.statuses.Timeout;
  }
  let num;
  if (value.toLowerCase() === 'true') {
    num = 1;
  } else if (value.toLowerCase() === 'false') {
    num = 0;
  } else {
    num = Number(value);
  }
  if (isNaN(num)) {
    return constants.statuses.Invalid;
  }
  if (inRange(num, aspect.criticalRange)) {
    return constants.statuses.Critical;
  } else if (inRange(num, aspect.warningRange)) {
    return constants.statuses.Warning;
  } else if (inRange(num, aspect.infoRange)) {
    return constants.statuses.Info;
  } else if (inRange(num, aspect.okRange)) {
    return constants.statuses.OK;
  }
  return constants.statuses.Invalid;
} 
function computeStatus ( aspect , value ) { if ( ! aspect || typeof value !== 'string' || value . length === 0 ) { return constants . statuses . Invalid ; } if ( value === constants . statuses . Timeout ) { return constants . statuses . Timeout ; } let num ; if ( value . toLowerCase ( ) === 'true' ) { num = 1 ; } else if ( value . toLowerCase ( ) === 'false' ) { num = 0 ; } else { num = Number ( value ) ; } if ( isNaN ( num ) ) { return constants . statuses . Invalid ; } if ( inRange ( num , aspect . criticalRange ) ) { return constants . statuses . Critical ; } else if ( inRange ( num , aspect . warningRange ) ) { return constants . statuses . Warning ; } else if ( inRange ( num , aspect . infoRange ) ) { return constants . statuses . Info ; } else if ( inRange ( num , aspect . okRange ) ) { return constants . statuses . OK ; } return constants . statuses . Invalid ; }
Computes status based on the value and the ranges defined in the associated
 aspect.
Computes status based on the value and the ranges defined in the associated aspect .
// Invalid if no aspect or if value is not a non-empty string! // "Timeout" special case // Boolean value type: Case-insensitive 'true' // Boolean value type: Case-insensitive 'false' // If not true|false|Timeout, then value must be convertible to number! // computeStatus