lib: refactor variable declarations

PR-URL: https://github.com/nodejs/node/pull/22643
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
This commit is contained in:
ZYSzys 2018-09-01 21:40:24 +08:00 committed by Daniel Bevenius
parent 0623aabbe1
commit 44f7c1df89

View File

@ -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);