From 795474f87b803a73be45731664c6e77e45ae8b0d Mon Sep 17 00:00:00 2001 From: Stephen Hess Date: Tue, 3 Oct 2017 15:37:59 -0400 Subject: [PATCH 1/6] removed unused dependency --- helper/type_mapping.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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); From 759c0e0939f38c9123e18697324ab5ea0fe0b08b Mon Sep 17 00:00:00 2001 From: Stephen Hess Date: Tue, 3 Oct 2017 15:41:21 -0400 Subject: [PATCH 2/6] switched to lodash.extend over extend module --- middleware/geocodeJSON.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/middleware/geocodeJSON.js b/middleware/geocodeJSON.js index 75cfd301..9bc20f1b 100644 --- a/middleware/geocodeJSON.js +++ b/middleware/geocodeJSON.js @@ -74,7 +74,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(); } From 16e01b504909fa38462c419f7af3961237c32128 Mon Sep 17 00:00:00 2001 From: Stephen Hess Date: Tue, 3 Oct 2017 15:43:09 -0400 Subject: [PATCH 3/6] remove unused require --- middleware/geocodeJSON.js | 1 - 1 file changed, 1 deletion(-) diff --git a/middleware/geocodeJSON.js b/middleware/geocodeJSON.js index 9bc20f1b..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'); From 1e003efe28e7be99a43fa634e70f9302b7fc3b69 Mon Sep 17 00:00:00 2001 From: Stephen Hess Date: Tue, 3 Oct 2017 15:48:29 -0400 Subject: [PATCH 4/6] used lodash.extend instead of extend module --- sanitizer/_text_addressit.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sanitizer/_text_addressit.js b/sanitizer/_text_addressit.js index 381eebb7..b80f40fa 100644 --- a/sanitizer/_text_addressit.js +++ b/sanitizer/_text_addressit.js @@ -82,8 +82,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 +99,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]; } }); From 6fd3c011fbf453f07d647374c2ca98ade89227aa Mon Sep 17 00:00:00 2001 From: Stephen Hess Date: Tue, 3 Oct 2017 15:50:09 -0400 Subject: [PATCH 5/6] remove unused require --- sanitizer/_text_addressit.js | 1 - 1 file changed, 1 deletion(-) diff --git a/sanitizer/_text_addressit.js b/sanitizer/_text_addressit.js index b80f40fa..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'); From 6ee5e897b11fcec3283c239c94ba734e85d739e3 Mon Sep 17 00:00:00 2001 From: Stephen Hess Date: Tue, 3 Oct 2017 15:50:50 -0400 Subject: [PATCH 6/6] removed unused dependency --- package.json | 1 - 1 file changed, 1 deletion(-) 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",