From 80ea49c69cf64e6fa4c90abfc3b91a0f017d7c7d Mon Sep 17 00:00:00 2001 From: Eric Mc Sween Date: Mon, 11 May 2020 10:47:27 -0400 Subject: [PATCH] Decaf cleanup: remove __guard__ --- services/document-updater/app/js/HttpController.js | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/services/document-updater/app/js/HttpController.js b/services/document-updater/app/js/HttpController.js index 3d029461b0..8c2501fdbe 100644 --- a/services/document-updater/app/js/HttpController.js +++ b/services/document-updater/app/js/HttpController.js @@ -6,7 +6,6 @@ // Fix any style issues and re-enable lint. /* * decaffeinate suggestions: - * DS103: Rewrite code to no longer use __guard__ * DS207: Consider shorter variations of null checks * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md */ @@ -81,9 +80,7 @@ module.exports = HttpController = { const projectStateHash = req.query != null ? req.query.state : undefined // exclude is string of existing docs "id:version,id:version,..." const excludeItems = - __guard__(req.query != null ? req.query.exclude : undefined, (x) => - x.split(',') - ) || [] + req.query.exclude != null ? req.query.exclude.split(',') : [] logger.log({ project_id, exclude: excludeItems }, 'getting docs via http') const timer = new Metrics.Timer('http.getAllDocs') const excludeVersions = {} @@ -462,9 +459,3 @@ module.exports = HttpController = { }) } } - -function __guard__(value, transform) { - return typeof value !== 'undefined' && value !== null - ? transform(value) - : undefined -}