From 631c881f8356a3e6665b6f5f91283ae5fb28f9f5 Mon Sep 17 00:00:00 2001 From: Zach Leatherman Date: Fri, 24 Jun 2022 17:03:18 -0500 Subject: [PATCH] A few more style tweaks for #1686 --- src/TemplatePassthrough.js | 8 ++++---- src/TemplatePassthroughManager.js | 6 +++--- test/TemplatePassthroughManagerTest.js | 1 - 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/TemplatePassthrough.js b/src/TemplatePassthrough.js index 1b7cc6366..a6de99901 100644 --- a/src/TemplatePassthrough.js +++ b/src/TemplatePassthrough.js @@ -44,7 +44,7 @@ class TemplatePassthrough { } getOutputPath(inputFileFromGlob) { - const { inputDir, outputDir, outputPath, inputPath } = this; + let { inputDir, outputDir, outputPath, inputPath } = this; if (outputPath === true) { return TemplatePath.normalize( @@ -106,7 +106,7 @@ class TemplatePassthrough { debug("Searching for: %o", glob); let b = this.benchmarks.aggregate.get("Searching the file system"); b.before(); - const files = TemplatePath.addLeadingDotSlashArray( + let files = TemplatePath.addLeadingDotSlashArray( await fastglob(glob, { caseSensitiveMatch: false, dot: true, @@ -193,7 +193,7 @@ class TemplatePassthrough { // default options for recursive-copy // see https://www.npmjs.com/package/recursive-copy#arguments - const copyOptionsDefault = { + let copyOptionsDefault = { overwrite: true, // overwrite output. fails when input is directory (mkdir) and output is file dot: true, // copy dotfiles junk: false, // copy cache files like Thumbs.db @@ -206,7 +206,7 @@ class TemplatePassthrough { // e.g. `{ filePaths: [ './img/coolkid.jpg' ], relativePaths: [ '' ] }` }; - const copyOptions = Object.assign(copyOptionsDefault, this.copyOptions); + let copyOptions = Object.assign(copyOptionsDefault, this.copyOptions); let promises = fileMap.map((entry) => { // For-free passthrough copy diff --git a/src/TemplatePassthroughManager.js b/src/TemplatePassthroughManager.js index 4f718d6ea..65a00d59a 100644 --- a/src/TemplatePassthroughManager.js +++ b/src/TemplatePassthroughManager.js @@ -75,10 +75,10 @@ class TemplatePassthroughManager { } getConfigPaths() { - const paths = []; - const pathsRaw = this.config.passthroughCopies || {}; + let paths = []; + let pathsRaw = this.config.passthroughCopies || {}; debug("`addPassthroughCopy` config API paths: %o", pathsRaw); - for (const [inputPath, { outputPath, copyOptions }] of Object.entries( + for (let [inputPath, { outputPath, copyOptions }] of Object.entries( pathsRaw )) { paths.push(this._normalizePaths(inputPath, outputPath, copyOptions)); diff --git a/test/TemplatePassthroughManagerTest.js b/test/TemplatePassthroughManagerTest.js index 33f7d8214..ac9fb3196 100644 --- a/test/TemplatePassthroughManagerTest.js +++ b/test/TemplatePassthroughManagerTest.js @@ -3,7 +3,6 @@ const fs = require("fs"); const TemplatePassthroughManager = require("../src/TemplatePassthroughManager"); const TemplateConfig = require("../src/TemplateConfig"); const EleventyFiles = require("../src/EleventyFiles"); -const EleventyExtensionMap = require("../src/EleventyExtensionMap"); test("Get paths from Config", async (t) => { let eleventyConfig = new TemplateConfig();