diff --git a/helper/type_mapping.js b/helper/type_mapping.js index 3caea41d..41303583 100644 --- a/helper/type_mapping.js +++ b/helper/type_mapping.js @@ -1,5 +1,4 @@ -var extend = require('extend'), - _ = require('lodash'); +const _ = require('lodash'); function addStandardTargetsToAliases(standard, aliases) { var combined = _.extend({}, aliases); diff --git a/middleware/geocodeJSON.js b/middleware/geocodeJSON.js index 75cfd301..683feac4 100644 --- a/middleware/geocodeJSON.js +++ b/middleware/geocodeJSON.js @@ -1,5 +1,4 @@ var url = require('url'); -var extend = require('extend'); var geojsonify = require('../helper/geojsonify'); var _ = require('lodash'); @@ -74,7 +73,7 @@ function convertToGeocodeJSON(req, res, next, opts) { res.body.geocoding.timestamp = new Date().getTime(); // convert docs to geojson and merge with geocoding block - extend(res.body, geojsonify(req.clean, res.data || [])); + _.extend(res.body, geojsonify(req.clean, res.data || [])); next(); } diff --git a/package.json b/package.json index db7b2426..4f04cd06 100644 --- a/package.json +++ b/package.json @@ -44,7 +44,6 @@ "elasticsearch": "^13.0.0", "elasticsearch-exceptions": "0.0.4", "express": "^4.8.8", - "extend": "^3.0.1", "geojson": "^0.5.0", "@mapbox/geojson-extent": "^0.3.1", "geolib": "^2.0.18", diff --git a/sanitizer/_text_addressit.js b/sanitizer/_text_addressit.js index 381eebb7..6cf31f4d 100644 --- a/sanitizer/_text_addressit.js +++ b/sanitizer/_text_addressit.js @@ -1,6 +1,5 @@ var check = require('check-types'); var parser = require('addressit'); -var extend = require('extend'); var _ = require('lodash'); var logger = require('pelias-logger').get('api'); @@ -82,8 +81,8 @@ function parse(query) { var addressWithAdminParts = getAdminPartsBySplittingOnDelim(queryParts); var addressWithAddressParts= getAddressParts(queryParts.join(DELIM + ' ')); - var parsedAddress = extend(addressWithAdminParts, - addressWithAddressParts); + // combine the 2 objects + _.extend(addressWithAdminParts, addressWithAddressParts); var address_parts = [ 'name', 'number', @@ -99,8 +98,8 @@ function parse(query) { var parsed_text = {}; address_parts.forEach(function(part){ - if (parsedAddress[part]) { - parsed_text[part] = parsedAddress[part]; + if (addressWithAdminParts[part]) { + parsed_text[part] = addressWithAdminParts[part]; } });