nl_tokens: / * Function that manage the indexing of an array of caches path directory
pl_tokens: function globCaches ( pathsArray ) { let deepIndex = [ ] ; let mergedIndex ; // checking that previousCacheDir content is an array if ( ! Array . isArray ( pathsArray ) ) { logger_1 . logger . log ( 'warn' , 'previousCacheDir variable from config file is not an Array' ) ; throw 'stop execution' ; } //checking if pathsArray contains some empty string. If yes, we do not considerate them. if ( pathsArray . includes ( '' ) ) { let indexToRemove = pathsArray . map ( ( e , i ) => e === "" ? i : '' ) . filter ( String ) ; pathsArray = pathsArray . filter ( function ( <mask> ) { return element !== '' ; } ) ; } // finding pattern of jobID.json inside cache path for ( let element in pathsArray ) { deepIndex . push ( glob . sync ( pathsArray [ element ] + "/**/jobID\.json" , { follow : true } ) ) ; logger_1 . logger . log ( 'debug' , ` ${ deepIndex [ element ] . length } ${ pathsArray [ element ] } ` ) ; } // merged array of array into simple array of all path that contain a jobID.json file mergedIndex = [ ] . concat . apply ( [ ] , deepIndex ) ; logger_1 . logger . log ( 'debug' , ` \n ${ JSON . stringify ( mergedIndex ) } \n ` ) ; return mergedIndex ; }