From a7f4d5e134966b1add369a3d29fcd44551f7ea33 Mon Sep 17 00:00:00 2001 From: ZYSzys <17367077526@163.com> Date: Sat, 1 Sep 2018 21:40:24 +0800 Subject: [PATCH] lib: refactor variable declarations PR-URL: https://github.com/nodejs/node/pull/22643 Reviewed-By: Anna Henningsen Reviewed-By: Daniel Bevenius --- lib/internal/fs/utils.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/internal/fs/utils.js b/lib/internal/fs/utils.js index 39f4c32906433a..889cafa3842c8c 100644 --- a/lib/internal/fs/utils.js +++ b/lib/internal/fs/utils.js @@ -113,15 +113,15 @@ for (const name of Reflect.ownKeys(Dirent.prototype)) { } function copyObject(source) { - var target = {}; - for (var key in source) + const target = {}; + for (const key in source) target[key] = source[key]; return target; } function getDirents(path, [names, types], callback) { - var i; - if (typeof callback == 'function') { + let i; + if (typeof callback === 'function') { const len = names.length; let toFinish = 0; callback = once(callback);