code: function getConfig(config, update) {
  	let configFilepath
  	if (isString(config)) {
  		// Load config from a given file
  		configFilepath = path.resolve(process.cwd(), config)
  		if (!fs.existsSync(configFilepath)) {
  			throw new StyleguidistError('Styleguidist config not found: ' + configFilepath + '.')
  		}
  		config = {}
  	} else if (!isPlainObject(config)) {
  		// Try to read config options from a file
  		configFilepath = findConfigFile()
  		config = {}
  	}
  
  	if (configFilepath) {
  		config = require(configFilepath)
  	}
  
  	if (update) {
  		config = update(config)
  	}
  
  	const configDir = configFilepath ? path.dirname(configFilepath) : process.cwd()
  
  	if (config.serverPort && isString(config.serverPort)) {
  		config.serverPort = parseInt(config.serverPort)
  	}
  
  	try {
  		return sanitizeConfig(config, schema, configDir)
  	} catch (exception) {
  		/* eslint-disable */
  		console.log(exception instanceof StyleguidistError, exception.constructor.name)
  		throw exception.message
  	}
  }
docs: Read, parse and validate config file or passed config.
  
  @param {object|string} [config] All config options or config file name or nothing.
  @param {function} [update] Change config object before running validation on it.
  @returns {object}