From 307fce80798b48f93bfb2c48b0502a1a0bcab948 Mon Sep 17 00:00:00 2001 From: Stephen Hess Date: Wed, 9 Nov 2016 13:35:13 -0500 Subject: [PATCH] started conversion to ES6 --- middleware/trimByGranularityComponent.js | 6 +++--- sanitizer/_synthesize_analysis.js | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/middleware/trimByGranularityComponent.js b/middleware/trimByGranularityComponent.js index 25440598..67a12a72 100644 --- a/middleware/trimByGranularityComponent.js +++ b/middleware/trimByGranularityComponent.js @@ -40,13 +40,13 @@ function isFallbackQuery(results) { } function hasRecordsAtLayers(results, layer) { - return results.some(function(result) { + return results.some( (result) => { return result._matched_queries[0] === 'fallback.' + layer; }); } function retainRecordsAtLayers(results, layer) { - return results.filter(function(result) { + return results.filter( (result) => { return result._matched_queries[0] === 'fallback.' + layer; }); } @@ -61,7 +61,7 @@ function setup() { // start at the most granular possible layer. if there are results at a layer // then remove everything not at that layer. - layers.forEach(function(layer) { + layers.forEach( (layer) => { if (hasRecordsAtLayers(res.data, layer )) { res.data = retainRecordsAtLayers(res.data, layer); } diff --git a/sanitizer/_synthesize_analysis.js b/sanitizer/_synthesize_analysis.js index ac1ad4c8..6b0a4d0c 100644 --- a/sanitizer/_synthesize_analysis.js +++ b/sanitizer/_synthesize_analysis.js @@ -13,7 +13,7 @@ function sanitize( raw, clean ){ var messages = { errors: [], warnings: [] }; // collect all the valid values into a single object - clean.parsed_text = fields.reduce(function(o, f) { + clean.parsed_text = fields.reduce( (o, f) => { if (_.isString(raw[f]) && !_.isEmpty(_.trim(raw[f]))) { o[f] = normalizeWhitespaceToSingleSpace(raw[f]); }