From 323890cedb4f57e3a43ad1de94745ae72ddf6b41 Mon Sep 17 00:00:00 2001 From: Brian Gough Date: Fri, 18 Dec 2020 15:10:53 +0000 Subject: [PATCH] remove Array.from --- services/clsi/app/js/OutputFileFinder.js | 27 +++--------------------- 1 file changed, 3 insertions(+), 24 deletions(-) diff --git a/services/clsi/app/js/OutputFileFinder.js b/services/clsi/app/js/OutputFileFinder.js index 70191a2693..e62284fe41 100644 --- a/services/clsi/app/js/OutputFileFinder.js +++ b/services/clsi/app/js/OutputFileFinder.js @@ -1,17 +1,3 @@ -/* eslint-disable - handle-callback-err, - no-return-assign, - no-unused-vars, - no-useless-escape, -*/ -// TODO: This file was created by bulk-decaffeinate. -// Fix any style issues and re-enable lint. -/* - * decaffeinate suggestions: - * DS101: Remove unnecessary use of Array.from - * DS103: Rewrite code to no longer use __guard__ - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ let OutputFileFinder const async = require('async') const fs = require('fs') @@ -34,12 +20,11 @@ module.exports = OutputFileFinder = { return callback(error) } const outputFiles = [] - for (const file of Array.from(allFiles)) { + for (const file of allFiles) { if (!incomingResources.has(file)) { - const type = Path.extname(file) outputFiles.push({ path: file, - type: Path.extname(file) || undefined, + type: Path.extname(file).replace(/^\./, '') || undefined, }) } } @@ -62,7 +47,7 @@ module.exports = OutputFileFinder = { const args = [ directory, '(', - ...Array.from(EXCLUDE_DIRS), + ...EXCLUDE_DIRS, ')', '-prune', '-o', @@ -94,9 +79,3 @@ module.exports = OutputFileFinder = { }) }, } - -function __guard__(value, transform) { - return typeof value !== 'undefined' && value !== null - ? transform(value) - : undefined -}