code: function validateObject (object = {}, label, schema, options) {
    // Skip validation if no schema is provided
    if (schema) {
      // Validate the object against the provided schema
      const { error, value } = joi.validate(object, schema, options)
      if (error) {
        // Throw error with custom message if validation failed
        throw new Error(`Invalid ${label} - ${error.message}`)
      }
    }
  }
docs: Helper function to validate an object against the provided schema,
  and to throw a custom error if object is not valid.
  
  @param {Object} object The object to be validated.
  @param {String} label The label to use in the error message.
  @param {JoiSchema} schema The Joi schema to validate the object against.