Browse Source

switched to `const` where appropriate

pull/712/head
Stephen Hess 8 years ago
parent
commit
e342a6b21d
  1. 4
      middleware/trimByGranularityComponent.js
  2. 6
      sanitizer/_synthesize_analysis.js

4
middleware/trimByGranularityComponent.js

@ -1,4 +1,4 @@
var _ = require('lodash');
const _ = require('lodash');
// This middleware component trims the results array by granularity when
// FallbackQuery was used. FallbackQuery is used for inputs like
@ -13,7 +13,7 @@ var _ = require('lodash');
// this component removes results that aren't the most granular.
// layers in increasing order of granularity
var layers = [
const layers = [
'venue',
'street',
'address',

6
sanitizer/_synthesize_analysis.js

@ -1,6 +1,6 @@
var _ = require('lodash');
const _ = require('lodash');
var fields = ['query', 'address', 'neighbourhood', 'city',
const fields = ['query', 'address', 'neighbourhood', 'city',
'county', 'state', 'postalcode', 'country'];
function normalizeWhitespaceToSingleSpace(val) {
@ -10,7 +10,7 @@ function normalizeWhitespaceToSingleSpace(val) {
function sanitize( raw, clean ){
// error & warning messages
var messages = { errors: [], warnings: [] };
const messages = { errors: [], warnings: [] };
// collect all the valid values into a single object
clean.parsed_text = fields.reduce( (o, f) => {

Loading…
Cancel
Save