Merge pull request #13097 from Snuffleupagus/eslint-no-var-add_test

Enable the ESLint `no-var` rule in `test/add_test.js`
This commit is contained in:
Tim van der Meij 2021-03-14 11:31:55 +01:00 committed by GitHub
commit 0ad9265555
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,5 +1,3 @@
/* eslint-disable no-var */
const fs = require("fs");
const crypto = require("crypto");
const execSync = require("child_process").execSync;
@ -25,8 +23,8 @@ if (!fs.existsSync(file)) {
}
function calculateMD5(pdfFile, callback) {
var hash = crypto.createHash("md5");
var stream = fs.createReadStream(pdfFile);
const hash = crypto.createHash("md5");
const stream = fs.createReadStream(pdfFile);
stream.on("data", function (data) {
hash.update(data);
});
@ -34,7 +32,7 @@ function calculateMD5(pdfFile, callback) {
callback(err);
});
stream.on("end", function () {
var result = hash.digest("hex");
const result = hash.digest("hex");
callback(null, result);
});
}