Validate configuration
@param  {Object} config Configuration object
@return {null}          It will just throw error if invalid
492776
function validateConfig (config) {
  const customJoi = Joi.extend((joi) => ({
    base: joi.string(),
    name: 'file',
    language: {
      exists: 'file or directory must exists',
    },
    rules: [
      {
        name: 'exists',
        validate(params, value, state, options) {
          if (!fs.existsSync(value)) {
            return this.createError('file.exists', { v: value }, state, options)
          }
          return value
        }
      }
    ]
  }))

  const schema = Joi.object().keys({
    content: customJoi.file().exists().required(),
    output: Joi.string().required(),
    include: Joi.array().min(1).items(Joi.string()).required(),
    exclude: Joi.array().min(1).items(Joi.string()).required(),
    contentTypes: Joi.array().min(1).items(Joi.object()).required(),
  })
  const result = Joi.validate(config, schema, (err, value) => {
    if (err !== null) {
      throw err
    }
  })
}
210495
function(configPath, configNames, config) {
		var merged = mergeConfigs(configPath, configNames, config);
		merged = configurePaths(merged);
		validate(merged);
		return merged;
	}
202276
private function isValidConfig(array $config)
    {
        foreach ($this->configAttributes as $attribute) {
            if (!array_key_exists($attribute, $config)) {
                return false;
            }
        }

        return !empty($config['path']);
    }
1296045
protected function validateConfiguration($config)
    {
        $requiredFields = $this->getRequiredConfigurationFields();
        $missingFields = [];
        foreach ($requiredFields as $requiredField) {
            if (array_key_exists($requiredField, $config) === false) {
                $missingFields[] = $requiredField;
            }
        }
        if (count($missingFields) > 0) {
            throw new \RuntimeException('Some fields are not configured: ' . implode(', ', $missingFields));
        }
    }
42434
function validateConfig(config, parentPath) {
    if (parentPath === void 0) { parentPath = ''; }
    // forEach doesn't iterate undefined values
    for (var /** @type {?} */ i = 0; i < config.length; i++) {
        var /** @type {?} */ route = config[i];
        var /** @type {?} */ fullPath = getFullPath(parentPath, route);
        validateNode(route, fullPath);
    }
}
205322
def validate_config(self, config):
        
        # config is optional
        if not config:
            return config

        spec = validate_experiment_spec_config(config)

        if spec.is_experiment:
            # Resume normal creation
            return config

        # Raise an error to tell the user to use experiment creation instead
        raise ValidationError('Current experiment creation could not be performed.\n'
                              'The reason is that the specification sent correspond '
                              'to a `{}`.\n'.format(spec.kind))
459302
function checkConfig(config, md) {
    var _res = {};
    var hljs_class = config['hljs_class'];
    var pre_class = config['pre_class'];
    if(!pre_class) pre_class = 'highlight';
    checkValue(config, _res, 'highlight', function(str, lang) {
        if (lang && hljs.getLanguage(lang)) {
            try {
                return '<pre class="' + pre_class + '"><code class="' + lang + '">' + hljs.highlight(lang, str, true).value + '</code></pre>';
            } catch (__) {}
        }
        return '<pre class="' + pre_class + '"><code class="' + lang + '">' + utils.escapeHtml(str) + '</code></pre>';
    }, function(str, lang) {
        return '<pre class="' + pre_class + '"><code class="' + lang + '">' + utils.escapeHtml(str) + '</code></pre>';
    });
    checkValue(config, _res, 'html', true, false);
    checkValue(config, _res, 'xhtmlOut', true, false);
    checkValue(config, _res, 'breaks', true, false);
    checkValue(config, _res, 'linkify', true, false);
    checkValue(config, _res, 'typographer', true, false);
    _res['langPrefix'] = config['langPrefix'] ? config['langPrefix'] : '';
    _res['quotes'] = config['quotes'] ? config['quotes'] : '“”‘’';
    return _res;
}
1300701
function validate (config) {

	/** Make sure the config object was passed. */
	if (!config) {
		throw new TypeError('Missing configuration object.');
	}

	/** Make sure the panic url is provided. */
	if (typeof config.panic !== 'string') {
		throw new TypeError('Panic server URL "config.panic" not provided.');
	}

	/** Make sure config.clients is an array. */
	if (isArray(config.clients) === false) {
		throw new TypeError('"config.clients" is not an array.');
	}

	var str = JSON.stringify;

	/** Validate the client objects. */
	config.clients.forEach(function (client) {
		if (!client) {
			throw new Error('Client "' + client + '" is not an object.');
		}

		if (!client.type) {
			throw new Error('Missing client.type attribute: ' + str(client));
		}
	});
}
176672
function validateConfig() {
        var metadata = config.metadata;
        config.numPages = metadata.numpages;
        if (!config.pageStart) {
            config.pageStart = 1;
        } else if (config.pageStart < 0) {
            config.pageStart = metadata.numpages + config.pageStart;
        }
        config.pageStart = util.clamp(config.pageStart, 1, metadata.numpages);
        if (!config.pageEnd) {
            config.pageEnd = metadata.numpages;
        } else if (config.pageEnd < 0) {
            config.pageEnd = metadata.numpages + config.pageEnd;
        }
        config.pageEnd = util.clamp(config.pageEnd, config.pageStart, metadata.numpages);
        config.numPages = config.pageEnd - config.pageStart + 1;
    }
