code: function validate(object, validator, callback) {
    if (typeof callback === 'function') {
      return Joi.validate(object, validator, callback);
    } else {
      return Joi.validate(object, validator);
    }
  }
docs: The Joi validator function.