packages/optimizely-sdk/lib/core/project_config/index.js
function(config) {
    configValidator.validateDatafile(config.datafile);
    if (config.skipJSONValidation === true) {
      config.logger.log(LOG_LEVEL.INFO, sprintf(LOG_MESSAGES.SKIPPING_JSON_VALIDATION, MODULE_NAME));
    } else if (config.jsonSchemaValidator) {
      config.jsonSchemaValidator.validate(projectConfigSchema, config.datafile);
      config.logger.log(LOG_LEVEL.INFO, sprintf(LOG_MESSAGES.VALID_DATAFILE, MODULE_NAME));
    }
    return module.exports.createProjectConfig(config.datafile);
  }
function(config) {
    configValidator.validateDatafile(config.datafile);
    if (config.skipJSONValidation === true) {
      config.logger.log(LOG_LEVEL.INFO, sprintf(LOG_MESSAGES.SKIPPING_JSON_VALIDATION, MODULE_NAME));
    } else if (config.jsonSchemaValidator) {
      config.jsonSchemaValidator.validate(projectConfigSchema, config.datafile);
      config.logger.log(LOG_LEVEL.INFO, sprintf(LOG_MESSAGES.VALID_DATAFILE, MODULE_NAME));
    }
    return module.exports.createProjectConfig(config.datafile);
  }
function ( config ) { configValidator . validateDatafile ( config . datafile ) ; if ( config . skipJSONValidation === true ) { config . logger . log ( LOG_LEVEL . INFO , sprintf ( LOG_MESSAGES . SKIPPING_JSON_VALIDATION , MODULE_NAME ) ) ; } else if ( config . jsonSchemaValidator ) { config . jsonSchemaValidator . validate ( projectConfigSchema , config . datafile ) ; config . logger . log ( LOG_LEVEL . INFO , sprintf ( LOG_MESSAGES . VALID_DATAFILE , MODULE_NAME ) ) ; } return module . exports . createProjectConfig ( config . datafile ) ; }
Try to create a project config object from the given datafile and
configuration properties.
If successful, return the project config object, otherwise throws an error
@param  {Object} config
@param  {Object} config.datafile
@param  {Object} config.jsonSchemaValidator
@param  {Object} config.logger
@param  {Object} config.skipJSONValidation
@return {Object} Project config object
Try to create a project config object from the given datafile and configuration properties . If successful return the project config object otherwise throws an error