src/parser.js
/**
 * Find grade and age average
 * @param {object} interpretations Calculated and interpreted statistics
 * @returns {object}
 */
Find grade and age average
@param {object} interpretations Calculated and interpreted statistics
@returns {object}
Find grade and age average @param { object } interpretations Calculated and interpreted statistics @returns { object }
function consensus(interpretations) {
  if (
    typeof interpretations != "object" ||
    Object.keys(interpretations).length < 1
  ) {
    throw new TypeError(
      "Parameter 'interpretations' must be a non-empty object"
    );
  }
  return {
    grade: utilities.average([
      interpretations.automatedReadability.grade,
      interpretations.fleschKincaid.grade,
      interpretations.colemanLiau.grade,
      interpretations.smog.grade,
      interpretations.rix.grade
    ]),
    age: utilities.average([
      interpretations.automatedReadability.age,
      interpretations.fleschKincaid.age,
      interpretations.colemanLiau.age,
      interpretations.smog.age
    ])
  };
}
function consensus ( interpretations ) { if ( typeof interpretations != "object" || Object . keys ( interpretations ) . length < 1 ) { throw new TypeError ( "Parameter 'interpretations' must be a non-empty object" ) ; } return { grade : utilities . average ( [ interpretations . automatedReadability . grade , interpretations . fleschKincaid . grade , interpretations . colemanLiau . grade , interpretations . smog . grade , interpretations . rix . grade ] ) , age : utilities . average ( [ interpretations . automatedReadability . age , interpretations . fleschKincaid . age , interpretations . colemanLiau . age , interpretations . smog . age ] ) } ; }
Find grade and age average
 @param {object} interpretations Calculated and interpreted statistics
 @returns {object}
Find grade and age average @param { object } interpretations Calculated and interpreted statistics @returns { object }