* @param filterCondition * matches all given wildcards with available test modules to generate an elaborate filter condition
(filterCondition)
| 16 | * matches all given wildcards with available test modules to generate an elaborate filter condition |
| 17 | */ |
| 18 | function matchWildCards (filterCondition) { |
| 19 | const conditions = filterCondition.split(' ').length ? filterCondition.split(' ') : [filterCondition]; |
| 20 | const matches = []; |
| 21 | |
| 22 | for (const filter of conditions) { |
| 23 | if (isWildcard(filter)) { |
| 24 | const matchedDirs = Object.keys(buildDirs).filter(e => filterBy(filter, e)); |
| 25 | if (matchedDirs.length) { |
| 26 | matches.push(matchedDirs.join(' ')); |
| 27 | } |
| 28 | const matchedModules = Object.keys(buildFiles).filter(e => filterBy(filter, e)); |
| 29 | if (matchedModules.length) { matches.push(matchedModules.join(' ')); } |
| 30 | } else { |
| 31 | matches.push(filter); |
| 32 | } |
| 33 | } |
| 34 | |
| 35 | return matches.join(' '); |
| 36 | } |
| 37 | |
| 38 | module.exports.matchWildCards = matchWildCards; |
| 39 |
no test coverage detected