import * as fs from "fs" ; import * as minimatch from "minimatch" ; param rootPath param inclusions returns export const filterFoldersUnder = ( rootPath , inclusions ? ) => { const childrenNames = fs . readdirSync ( rootPath ) ; if ( inclusions === undefined ) { return childrenNames ; } const inclusionMatchers = Array . from ( inclusions . keys ( ) ) ; return childrenNames . filter ( ( childName ) => inclusionMatchers . some ( ( inclusionMatcher ) => minimatch ( childName , inclusionMatcher , { nocase : true , } ) ) ) ; } ;