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;

@@ -1,28 +1,26 @@
-var _ = require(
+import _ from 
 'lodash'
 );%0A%0A
@@ -19,131 +19,60 @@
 ash'
-)
 ;%0A%0A
-/**%0A * Create base instance for location service%0A * @param %7BObject%7D %5B_config%5D%0A * @constructor%0A */%0Afunction BaseLocation
+export default class BaseLocation %7B%0A  constructor
 (_co
@@ -75,24 +75,26 @@
 (_config) %7B%0A
+  
   this._conf
@@ -106,103 +106,84 @@
 %7B%7D;%0A
-%0A
   
-_.forOwn(_config, function (value, key) %7B%0A    this.set(key, value);%0A  %7D.bind(this)
+  this._provider = %7B%7D;%0A%0A    _.assign(this._config, _config
 );%0A
+  
 %7D%0A%0A
+  
 /**%0A
+  
  * G
@@ -197,32 +197,34 @@
 iguration value%0A
+  
  * @param %7BStrin
@@ -233,16 +233,18 @@
  %5Bpath%5D%0A
+  
  * @retu
@@ -255,50 +255,19 @@
 %7B*%7D%0A
+  
  */%0A
-BaseLocation.prototype.get = function 
+  get
 (pat
@@ -267,24 +267,26 @@
 get(path) %7B%0A
+  
   return typ
@@ -354,24 +354,29 @@
  path);%0A
-%7D;%0A%0A
+  %7D%0A%0A  
 /**%0A
+  
  * Set c
@@ -390,24 +390,26 @@
 ation value%0A
+  
  * @param %7BS
@@ -420,16 +420,18 @@
 g%7D path%0A
+  
  * @para
@@ -442,16 +442,18 @@
 %7D value%0A
+  
  * @retu
@@ -475,50 +475,19 @@
 on%7D%0A
+  
  */%0A
-BaseLocation.prototype.set = function 
+  set
 (pat
@@ -498,16 +498,18 @@
 alue) %7B%0A
+  
   _.set(
@@ -536,16 +536,18 @@
 value);%0A
+  
   return
@@ -553,24 +553,29 @@
 n this;%0A
-%7D;%0A%0A
+  %7D%0A%0A  
 /**%0A
+  
  * Get l
@@ -583,32 +583,34 @@
 cation provider%0A
+  
  * @returns %7B*%7D%0A
@@ -613,63 +613,34 @@
 %7B*%7D%0A
+  
  */%0A
-BaseLocation.prototype.getProvider = function 
+  getProvider
 () %7B%0A
+  
   re
@@ -664,16 +664,21 @@
 er;%0A
-%7D;%0A%0A
+  %7D%0A%0A  
 /**%0A
+  
  * S
@@ -689,24 +689,26 @@
 ew provider%0A
+  
  * @param %7B*
@@ -718,16 +718,18 @@
 rovider%0A
+  
  * @retu
@@ -751,58 +751,27 @@
 on%7D%0A
+  
  */%0A
-BaseLocation.prototype.setProvider = function 
+  setProvider
 (pro
@@ -779,16 +779,18 @@
 ider) %7B%0A
+  
   this._
@@ -810,16 +810,18 @@
 ovider;%0A
+  
   return
@@ -831,112 +831,10 @@
 is;%0A
-%7D;%0A%0ABaseLocation.prototype.geocode = _;%0ABaseLocation.prototype.reverse = _;%0A%0Amodule.exports = BaseLocation;
+  %7D%0A%7D
 %0A

Rewrite BaseLocation with ES6