@@ -18,12 +18,12 @@ function ls(args) {
1818
1919 executeFlags ( getFlags ( userArgs ) ) ;
2020
21- const fsItems = checkArgsLength ( getFsItems ( userArgs ) ) ;
2221 const currentWorkingDirectory = getCurrentWorkingDirectory ( args ) ;
23- const dirArgs = getDirArgs ( fsItems , currentWorkingDirectory ) ;
24- const fileArgs = getFileArgs ( fsItems , currentWorkingDirectory ) ;
22+ const fsItems = checkArgsLength ( getFsItems ( userArgs ) ) ;
23+ const dirArgs = getDirArgs ( currentWorkingDirectory , fsItems ) ;
24+ const fileArgs = getFileArgs ( currentWorkingDirectory , fsItems ) ;
2525
26- print ( populateOutput ( fsItems , dirArgs , fileArgs , currentWorkingDirectory ) ) ;
26+ print ( populateOutput ( currentWorkingDirectory , fsItems , dirArgs , fileArgs ) ) ;
2727}
2828
2929function getFsItems ( userArgs ) {
@@ -69,17 +69,17 @@ function checkArgsLength(fsItems) {
6969 return fsItems ;
7070}
7171
72- function getDirArgs ( fsItems , currentWorkingDirectory ) {
72+ function getDirArgs ( currentWorkingDirectory , fsItems ) {
7373 return fsItems . filter ( ( p ) => fs . statSync ( currentWorkingDirectory + "/" + p ) . isDirectory ( ) ) ;
7474}
7575
76- function getFileArgs ( fsItems , currentWorkingDirectory ) {
76+ function getFileArgs ( currentWorkingDirectory , fsItems ) {
7777 const fileArgs = fsItems . filter ( ( p ) => ! fs . statSync ( currentWorkingDirectory + "/" + p ) . isDirectory ( ) ) ;
7878 if ( showAll == false ) removeDotFiles ( fileArgs ) ;
7979 return fileArgs ;
8080}
8181
82- function populateOutput ( fsItems , dirArgs , fileArgs , currentWorkingDirectory ) {
82+ function populateOutput ( currentWorkingDirectory , fsItems , dirArgs , fileArgs ) {
8383 let outputString = "" ;
8484 if ( fsItems . length == 1 ) {
8585 fileArgs . forEach ( ( file ) => {
0 commit comments