lib/tools/dataValidator.js
function validate (data, schema) {
  if (!data || !schema) {
    throw new Error('Trying to validate without passing data and schema')
  }
  return Joi.validate(data, schema)
}
function validate (data, schema) {
  if (!data || !schema) {
    throw new Error('Trying to validate without passing data and schema')
  }
  return Joi.validate(data, schema)
}
function validate ( data , schema ) { if ( ! data || ! schema ) { throw new Error ( 'Trying to validate without passing data and schema' ) } return Joi . validate ( data , schema ) }
Validates data based on Joi schemas

@param {Object} data the data to be validated
@param {Object} schema the object schema specified in Joi against which data is validated
Validates data based on Joi schemas