887275
public function check($config)
    {
        if ($this->key && !empty($config['allow_key']) && !in_array($this->key, $config['allow_key'])) {
            return false;
        }

        return true;
    }
169566
private void parseConfig(String config) {

        if (isValidConfig(config)) {
            String[] conf = config.split("x");
            if (conf[0].trim().equals("?")) {
                m_width = I_CmsFormatRestriction.DIMENSION_NOT_SET;
            } else {
                m_width = CmsClientStringUtil.parseInt(conf[0]);
                m_width = (m_width == 0) ? I_CmsFormatRestriction.DIMENSION_NOT_SET : m_width;
            }
            if (conf[1].trim().equals("?")) {
                m_height = I_CmsFormatRestriction.DIMENSION_NOT_SET;
            } else {
                m_height = CmsClientStringUtil.parseInt(conf[1]);
                m_height = (m_height == 0) ? I_CmsFormatRestriction.DIMENSION_NOT_SET : m_height;
            }
        }
    }
574402
function isValidConfig(config) {
    return (config.root != null && config.root.length > 0) &&
            isNullOrFunction(config.directoryFilter) &&
            isNullOrFunction(config.filesFilter) &&
            isNullOrString(config.directoryFilterRegex) &&
            isNullOrString(config.filesFilterRegex);
}
797566
function validateConfig (config) {
  var type = typeOf(config);

  if (type.hasValue && !type.isPOJO) {
    throw ono('Invalid arguments. Expected a configuration object.');
  }
}
619014
function defaultConsole (error, config) {
  // note unformatted error will not have any own properties to loop over. ie,
  // format needs to be called first
  let status
  let message
  if (!config.all && error.status < 400) {
    status = chalk.cyan(error.status)
  } else if (!config.all && error.status < 500) {
    status = chalk.yellow(error.status)
  } else {
    status = chalk.red(error.status)
    message = `[${error.name}] ${error.message}`
  }

  status = chalk.bold(status)

  console.error(`${prefix}${status} ${(message || error.message)}`)
  if (error.status === 422) {
    console.error(`${prefix}details: ${JSON.stringify(error.details, null, '  ')}`)
  }

  if (error.stack) {
    console.error(`${prefix}${highlightStack(error.stack.slice(error.stack.indexOf('\n') + 1)).trim()}\n`)
  }
}
1290855
function validateConfig(){

    if(!this.config.type){
        throw new Error(resources.errors.missingType);
    }
    if(this.config.type.toLowerCase() !== 'console'){
        throw new Error(resources.errors.incorrectAdapterType);
    }
    if(!this.config.application){
        throw new Error(resources.errors.missingApplication);
    }
    if(!this.config.machine){
        throw new Error(resources.errors.missingMachine);
    }
}
1191791
function checkOpts(config, cb) {
  // jshint eqnull: true

  var prefix = "ragents.createSession(): "

  if (config == null) throw Error(prefix + "config is null")

  if (config.url == null) throw Error(prefix + "config.url is null")
  if (config.key == null) throw Error(prefix + "config.key is null")

  if (null == cb)        throw Error(prefix + "callback is null")
  if (!_.isFunction(cb)) throw Error(prefix + "callback is not a function")
}
279368
function validateConfig(config) {
    // appId and versionId are not validated here since
    // not all operations require these to be present.
    // Validation of specific params are done in the
    // ServiceBase.js
    const { authoringKey, region } = config;
    const messageTail = `is missing from the configuration.\n\nDid you run ${chalk.cyan.bold('luis init')} yet?`;

    assert(typeof authoringKey === 'string', `The authoringKey  ${messageTail}`);
    assert(typeof region === 'string', `The region ${messageTail}`);
    assert(args.region == 'westus' || args.region == 'westeurope' || args.region == 'australiaeast' || args.region == 'virginia', `${args.region} is not a valid authoring region.  Valid values are [westus|westeurope|australiaeast|virginia]`);
}