From 4d09a99857f93ff9123908a6673d28c88b597d28 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Fri, 31 Jan 2014 07:05:52 -0500 Subject: [PATCH] refactor(commander) getFilesStat -> onStat --- lib/server/commander.js | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/lib/server/commander.js b/lib/server/commander.js index 463a15f0..2d386d0f 100644 --- a/lib/server/commander.js +++ b/lib/server/commander.js @@ -41,9 +41,8 @@ */ function readDir(params, error, files) { var i, n, stats, filesData, fill, name, fileParams, - - p = params, - dirPath = getDirPath(p.path); + p = params, + dirPath = getDirPath(p.path); if (error) Util.exec(p.callback, error.toString()); @@ -72,7 +71,7 @@ stats : stats, }; - fs.stat(name, getFilesStat.bind(null, fileParams)); + fs.stat(name, onStat.bind(null, fileParams)); } else fillJSON(filesData); @@ -81,9 +80,9 @@ /** * async getting file states - * and putting it to lStats object + * and putting it to stats object */ - function getFilesStat(params, error, stat) { + function onStat(params, error, stat) { var n, keys, p = params; if (!error) @@ -105,10 +104,10 @@ /** * Function fill JSON by file stats * - * @param pStats - object, contain file stats. + * @param stats - object, contain file stats. * example {'1.txt': stat} * - * @param pFiles - array of files of current directory + * @param files - array of files of current directory */ function fillJSON(pParams) { var name, stat, mode, isDir, size, owner, modeStr,