From 8b034e6cd89fe51360b7316cad166f1ee712345e Mon Sep 17 00:00:00 2001 From: Steven Date: Thu, 7 Jun 2018 20:58:29 -0400 Subject: [PATCH] Modernize syntax by using arrow funcs --- Jakefile.js | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/Jakefile.js b/Jakefile.js index fed1bf3e7fa..a6483355c73 100644 --- a/Jakefile.js +++ b/Jakefile.js @@ -643,23 +643,19 @@ task("generate-spec", [specMd]); // Makes a new LKG. This target does not build anything, but errors if not all the outputs are present in the built/local directory desc("Makes a new LKG out of the built js files"); -task("LKG", ["clean", "release", "local"].concat(libraryTargets), function () { +task("LKG", ["clean", "release", "local"].concat(libraryTargets), () => { const sizeBefore = getDirSize(LKGDirectory); var expectedFiles = [tscFile, servicesFile, serverFile, nodePackageFile, nodeDefinitionsFile, standaloneDefinitionsFile, tsserverLibraryFile, tsserverLibraryDefinitionFile, cancellationTokenFile, typingsInstallerFile, buildProtocolDts, watchGuardFile]. concat(libraryTargets). concat(localizationTargets); - var missingFiles = expectedFiles.filter(function (f) { - return !fs.existsSync(f); - }); + var missingFiles = expectedFiles.filter(f => !fs.existsSync(f)); if (missingFiles.length > 0) { fail(new Error("Cannot replace the LKG unless all built targets are present in directory " + builtLocalDirectory + ". The following files are missing:\n" + missingFiles.join("\n"))); } // Copy all the targets into the LKG directory jake.mkdirP(LKGDirectory); - for (i in expectedFiles) { - jake.cpR(expectedFiles[i], LKGDirectory); - } + expectedFiles.forEach(f => jake.cpR(f, LKGDirectory)); const sizeAfter = getDirSize(LKGDirectory); if (sizeAfter > (sizeBefore * 1.10)) {