refactor(commander) getFilesStat -> onStat

This commit is contained in:
coderaiser 2014-01-31 07:05:52 -05:00
parent c0911f5181
commit 4d09a99857

View file

@ -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,