<commit_before>var _ = require('lodash');

/**
 * Create base instance for location service
 * @param {Object} [_config]
 * @constructor
 */
function BaseLocation(_config) {
  this._config = {};

  _.forOwn(_config, function (value, key) {
    this.set(key, value);
  }.bind(this));
}

/**
 * Get configuration value
 * @param {String} [path]
 * @returns {*}
 */
BaseLocation.prototype.get = function (path) {
  return typeof path === 'undefined' ? this._config : _.get(this._config, path);
};

/**
 * Set configuration value
 * @param {String} path
 * @param {*} value
 * @returns {BaseLocation}
 */
BaseLocation.prototype.set = function (path, value) {
  _.set(this._config, path, value);
  return this;
};

/**
 * Get location provider
 * @returns {*}
 */
BaseLocation.prototype.getProvider = function () {
  return this._provider;
};

/**
 * Set new provider
 * @param {*} provider
 * @returns {BaseLocation}
 */
BaseLocation.prototype.setProvider = function (provider) {
  this._provider = provider;
  return this;
};

BaseLocation.prototype.geocode = _;
BaseLocation.prototype.reverse = _;

module.exports = BaseLocation;<commit_msg>Rewrite BaseLocation with ES6<commit_after>import _ from 'lodash';

export default class BaseLocation {
  constructor(_config) {
    this._config = {};
    this._provider = {};

    _.assign(this._config, _config);
  }

  /**
   * Get configuration value
   * @param {String} [path]
   * @returns {*}
   */
  get(path) {
    return typeof path === 'undefined' ? this._config : _.get(this._config, path);
  }

  /**
   * Set configuration value
   * @param {String} path
   * @param {*} value
   * @returns {BaseLocation}
   */
  set(path, value) {
    _.set(this._config, path, value);
    return this;
  }

  /**
   * Get location provider
   * @returns {*}
   */
  getProvider() {
    return this._provider;
  }

  /**
   * Set new provider
   * @param {*} provider
   * @returns {BaseLocation}
   */
  setProvider(provider) {
    this._provider = provider;
    return this;
  }
}
{'fraction_non_alphanumeric': 0.15784265215239981, 'fraction_numerical': 0.0004948045522018803, 'mean_word_length': 3.2748414376321353, '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': '6917519', 'n_tokens_mistral': 645, 'n_tokens_neox': 631, 'n_words': 149}