<commit_before>'use strict';
/**
 * Plugin configuration.
 */

const _ = require('lodash');

/** 
 * Plugin defaults
 */
const DefaultConfig = {
  webpackConfig: 'webpack.config.js',
  includeModules: false,
  packager: 'npm',
  packagerOptions: {},
  config: null
};

class Configuration {

  constructor(custom) {

    this._config = {};
    this._hasLegacyConfig = false;

    // Set configuration from sls.service.custom. We fall back to the
    // old configuration to keep backwards compatibility.
    if (custom) {
      if (custom.webpackIncludeModules) {
        this._config.includeModules = custom.webpackIncludeModules;
        this._hasLegacyConfig = true;
      }
      if (custom.packExternalModulesMaxBuffer) {
        this._hasLegacyConfig = true;
      }
      if (_.isString(custom.webpack)) {
        this._config.webpackConfig = custom.webpack;
        this._hasLegacyConfig = true;
      } else {
        _.assign(this._config, custom.webpack || {});
      }
    }

    // Set defaults for all missing properties
    _.defaults(this._config, DefaultConfig);
  }

  get webpackConfig() {
    return this._config.webpackConfig;
  }

  get includeModules() {
    return this._config.includeModules;
  }<commit_msg>Removed unnecessary configuration check<commit_after>'use strict';
/**
 * Plugin configuration.
 */

const _ = require('lodash');

/** 
 * Plugin defaults
 */
const DefaultConfig = {
  webpackConfig: 'webpack.config.js',
  includeModules: false,
  packager: 'npm',
  packagerOptions: {},
  config: null
};

class Configuration {

  constructor(custom) {

    this._config = {};
    this._hasLegacyConfig = false;

    // Set configuration from sls.service.custom. We fall back to the
    // old configuration to keep backwards compatibility.
    if (custom) {
      if (custom.webpackIncludeModules) {
        this._config.includeModules = custom.webpackIncludeModules;
        this._hasLegacyConfig = true;
      }
      if (_.isString(custom.webpack)) {
        this._config.webpackConfig = custom.webpack;
        this._hasLegacyConfig = true;
      } else {
        _.assign(this._config, custom.webpack || {});
      }
    }

    // Set defaults for all missing properties
    _.defaults(this._config, DefaultConfig);
  }

  get webpackConfig() {
    return this._config.webpackConfig;
  }

  get includeModules() {
    return this._config.includeModules;
  }
{'fraction_non_alphanumeric': 0.11597830621610346, 'fraction_numerical': 0.0, 'mean_word_length': 2.8368, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1960332', 'n_tokens_mistral': 694, 'n_tokens_neox': 681, 'n_words': 153}