src/configurationReader.js
/**
 * Merges a configuration file with its parent configuration file according to the settings in `inheritSources`,
 * `inheritExterns` and `inheritBuildOptions`.
 *
 * @private
 *
 * @returns {Object} The merged configuration object.
 * @param {?Object} configuration The current valid configuration object.
 * @param {string} configurationPath The path of the current valid configuration object.
 * @param {Object=} parentConfiguration An optional parent configuration object of the current valid configuration
 *        object.
 */


@private

@returns {Object} The merged configuration object.
@param {?Object} configuration The current valid configuration object.
@param {string} configurationPath The path of the current valid configuration object.
@param {Object=} parentConfiguration An optional parent configuration object of the current valid configuration
object.
@private @returns { Object } The merged configuration object . @param { ?Object } configuration The current valid configuration object . @param { string } configurationPath The path of the current valid configuration object . @param { Object = } parentConfiguration An optional parent configuration object of the current valid configuration object .
function mergeConfigurations (configuration, configurationPath, parentConfiguration) {
    if (!parentConfiguration && !configuration) return (new ConfigurationNormalizer()).normalize();
    if (!parentConfiguration) return configuration;
    if (!configuration) return parentConfiguration;
    var resultSources;
    if (parentConfiguration.next[configurationPath] && parentConfiguration.next[configurationPath].inheritSources) {
        resultSources = utils.mergeArrays(parentConfiguration.sources, configuration.sources);
    } else {
        resultSources = configuration.sources;
    }
    var resultExterns;
    if (parentConfiguration.next[configurationPath] && parentConfiguration.next[configurationPath].inheritExterns) {
        resultExterns = utils.mergeArrays(parentConfiguration.externs, configuration.externs);
    } else {
        resultExterns = configuration.externs;
    }
    var resultBuildOptions;
    if (parentConfiguration.next[configurationPath] &&
        parentConfiguration.next[configurationPath].inheritBuildOptions) {
        resultBuildOptions = utils.mergeArguments(parentConfiguration.buildOptions, configuration.buildOptions);
    } else {
        resultBuildOptions = configuration.buildOptions;
    }
    var resultWarningsFilterFile = [];
    Array.prototype.push.apply(resultWarningsFilterFile, configuration.warningsFilterFile);
    if (parentConfiguration.next[configurationPath] &&
        parentConfiguration.next[configurationPath].inheritWarningsFilterFile) {
        Array.prototype.push.apply(resultWarningsFilterFile, parentConfiguration.warningsFilterFile);
    }
    resultWarningsFilterFile = utils.arrayToSet(resultWarningsFilterFile);
    return {
        checkFs: configuration.checkFs,
        sources: resultSources,
        externs: resultExterns,
        outputFile: configuration.outputFile,
        warningsFilterFile: resultWarningsFilterFile,
        buildOptions: resultBuildOptions,
        compilationUnits: configuration.compilationUnits,
        next: configuration.next
    };
}
function mergeConfigurations ( configuration , configurationPath , parentConfiguration ) { if ( ! parentConfiguration && ! configuration ) return ( new ConfigurationNormalizer ( ) ) . normalize ( ) ; if ( ! parentConfiguration ) return configuration ; if ( ! configuration ) return parentConfiguration ; var resultSources ; if ( parentConfiguration . next [ configurationPath ] && parentConfiguration . next [ configurationPath ] . inheritSources ) { resultSources = utils . mergeArrays ( parentConfiguration . sources , configuration . sources ) ; } else { resultSources = configuration . sources ; } var resultExterns ; if ( parentConfiguration . next [ configurationPath ] && parentConfiguration . next [ configurationPath ] . inheritExterns ) { resultExterns = utils . mergeArrays ( parentConfiguration . externs , configuration . externs ) ; } else { resultExterns = configuration . externs ; } var resultBuildOptions ; if ( parentConfiguration . next [ configurationPath ] && parentConfiguration . next [ configurationPath ] . inheritBuildOptions ) { resultBuildOptions = utils . mergeArguments ( parentConfiguration . buildOptions , configuration . buildOptions ) ; } else { resultBuildOptions = configuration . buildOptions ; } var resultWarningsFilterFile = [ ] ; Array . prototype . push . apply ( resultWarningsFilterFile , configuration . warningsFilterFile ) ; if ( parentConfiguration . next [ configurationPath ] && parentConfiguration . next [ configurationPath ] . inheritWarningsFilterFile ) { Array . prototype . push . apply ( resultWarningsFilterFile , parentConfiguration . warningsFilterFile ) ; } resultWarningsFilterFile = utils . arrayToSet ( resultWarningsFilterFile ) ; return { checkFs : configuration . checkFs , sources : resultSources , externs : resultExterns , outputFile : configuration . outputFile , warningsFilterFile : resultWarningsFilterFile , buildOptions : resultBuildOptions , compilationUnits : configuration . compilationUnits , next : configuration . next } ; }
Merges a configuration file with its parent configuration file according to the settings in `inheritSources`,
 `inheritExterns` and `inheritBuildOptions`.
Merges a configuration file with its parent configuration file according to the settings in ` inheritSources ` ` inheritExterns ` and ` inheritBuildOptions ` .