From 5b3044be4d16de39ec9b5f5595883f96bf4891da Mon Sep 17 00:00:00 2001 From: edizcelik Date: Fri, 17 Dec 2021 17:42:51 +0300 Subject: [PATCH] chore: Use const instead of var --- build.mjs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/build.mjs b/build.mjs index 5b35f0c4..a6d2e400 100644 --- a/build.mjs +++ b/build.mjs @@ -62,17 +62,14 @@ function createTargetDirectoryName(source) { function copyDirectorySync(source, target) { let targetDirName = createTargetDirectoryName(path.basename(source)); - var files = []; - - // Check if folder needs to be created or integrated - var targetFolder = path.join(target, targetDirName); + const files = []; + const targetFolder = path.join(target, targetDirName); if (!existsSync(targetFolder)) { console.log(`┏━━━ Creating ${targetFolder} ━━━━━━━━━━━━`); mkdirSync(targetFolder); } - // Copy source if (lstatSync(source).isDirectory()) { console.log( ` @@ -81,7 +78,7 @@ function copyDirectorySync(source, target) { files = readdirSync(source); files.forEach(function (file) { - var curSource = path.join(source, file); + const curSource = path.join(source, file); if (lstatSync(curSource).isDirectory()) { copyDirectorySync(curSource, targetFolder);