Skip to content

Commit

Permalink
Replace pelias-mergeable with lodash.merge
Browse files Browse the repository at this point in the history
pelias-mergeable is to be deprecated, so replace usage with the functionality
provided by lodash.

Given we only require a small subset of lodash, add dependency for lodash.merge
to avoid pulling in an unnecessarily large dependency.
  • Loading branch information
Echelon9 committed Jan 31, 2018
1 parent 9b0b5dd commit e5318f7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"colors": "^1.1.2",
"elasticsearch": "^13.3.1",
"joi": "^12.0.0",
"mergeable": "latest",
"lodash.merge": "^4.6.0",
"pelias-config": "2.13.0"
},
"devDependencies": {
Expand Down
6 changes: 2 additions & 4 deletions settings.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

var Mergeable = require('mergeable');
var merge = require('lodash.merge');
var peliasConfig = require('pelias-config');
var punctuation = require('./punctuation');
var street_suffix = require('./street_suffix');
Expand Down Expand Up @@ -308,9 +308,7 @@ function generate(){
if( 'object' == typeof config &&
'object' == typeof config.elasticsearch &&
'object' == typeof config.elasticsearch.settings ){
var defaults = new Mergeable( settings );
defaults.deepMerge( config.elasticsearch.settings );
return defaults.export();
return merge({}, settings, config.elasticsearch.settings);
}

return settings;
Expand Down

0 comments on commit e5318f7

Please sign in to comment.