fix(fs.listFolders()): fix retuen type

This commit is contained in:
2018-11-22 23:23:26 +01:00
parent b6b2101054
commit 52367f5c1a
5 changed files with 272 additions and 60 deletions

View File

@ -255,10 +255,10 @@ export let toVinylSync = function(filePathArg, options = {}) {
/**
* lists Folders in a directory on local disk
* @returns Promise
* @returns Promise with an array that contains the folder names
*/
export let listFolders = function(pathArg: string, regexFilter?: RegExp) {
let done = plugins.smartpromise.defer();
export let listFolders = function(pathArg: string, regexFilter?: RegExp): Promise<string[]> {
let done = plugins.smartpromise.defer<string[]>();
let folderArray = plugins.fsExtra.readdirSync(pathArg).filter(function(file) {
return plugins.fsExtra.statSync(plugins.path.join(pathArg, file)).isDirectory();
});